Sometimes you may need to format a chip value before adding it, and for this case you can use a custom formatter function. This function will receive the chip value and must return the formatted value.
+
+
+
Hue Colors
@@ -156,6 +164,15 @@ export default {
type: 'Boolean',
description: 'Always check if there is a duplicated chip while changing the input value, or check it only on insertion',
defaults: 'false'
+ },
+ {
+ name: 'md-format',
+ type: 'Function',
+ description: [
+ 'Formatter before chip insertion. Effects to insertion and duplicated-checking.',
+ 'The Chips will pass the inputted value as a parameter of this function. This function returns the formatted result.'
+ ].join(' '),
+ defaults: 'null'
}
]
},
diff --git a/docs/app/pages/Components/Chips/examples/Format.vue b/docs/app/pages/Components/Chips/examples/Format.vue
new file mode 100644
index 000000000..6fc4f8460
--- /dev/null
+++ b/docs/app/pages/Components/Chips/examples/Format.vue
@@ -0,0 +1,47 @@
+
+
+
+
+
Three uppercase letters
+
+
+
+
+
Try inserting `Eugène Ysaÿe`. The formatter will remove diacritics.