|
|
@@ -127,15 +127,16 @@ export default {
|
|
|
this.changeWorkData(this.work);
|
|
|
},
|
|
|
checkMobile() {
|
|
|
- this.isMobile = window.innerWidth <= 1024;
|
|
|
+ const ua = navigator.userAgent;
|
|
|
+ const isMobileDevice = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|Android/i.test(ua);
|
|
|
+ const isTablet = /iPad|Android(?!.*Mobile)/i.test(ua);
|
|
|
+ this.isMobile = isMobileDevice || isTablet;
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.checkMobile();
|
|
|
- window.addEventListener('resize', this.checkMobile);
|
|
|
},
|
|
|
beforeUnmount() {
|
|
|
- window.removeEventListener('resize', this.checkMobile);
|
|
|
}
|
|
|
};
|
|
|
</script>
|