请问为什么我写的代码一样就是显示不出来
点击了提交什么都不显示
点击了提交什么都不显示
2019-09-26
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Todolist</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="root">
<div>
<input v-model="inputValue"></input>
<button @click="handclick">按钮</button>
</div>
<ul>
<!--todo-item
v-for="(item,index) of list"
:key="index"
:content='item'
>
</todo-item-->
<template-list
v-for='(item,index) of list'
:key='index'
:coent='item'
>
</template-list>
</ul>
</div>
<script>
Vue.component('template-list',{
props:['coent'],
template:'<div @click="headldclick">{{coent}}</div>',
methods:{
headldclick:function(){
alert('124')
}
}
})
//Vue.component('todo-item',{
// props:['content'],
// template:'<li>{{content}}</li>'
//})
new Vue({
el:"#root",
data:{
inputValue:"",
list:[]
},
methods:{
handclick: function() {
this.list.push(this.inputValue),
this.inputValue=""
}
}
})
</script>
</body>
</html>
举报