vue 怎么清空依赖_vuejs如何在把对象所有属性清空?
刪除該輪播圖
加入該新輪播圖
var homepageConfig = [
{
type: 1,
itemList: [
{
imageUrl: "https://static.segmentfault.com/v-59311a93/global/img/logo-b.svg?v001",
url: "1.html"
},
{
imageUrl: "https://static.segmentfault.com/v-59311a93/global/img/logo-b.svg?v002",
url: "2.html"
}
],
tempItem: {
imageUrl: '',
url: ''
}
}
];
var homepageConfigApp = new Vue({
el: "#homepageConfigApp",
data: {
homepageConfig: homepageConfig
},
methods: {
deleteItemInList: function (list, item) {
if (confirm("確定刪除?")) {
list.$remove(item);
}
},
pushItemToList: function (list, item) {
list.push(item);
item = null;//
}
}
})
我要做個(gè)創(chuàng)建輪播圖的app,在我把新數(shù)據(jù)放入list后我好像不能把這個(gè)臨時(shí)數(shù)據(jù)清空,我應(yīng)該怎么做好,還是這種方式不對(duì)?
總結(jié)
以上是生活随笔為你收集整理的vue 怎么清空依赖_vuejs如何在把对象所有属性清空?的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。