Skip to content

Commit

Permalink
Textarea: Expose textarea el (airyland#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
airyland committed Oct 1, 2016
1 parent aec706f commit e9a99c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
},
"devDependencies": {
"autoprefixer": "^6.3.7",
"autosize": "^3.0.17",
"babel-core": "^6.9.1",
"babel-loader": "^6.0.0",
"babel-plugin-transform-runtime": "^6.9.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/x-textarea/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
:cols="cols"
v-model="value"
:style="textareaStyle"
:maxlength="max"></textarea>
:maxlength="max" v-el:textarea></textarea>
<div class="weui_textarea_counter" v-show="showCounter && max"><span>{{count}}</span>/{{max}}</div>
</div>
</div>
Expand Down
7 changes: 7 additions & 0 deletions src/demos/Textarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,24 @@
<group title="set height=200">
<x-textarea :max="200" placeholder="请填写详细信息" :show-counter="false" :height="200" :rows="8" :cols="30"></x-textarea>
</group>
<group title="autosize">
<x-textarea placeholder="Type something" :show-counter="false" :rows="1" v-ref:autosize></x-textarea>
</group>
</div>
</template>

<script>
import { XTextarea, Group, XInput } from '../components'
import Autosize from 'autosize'
export default {
components: {
XTextarea,
Group,
XInput
},
ready () {
Autosize(this.$refs.autosize.$els.textarea)
}
}
</script>

0 comments on commit e9a99c6

Please sign in to comment.