@芥末的糖-----v-model实现原理
2018-12-18 本文已影响0人
芥末的糖
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Vue.js-class-style</title>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
<div id="root">
<input type="text" @input='text = $event.target.value'>
{{text}}
</div>
<script>
Vue.config.productionTip = false
let vm = new Vue({
el: '#root',
data: {
text:'',
}
})
</script>
</body>
</html>