created () {
// 当前页面允许双指缩放
document
.querySelector('meta[name="viewport"]')
.setAttribute('content', 'width=device-width, initial-scale=1')
},
beforeRouteLeave (to, from, next) {
// 离开页面取消双指缩放
document
.querySelector('meta[name="viewport"]')
.setAttribute(
'content',
'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'
)
next()
},