< template >
<div id="testFirst">
<h1>{{ msg }}</h1>
<h1>{{ showDetail() }}</h1>
</div>
< / template >
< script >
/ / import Vue from "vue"
export default {
name:"testFirst",
// }
// var vm=new Vue({
// el:"testFirst",
data () {
return {
msg: "hello i am lishang",
state:"is it 404 not found"
}
},
methods:{
showDetail:function () {
return this.state=this.msg+this.state
}
}
}
< / script >
this is my error part of the code error displayed as You may have an infinite update loop in a component render function
when running, the showDetail function seems to loop an infinite number of times, and when I change it to
showDetail:function () {
return this.state=this.msg+ "is it 404 not found"
}