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