问答详情
源自:3-1 todolist功能开发

运行显示{{item}}

<!DOCTYPE heml>

<html>

<head>

<meta charset="utf-8">

<title>TodoList</title>

<script src="./vue.js"></script>

</head>

<body>

<div id="root">

<div>

<input v-model="inputValue"/>

<button @click="handleSumit">提交</button>

</div>

<ul>

<li v-for="(item,index) of list" :key="index">{{item}}</li>

</ul>

</div>

<script>

new Vue({

el:"#root",

data:{

inputValue:'hello',

list:[]

},

methods:{

handleSubmit:fuction(){

this.list.push(this.inputValue)

}

})

}


</script>

</body>

</html>


提问者:weixin_慕前端7491799 2022-07-05 09:47

个回答

  • 慕神0408174
    2022-07-30 20:20:25

    handleSubmit写成了handleSumit