添加页面组件、添加页面组件接口、添加pinia

This commit is contained in:
lhj
2024-10-02 17:05:46 +08:00
parent 079d58048a
commit 0299f6a55b
17 changed files with 199 additions and 1454 deletions

View File

@ -1,29 +1,18 @@
<!-- DynamicSlotsComponent.vue -->
<template>
<div>
<!-- 动态插槽 -->
<div>
<slot name="header"></slot>
</div>
<div>
<slot name="main"></slot>
</div>
<div>
<slot name="footer"></slot>
</div>
</div>
</template>
<script setup>
import { defineProps } from 'vue';
import { useCounterStore } from '@/stores/useSchemeStore'
// 可以在组件中的任意位置访问 `store` 变量 ✨
const store = useCounterStore()
function add() {
store.increment()
}
function sub() {
store.decrement()
}
</script>
// 接收一个动态插槽名作为 prop
const props = defineProps({
dynamicSlotName: String
});
</script>
<template>
<div>{{ store.count }}</div>
<a-button @click=add>add</a-button>
<a-button @click=sub>sub</a-button>
</template>