使用vue.js 綁定數(shù)據(jù),加載頁面時(shí)都會(huì)先顯示{{ message }},在顯示數(shù)據(jù).請(qǐng)問有什么好的辦法解決嗎?-------------------------html--------------------------------<span class="titles" v-if="hasload">{{ news_title1 }}</span>--------------------------js-----------------------------new Vue({ el: '#news_banner_a', data: { news_title1: dataArr[0], news_title2: dataArr[1], news_title3: dataArr[2], news_title4: dataArr[3], url1: urlArr[0], url2: urlArr[1], url3: urlArr[2], url4: urlArr[3], imgPath1: imgPathArr[0], imgPath2: imgPathArr[1], imgPath3: imgPathArr[2], imgPath4: imgPathArr[3] }, methods: { hasload: function(dataArr) { // console.log(dataArr[0]); if(dataArr[0].length >= 4) { return true; } else { return false; } } }});
使用vue.js 綁定數(shù)據(jù),加載頁面時(shí)都會(huì)先顯示{{ message }},在顯示數(shù)據(jù)
慕桂英4014372
2018-08-10 16:10:01