課程
/前端開(kāi)發(fā)
/Vue.js
/vue2.5入門(mén)
點(diǎn)擊了提交什么都不顯示
2019-09-26
源自:vue2.5入門(mén) 3-3
正在回答
<!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>
<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>
在頁(yè)面按F12 查看代碼 有提示錯(cuò)誤的
F12看錯(cuò)誤
代碼是很誠(chéng)實(shí)的 肯定是有地方寫(xiě)的不對(duì)的 另外你不上代碼 只發(fā)個(gè)頁(yè)面截圖怎么幫你找你問(wèn)題呢?
舉報(bào)
快速理解Vue編程理念上手Vue2.0開(kāi)發(fā)。
3 回答為什么我的helloword顯示不出來(lái),什么都沒(méi)有
1 回答請(qǐng)大家看看,我這個(gè)為什么網(wǎng)頁(yè)中的item顯示不出來(lái)?
5 回答跟著老師寫(xiě)的為什么運(yùn)行出來(lái)不對(duì) 他就把{{msg}}顯示在頁(yè)面內(nèi)
1 回答顯示不出來(lái)
1 回答為什么按老師代碼來(lái)輸出的是{{msg}}而不是helloworld
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2020-06-11
<!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>
2020-02-29
在頁(yè)面按F12 查看代碼 有提示錯(cuò)誤的
2019-12-23
F12看錯(cuò)誤
2019-09-26
代碼是很誠(chéng)實(shí)的 肯定是有地方寫(xiě)的不對(duì)的 另外你不上代碼 只發(fā)個(gè)頁(yè)面截圖怎么幫你找你問(wèn)題呢?