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

显示不出来

<!DoCTYPE html>

<html lang='en'>

<head>

<mate charset="UTF-8">

<title>ToDoList</title>

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

</head>

<body>

<div id="root">

<input v-model="inputValue"/>

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

<ul>

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

{{item}}

</li>

</ul>

</div>

<script>

new Vue({

el:"#root",

data:{

inputValue: '',

list: [],

},

methods: {

handleSubmit:function(){

this.list.push(this.inputValue);

this.inputValue = ''

}

}

})

</script>

</body>

</html>

https://img3.mukewang.com/5d0a3fc3000157d702760115.jpg

提问者:兔奶奶次萝波 2019-06-19 21:59

个回答

  • weixin_慕仔1424351
    2019-06-20 11:20:22
    已采纳

    F12,看一下vue.js引用是否正确