This commit is contained in:
parent
b32c8dd9f0
commit
df775ea594
|
@ -2,9 +2,10 @@
|
||||||
import { ref, onMounted, useSlots } from 'vue';
|
import { ref, onMounted, useSlots } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import isMobile from 'src/composables/isMobile';
|
import { useQuasar } from 'quasar';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const quasar = useQuasar();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
const hasContent = ref(false);
|
const hasContent = ref(false);
|
||||||
|
@ -23,7 +24,7 @@ onMounted(() => {
|
||||||
childList: true,
|
childList: true,
|
||||||
attributes: true,
|
attributes: true,
|
||||||
});
|
});
|
||||||
if ((!slots['right-panel'] && !hasContent.value) || isMobile)
|
if ((!slots['right-panel'] && !hasContent.value) || quasar.platform.is.mobile)
|
||||||
stateStore.rightDrawer = false;
|
stateStore.rightDrawer = false;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -52,7 +52,7 @@ onBeforeMount(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
stateStore.rightMenu = false;
|
stateStore.rightDrawerChangeValue(false);
|
||||||
console.log('useStateStore: ', useStateStore.rightMenu);
|
console.log('useStateStore: ', useStateStore.rightMenu);
|
||||||
});
|
});
|
||||||
async function fetch() {
|
async function fetch() {
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
const regex = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
|
|
||||||
const isMobile = regex.test(navigator.userAgent);
|
|
||||||
export default isMobile;
|
|
|
@ -2,7 +2,6 @@
|
||||||
import { onMounted, ref, computed, reactive, onUnmounted } from 'vue';
|
import { onMounted, ref, computed, reactive, onUnmounted } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import isMobile from 'src/composables/isMobile';
|
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import FetchedTags from 'components/ui/FetchedTags.vue';
|
import FetchedTags from 'components/ui/FetchedTags.vue';
|
||||||
|
|
|
@ -15,6 +15,10 @@ export const useStateStore = defineStore('stateStore', () => {
|
||||||
rightDrawer.value = !rightDrawer.value;
|
rightDrawer.value = !rightDrawer.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function rightDrawerChangeValue(value) {
|
||||||
|
rightDrawer.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
function toggleSubToolbar() {
|
function toggleSubToolbar() {
|
||||||
subToolbar.value = !subToolbar.value;
|
subToolbar.value = !subToolbar.value;
|
||||||
}
|
}
|
||||||
|
@ -50,5 +54,6 @@ export const useStateStore = defineStore('stateStore', () => {
|
||||||
isRightDrawerShown,
|
isRightDrawerShown,
|
||||||
isSubToolbarShown,
|
isSubToolbarShown,
|
||||||
toggleSubToolbar,
|
toggleSubToolbar,
|
||||||
|
rightDrawerChangeValue,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue