(点击不同的span标签,返回不同的id)
data: function () {
return {
giveUpData: []
}
}
giveUp24(id) {
this.giveUpData.push({ 'id': id, 'time': Date.now() })
let giveUpDatas = JSON.stringify(this.giveUpData)
//转成字符串
let local = giveUpDatas.toString()
localStorage.setItem('giveUpSet', local)
//转成数组
this.giveUpBrowser =eval(localStorage.getItem('giveUpSet'))
}