課程
/前端開發
/Vue.js
/vue2.5入門
點擊了提交什么都不顯示
2019-09-26
源自:vue2.5入門 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>
在頁面按F12 查看代碼 有提示錯誤的
F12看錯誤
代碼是很誠實的 肯定是有地方寫的不對的 另外你不上代碼 只發個頁面截圖怎么幫你找你問題呢?
舉報
快速理解Vue編程理念上手Vue2.0開發。
3 回答為什么我的helloword顯示不出來,什么都沒有
1 回答請大家看看,我這個為什么網頁中的item顯示不出來?
5 回答跟著老師寫的為什么運行出來不對 他就把{{msg}}顯示在頁面內
1 回答為什么按老師代碼來輸出的是{{msg}}而不是helloworld
1 回答顯示不出來
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
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
在頁面按F12 查看代碼 有提示錯誤的
2019-12-23
F12看錯誤
2019-09-26
代碼是很誠實的 肯定是有地方寫的不對的 另外你不上代碼 只發個頁面截圖怎么幫你找你問題呢?