From f1b6d1d3d188003e09432070abde4e2bbf1564a7 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Thu, 7 Dec 2017 12:31:12 +0800 Subject: [PATCH] add input demo --- components/input/Input.vue | 37 ++++-- components/input/Search.vue | 31 ++--- components/input/TextArea.vue | 133 ++++++++++++++++++++ components/input/calculateNodeHeight.js | 2 +- components/input/demo/autosize-textarea.vue | 16 +++ components/input/demo/basic.vue | 17 +-- components/input/demo/search-input.vue | 21 ++++ components/input/demo/size.vue | 23 ++++ components/input/demo/textarea.vue | 12 ++ components/input/index.js | 4 +- components/input/inputProps.js | 1 - 11 files changed, 246 insertions(+), 51 deletions(-) create mode 100644 components/input/demo/autosize-textarea.vue create mode 100644 components/input/demo/search-input.vue create mode 100644 components/input/demo/size.vue create mode 100644 components/input/demo/textarea.vue diff --git a/components/input/Input.vue b/components/input/Input.vue index 58be7e2e6..754be7b01 100644 --- a/components/input/Input.vue +++ b/components/input/Input.vue @@ -1,6 +1,6 @@ diff --git a/components/input/calculateNodeHeight.js b/components/input/calculateNodeHeight.js index 8f568a19e..c1dcf48ab 100644 --- a/components/input/calculateNodeHeight.js +++ b/components/input/calculateNodeHeight.js @@ -153,5 +153,5 @@ export default function calculateNodeHeight ( if (!maxRows) { overflowY = 'hidden' } - return { height, minHeight, maxHeight, overflowY } + return { height: `${height}px`, minHeight: `${minHeight}px`, maxHeight: `${maxHeight}px`, overflowY } } diff --git a/components/input/demo/autosize-textarea.vue b/components/input/demo/autosize-textarea.vue new file mode 100644 index 000000000..abf12a0bc --- /dev/null +++ b/components/input/demo/autosize-textarea.vue @@ -0,0 +1,16 @@ + + diff --git a/components/input/demo/basic.vue b/components/input/demo/basic.vue index 5bc97363a..a8ef283bd 100644 --- a/components/input/demo/basic.vue +++ b/components/input/demo/basic.vue @@ -1,25 +1,10 @@ diff --git a/components/input/demo/size.vue b/components/input/demo/size.vue new file mode 100644 index 000000000..43ad60cb7 --- /dev/null +++ b/components/input/demo/size.vue @@ -0,0 +1,23 @@ + + + diff --git a/components/input/demo/textarea.vue b/components/input/demo/textarea.vue new file mode 100644 index 000000000..4d74a8f4a --- /dev/null +++ b/components/input/demo/textarea.vue @@ -0,0 +1,12 @@ + + diff --git a/components/input/index.js b/components/input/index.js index 5e39b58b5..91732a3d0 100644 --- a/components/input/index.js +++ b/components/input/index.js @@ -1,9 +1,9 @@ import Input from './Input' import Group from './Group' import Search from './Search' -// import TextArea from './TextArea' +import TextArea from './TextArea' Input.Group = Group Input.Search = Search -// Input.TextArea = TextArea +Input.TextArea = TextArea export default Input diff --git a/components/input/inputProps.js b/components/input/inputProps.js index 9d629cfb8..c35279cd3 100644 --- a/components/input/inputProps.js +++ b/components/input/inputProps.js @@ -17,7 +17,6 @@ export default { return ['small', 'large', 'default'].includes(value) }, }, - maxLength: String, disabled: { default: false, type: Boolean,