update: mobile navbar
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { reactive } from 'vue';
|
||||
|
||||
const mobileMediaQuery = 'screen and (max-width: 768px)';
|
||||
const matchMedia = window.matchMedia(mobileMediaQuery);
|
||||
|
||||
const isMobile = reactive(matchMedia.matches);
|
||||
|
||||
matchMedia.addEventListener('change', (event) => {
|
||||
isMobile = event.matches;
|
||||
});
|
||||
|
||||
export const install = (app) => {
|
||||
app.config.globalProperties.$isMobile = isMobile;
|
||||
}
|
||||
Reference in New Issue
Block a user