From a88d29ade0ac27d3ce301d0ba5efa70000f7b1c2 Mon Sep 17 00:00:00 2001 From: Jiajun Chen Date: Tue, 7 May 2019 16:31:45 +0800 Subject: [PATCH] feat(text-field): add character counter --- .../text-field/TextFieldCharacterCounter.vue | 56 ++++++++++++++++++ components/text-field/TextFieldHelperText.vue | 1 + components/text-field/index.js | 2 + docs/.vuepress/components/TextfieldDemo.vue | 57 +++++++++++++++++++ 4 files changed, 116 insertions(+) create mode 100644 components/text-field/TextFieldCharacterCounter.vue diff --git a/components/text-field/TextFieldCharacterCounter.vue b/components/text-field/TextFieldCharacterCounter.vue new file mode 100644 index 000000000..67fdcf583 --- /dev/null +++ b/components/text-field/TextFieldCharacterCounter.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/components/text-field/TextFieldHelperText.vue b/components/text-field/TextFieldHelperText.vue index 98fbd31b4..3b76fa3b0 100644 --- a/components/text-field/TextFieldHelperText.vue +++ b/components/text-field/TextFieldHelperText.vue @@ -7,6 +7,7 @@ > + diff --git a/components/text-field/index.js b/components/text-field/index.js index af8a401b6..5447bd318 100644 --- a/components/text-field/index.js +++ b/components/text-field/index.js @@ -1,5 +1,6 @@ import TextField from './TextField.vue' import TextFieldHelperText from './TextFieldHelperText.vue' +import TextFieldCharacterCounter from './TextFieldCharacterCounter' import './styles.scss' import { initPlugin } from '../' @@ -8,6 +9,7 @@ const plugin = { install (vm) { vm.component('m-text-field', TextField) vm.component('m-text-field-helper-text', TextFieldHelperText) + vm.component('m-text-field-character-counter', TextFieldCharacterCounter) } } export default plugin diff --git a/docs/.vuepress/components/TextfieldDemo.vue b/docs/.vuepress/components/TextfieldDemo.vue index 19d6ce005..d18419e50 100644 --- a/docs/.vuepress/components/TextfieldDemo.vue +++ b/docs/.vuepress/components/TextfieldDemo.vue @@ -227,6 +227,63 @@ Helper Text + + Filled with Helper Text and Character Counter +
+ + Label + + + + + Helper Text + + +
+ + Outlined with Helper Text and Character Counter +
+ + Label + + + + + Helper Text + + +