This commit is contained in:
parent
b32c8dd9f0
commit
df775ea594
|
@ -2,9 +2,10 @@
|
|||
import { ref, onMounted, useSlots } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import isMobile from 'src/composables/isMobile';
|
||||
import { useQuasar } from 'quasar';
|
||||
|
||||
const { t } = useI18n();
|
||||
const quasar = useQuasar();
|
||||
const stateStore = useStateStore();
|
||||
const slots = useSlots();
|
||||
const hasContent = ref(false);
|
||||
|
@ -23,7 +24,7 @@ onMounted(() => {
|
|||
childList: true,
|
||||
attributes: true,
|
||||
});
|
||||
if ((!slots['right-panel'] && !hasContent.value) || isMobile)
|
||||
if ((!slots['right-panel'] && !hasContent.value) || quasar.platform.is.mobile)
|
||||
stateStore.rightDrawer = false;
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -52,7 +52,7 @@ onBeforeMount(async () => {
|
|||
});
|
||||
|
||||
onMounted(() => {
|
||||
stateStore.rightMenu = false;
|
||||
stateStore.rightDrawerChangeValue(false);
|
||||
console.log('useStateStore: ', useStateStore.rightMenu);
|
||||
});
|
||||
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 { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
import isMobile from 'src/composables/isMobile';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import FetchedTags from 'components/ui/FetchedTags.vue';
|
||||
|
|
|
@ -15,6 +15,10 @@ export const useStateStore = defineStore('stateStore', () => {
|
|||
rightDrawer.value = !rightDrawer.value;
|
||||
}
|
||||
|
||||
function rightDrawerChangeValue(value) {
|
||||
rightDrawer.value = value;
|
||||
}
|
||||
|
||||
function toggleSubToolbar() {
|
||||
subToolbar.value = !subToolbar.value;
|
||||
}
|
||||
|
@ -50,5 +54,6 @@ export const useStateStore = defineStore('stateStore', () => {
|
|||
isRightDrawerShown,
|
||||
isSubToolbarShown,
|
||||
toggleSubToolbar,
|
||||
rightDrawerChangeValue,
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue