vue input 监听
使用 v-on:input="change" 实现即可
App.vue
- <template>
- <div>
- <md-field>
- <label>
- Initial Value
- </label>
- <md-input v-model="initial" v-on:input="change">
- </md-input>
- </md-field>
- </div>
- </template>
- <script>
- export
- default {
- name:
- "TextFields",
- data: () = >({
- initial: "Initial Value"
- }),
- methods: {
- change() {
- console.log(this.initial)
- }
- }
- };
- </script>
来源: http://www.bubuko.com/infodetail-3098027.html