I need to determine when clicking on this link routing Jump is a mobile terminal or the pc
<router-link @click.native="isMobile" to="/resume" tag="h2">简历</router-link>
methods: {
isMobile() {
console.log("1234321");
this.flag = navigator.userAgent.match(
/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
);
console.log(this.flag);
}
}
Click the button to display the pc side:
Click the button to display the mobile terminal: