div中{{msg}}不顯示
<div id="root">{{msg}}</div>
<script>
new Vue({
el:"#root",
template:'<h1>hi world {{msg}}</h1>',
data:{
msg:"hello world"
}
})
<div id="root">{{msg}}</div>
<script>
new Vue({
el:"#root",
template:'<h1>hi world {{msg}}</h1>',
data:{
msg:"hello world"
}
})
2018-05-02
舉報
2018-11-09
{{msg}}和'<h1>hi world {{msg}}</h1>'是兩個不同的模板,一個掛載點只能有一個模板,根據(jù)就近原則顯示的是'<h1>hi world {{msg}}</h1>'
2018-05-28
vue里面的template和div里面的{{msg}}沖突,{{msg}}也是一個模板,template也是一個模板,{{msg}}被覆蓋
2018-05-03
要寫成 。data(){
return{
msg:"hello world"
}
}
上面我寫錯了 return?
2018-05-03
要寫成 。data(){
retrun{
msg:"hello world"
}
}