diff --git a/src/mixins/mobile.js b/src/mixins/mobile.js index c44edcff3..1f84c1bfc 100644 --- a/src/mixins/mobile.js +++ b/src/mixins/mobile.js @@ -36,8 +36,14 @@ export default { }, 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; }, },