my switchPhone function uses the arrow function to write that the value of this.isPhoneFooter cannot be obtained, but it can be obtained correctly by
switchPhone () {}
. What is the reason for this?
the code is as follows
export default{
data(){
return {
isPhoneFooter: true,
active: false,
items01: [
{select:""},
{select:""},
{select:""},
{select:""},
{select:""},
{select:""}
],
items02: [
{select:""},
{select:""},
{select:"/"},
{select:"3D"},
{select:""}
],
items03: [
{select:""},
{select:""},
{select:""}
]
}
},
methods: {
switchPc() {
//console.log("");
//let w= document.documentElement.clientWidth || document.body.clientWidth;
//let h= document.documentElement.clientHeight || document.body.clientHeight;
//document.getElementsByTagName("body")[0].style.zoom= "0.1";
this.isPhoneFooter = false;
},
switchPhone:()=>{
//console.log("");
document.getElementsByClassName("phone_home_middle")[0].style.width = "150px";
this.isPhoneFooter = true;
}
}
}