mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 23:04:04 +00:00
Feat: Add optional width parameter to isMobile() method
This commit is contained in:
parent
cf2d603e27
commit
45c03c2b40
1 changed files with 8 additions and 2 deletions
|
@ -36,8 +36,14 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
isMobile() {
|
/**
|
||||||
return this.windowWidth <= 767.98;
|
* @param {number? | undefined} width Width of the device
|
||||||
|
* @returns {boolean} Whether the device is mobile
|
||||||
|
*/
|
||||||
|
isMobile(width) {
|
||||||
|
return (width && typeof width === "number"
|
||||||
|
? width ?? this.windowWidth
|
||||||
|
: this.windowWidth) <= 767.98;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue