<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<title>helloVue</title>
<script type=”text/javascript” src=”vue.js”></script>
</head>
<body>
<div class=”helloVue”>
<ul>
<form @submit.prevent=”submit”>
<input type=”text” name=”name” v-model=”inputtext.name”>
<input type=”password” name=”password” v-model=”inputtext.password”>
<input type=”submit” value=”提交”>
</form>
</ul>
</div>
<script type=”text/javascript”>
var vm = new Vue({
el: ‘.helloVue’,
data(){
return{
inputtext:{}
}
},
methods: {
submit: function() {
console.log(this.inputtext);
}
},
})
</script>
</body>
</html>
转载时请注明出处及相应链接,本文永久地址:https://blog.yayuanzi.com/23944.html


微信打赏

支付宝打赏
感谢您对作者Michael的打赏,我们会更加努力! 如果您想成为作者,请点我