feat(package): 新增一些案例;但是 tailwindcss 仅在子项目生效
This commit is contained in:
8
packages/nanxing-admin/components/layouts/Provider.vue
Normal file
8
packages/nanxing-admin/components/layouts/Provider.vue
Normal file
@@ -0,0 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import Default from './default/Index.vue';
|
||||
console.log('Provider layout loaded');
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Default> <slot /> </Default>
|
||||
</template>
|
||||
33
packages/nanxing-admin/components/layouts/default/Index.vue
Normal file
33
packages/nanxing-admin/components/layouts/default/Index.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<script setup lang="ts">
|
||||
import { useLoadingBar } from 'naive-ui';
|
||||
import { loadingBarRef } from '../../../core/router/guards';
|
||||
import { onMounted } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useLocalConfigStore } from '../../../stores/useLocalConfigStore';
|
||||
|
||||
const { primaryColor } = storeToRefs(useLocalConfigStore());
|
||||
const loadingBar = useLoadingBar();
|
||||
|
||||
onMounted(() => {
|
||||
loadingBarRef.value = loadingBar;
|
||||
});
|
||||
|
||||
function pickerThemeColor() {
|
||||
loadingBarRef.value?.start();
|
||||
setTimeout(() => {
|
||||
loadingBarRef.value?.finish();
|
||||
}, 500);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-layout position="absolute">
|
||||
<n-layout-header bordered class="h-12"> </n-layout-header>
|
||||
<n-layout position="absolute" has-sider class="top-12!">
|
||||
<n-layout-sider bordered />
|
||||
<n-layout-content>
|
||||
<slot />
|
||||
</n-layout-content>
|
||||
</n-layout>
|
||||
</n-layout>
|
||||
</template>
|
||||
6
packages/nanxing-admin/components/layouts/index.ts
Normal file
6
packages/nanxing-admin/components/layouts/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import Provider from './Provider.vue';
|
||||
|
||||
import Default from './default/index.vue';
|
||||
|
||||
export const LayoutProvider = Provider;
|
||||
export const LayoutDefault = Default;
|
||||
Reference in New Issue
Block a user