no message
This commit is contained in:
parent
33d61bf700
commit
3e100c108a
@ -10,6 +10,7 @@ const app = createApp(App)
|
|||||||
|
|
||||||
// 使用插件
|
// 使用插件
|
||||||
app.use(createPinia())
|
app.use(createPinia())
|
||||||
|
|
||||||
app.use(router)
|
app.use(router)
|
||||||
|
|
||||||
// 挂载应用
|
// 挂载应用
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="h-screen bg-gradient-to-br from-gray-50 to-gray-100 p-6">
|
<div class="h-screen p-6 bg-gradient-to-br from-gray-50 to-gray-100">
|
||||||
<MindMap />
|
<MindMap />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -8,6 +8,7 @@
|
|||||||
import { onMounted } from "vue";
|
import { onMounted } from "vue";
|
||||||
import { MindMap } from "@mind-map/component";
|
import { MindMap } from "@mind-map/component";
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log("Home view mounted");
|
console.log("Home view mounted");
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
<!-- 布局 -->
|
<!-- 布局 -->
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
{{ currentLayout }}
|
|
||||||
<select
|
<select
|
||||||
v-model="currentLayout"
|
v-model="currentLayout"
|
||||||
@change="
|
@change="
|
||||||
@ -26,14 +25,20 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { onMounted } from "vue";
|
||||||
import type { LayoutType } from "../../store/helpers/layoutGroupList";
|
import type { LayoutType } from "../../store/helpers/layoutGroupList";
|
||||||
|
|
||||||
import { layoutGroupList } from "../../store/helpers/layoutGroupList";
|
import { layoutGroupList } from "../../store/helpers/layoutGroupList";
|
||||||
import { useMindMapStore } from "../../store/index";
|
import { useMindMapStore } from "../../index";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
|
|
||||||
const { useLayout, currentLayout } = useMindMapStore();
|
const { useLayout } = useMindMapStore();
|
||||||
// const { currentLayout } = storeToRefs(useMindMapStore());
|
const { currentLayout } = storeToRefs(useMindMapStore());
|
||||||
|
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
// console.log("currentLayout", pinia.state.value);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|||||||
@ -6,11 +6,9 @@ import pinia from './store';
|
|||||||
export { MindMap };
|
export { MindMap };
|
||||||
export * from './store';
|
export * from './store';
|
||||||
|
|
||||||
export default {
|
|
||||||
install: (app: App) => {
|
export function installMindMap(app: App) {
|
||||||
// 安装 Pinia 状态管理
|
app.use(pinia);
|
||||||
app.use(pinia);
|
}
|
||||||
// 注册组件
|
|
||||||
app.component('MindMap', MindMap);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|||||||
@ -1,14 +1,10 @@
|
|||||||
import { createPinia } from 'pinia';
|
import { createPinia } from 'pinia';
|
||||||
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
|
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
|
||||||
|
|
||||||
// 创建 pinia 实例
|
|
||||||
const pinia = createPinia();
|
const pinia = createPinia();
|
||||||
|
|
||||||
// 使用持久化插件
|
|
||||||
pinia.use(piniaPluginPersistedstate);
|
pinia.use(piniaPluginPersistedstate);
|
||||||
|
|
||||||
// 导出 pinia 实例
|
|
||||||
export default pinia;
|
export default pinia;
|
||||||
|
|
||||||
// 导出所有 store 模块
|
|
||||||
export * from './modules/mindMap';
|
export * from './modules/mindMap';
|
||||||
Loading…
x
Reference in New Issue
Block a user