document.addEventListener("click", (e) => {
if (e.target.className != "select") {
if (e.target.className != "select bgfe") {
vm._data.topIndex=false
}
}
});
var vm=null //媒介
export default {
data() {
return {
topIndex: '',
}
},
created: function() { //this指向赋值
vm = this //this指向赋值
},
methods: {
// 顶部导航栏选择事件
selectitem(index, item) {
console.log(this.topIndex)
},
// 底部导航栏点击事件
btmclick(index) {
this.btmindex = index
}
}
}
vue export default外面调用内部数据
最新推荐文章于 2024-04-26 16:47:03 发布