3, v-model two-way binding event

This command will only trigger a two-way data binding (to use an example, a data input current stage, the background is also available)

<div id="app">
    <input type="text" v-model="msg">
    {{msg}}
</div>
<script>
    var vm=new Vue({
        el:'#app',
        data:{
            msg:""
        },
    })
</script>

Data can be obtained from the front desk, the data can be transported from the front desk

You can use keyup listener can listen to the text box you can change the data does not need to click or what triggers

@keyup=‘XXX’

In Vue in has the same level with the data attribute a watch, can be used to trigger an event listener binding, self Continued

Guess you like

Origin blog.csdn.net/weixin_33973600/article/details/91026127