feat(teleport): teleport components
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
This commit is contained in:
parent
bd0335fa26
commit
6b8819591e
|
@ -1,4 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { onMounted } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import { useSession } from 'src/composables/useSession';
|
import { useSession } from 'src/composables/useSession';
|
||||||
|
@ -11,6 +12,8 @@ const state = useState();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const token = session.getToken();
|
const token = session.getToken();
|
||||||
|
|
||||||
|
onMounted(() => (state.headerMounted.value = true));
|
||||||
|
|
||||||
function onToggleDrawer() {
|
function onToggleDrawer() {
|
||||||
state.drawer.value = !state.drawer.value;
|
state.drawer.value = !state.drawer.value;
|
||||||
}
|
}
|
||||||
|
@ -36,6 +39,8 @@ function onToggleDrawer() {
|
||||||
</router-link>
|
</router-link>
|
||||||
<q-toolbar-title shrink class="text-weight-bold">Salix</q-toolbar-title>
|
<q-toolbar-title shrink class="text-weight-bold">Salix</q-toolbar-title>
|
||||||
<q-space></q-space>
|
<q-space></q-space>
|
||||||
|
<div id="searchbar"></div>
|
||||||
|
<q-space></q-space>
|
||||||
<div class="q-pl-sm q-gutter-sm row items-center no-wrap">
|
<div class="q-pl-sm q-gutter-sm row items-center no-wrap">
|
||||||
<!-- <q-btn v-if="$q.screen.gt.xs" dense flat size="md" icon="add">
|
<!-- <q-btn v-if="$q.screen.gt.xs" dense flat size="md" icon="add">
|
||||||
<q-menu>
|
<q-menu>
|
||||||
|
@ -62,6 +67,7 @@ function onToggleDrawer() {
|
||||||
</div>
|
</div>
|
||||||
</q-menu>
|
</q-menu>
|
||||||
</q-btn> -->
|
</q-btn> -->
|
||||||
|
<div id="header-actions"></div>
|
||||||
<q-btn dense flat no-wrap id="favoriteModules">
|
<q-btn dense flat no-wrap id="favoriteModules">
|
||||||
<q-avatar size="lg">
|
<q-avatar size="lg">
|
||||||
<q-icon name="apps" size="s" />
|
<q-icon name="apps" size="s" />
|
||||||
|
|
|
@ -12,6 +12,7 @@ const user = ref({
|
||||||
|
|
||||||
const roles = ref([]);
|
const roles = ref([]);
|
||||||
const drawer = ref(true);
|
const drawer = ref(true);
|
||||||
|
const headerMounted = ref(false);
|
||||||
|
|
||||||
export function useState() {
|
export function useState() {
|
||||||
function getUser() {
|
function getUser() {
|
||||||
|
@ -67,6 +68,7 @@ export function useState() {
|
||||||
set,
|
set,
|
||||||
get,
|
get,
|
||||||
unset,
|
unset,
|
||||||
drawer
|
drawer,
|
||||||
|
headerMounted
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
import { useSession } from 'src/composables/useSession';
|
import { useSession } from 'src/composables/useSession';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import FormModel from 'src/components/FormModel.vue';
|
import FormModel from 'src/components/FormModel.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const state = useState();
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
const token = session.getToken();
|
const token = session.getToken();
|
||||||
|
|
||||||
|
@ -40,6 +42,7 @@ const filterOptions = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
const headerMounted = computed(() => state.headerMounted.value);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<fetch-data
|
<fetch-data
|
||||||
|
@ -50,7 +53,24 @@ const filterOptions = {
|
||||||
/>
|
/>
|
||||||
<fetch-data url="ContactChannels" @on-fetch="($data) => (contactChannels = $data)" auto-load />
|
<fetch-data url="ContactChannels" @on-fetch="($data) => (contactChannels = $data)" auto-load />
|
||||||
<fetch-data url="BusinessTypes" @on-fetch="($data) => (businessTypes = $data)" auto-load />
|
<fetch-data url="BusinessTypes" @on-fetch="($data) => (businessTypes = $data)" auto-load />
|
||||||
|
<teleport v-if="headerMounted" to="#header-actions">
|
||||||
|
<div class="row q-gutter-x-sm">
|
||||||
|
<q-btn color="primary" dense flat no-wrap>
|
||||||
|
<q-avatar size="lg">
|
||||||
|
<q-icon name="save" size="s" />
|
||||||
|
</q-avatar>
|
||||||
|
<q-tooltip bottom> Save </q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
<q-btn color="primary" dense flat no-wrap>
|
||||||
|
<q-avatar size="lg">
|
||||||
|
<q-icon name="delete" size="s" />
|
||||||
|
</q-avatar>
|
||||||
|
<q-tooltip bottom> Delete </q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
<q-separator vertical />
|
||||||
|
</div>
|
||||||
|
</teleport>
|
||||||
|
<teleport v-if="headerMounted" to="#searchbar"> input </teleport>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<q-card>
|
<q-card>
|
||||||
<form-model :url="`Clients/${route.params.id}`" model="customer">
|
<form-model :url="`Clients/${route.params.id}`" model="customer">
|
||||||
|
|
Loading…
Reference in New Issue