problem description
cannot be defined: a dynamic array + multiple local variables
the environmental background of the problems and what methods you have tried
have no choice but to define the global variable 0.0
related codes
Vue.component ("weeklist", {
)props : {
datas : Array
},
data () {
document.cookie="tab=1";
$.ajax({
url : "jsonActionRed",
type : "GET", //GET
async : false, //false,
//timeout : 5000, //
dataType : "json", //:
success : function(data) {
this.items = data.data;
},
error : function(data) {
alert("!!");
}
})
return {
items
}
},
methods : {
timeFormate:function(time) {
var timestamp=new Date().getTime();
return time>timestamp;
},
linkTo : function(url, param) {
this.$router.push({
path : url,
query : {
name : param
}
});
},
toDetails : function(contentVOName) {
this.linkTo("/copyintroduce/" + contentVOName, contentVOName);
},
},
template : `<div class="paihang-box">
<slot v-if="items.length>0">
<ul class="paihang-forefront" v-if="items.length>5">
<!--5-->
<li v-for="(item, index) in items" :key="index" v-if="items.length>5 && index>2&&timeFormate(item.contentList[0].powerLostTime)||item.wincount!==0" @click="toDetails(item.contentVOName)" :data-contenVOName="item.contentVOName">
</li>
<!--5-->
<li v-for="(item, index) in items" :key="index" v-if="items.length<=5" v-bind:class="{"not-border": index==0}" @click="toDetails(item.contentVOName)" :data-contenVOName="item.contentVOName">
</li>
</ul>
</slot>
<div class="notdata" v-if="items.length==0">,~</div>
</div>`
})
what result do you expect?
define a dynamic array,
multiple local variables
Vue.prototype.flags=false;
Vue.prototype.position= {x: 0, y: 0};
Vue.prototype.nx=", ny=", dx=", dy=", xPum=", yPum="";
add this to the data () method and cannot be a global variable