| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <template>
- <div @click="clickHandle">
- <n-tooltip v-if="collapsed" placement="right" trigger="hover">
- <template #trigger>
- <n-button ghost type="primary" size="small">
- <template #icon>
- <n-icon>
- <DuplicateOutlineIcon v-show="designStore.getDarkTheme" />
- <DuplicateIcon v-show="!designStore.getDarkTheme" />
- </n-icon>
- </template>
- </n-button>
- </template>
- <span>
- 新建
- </span>
- </n-tooltip>
- <n-button v-else ghost type="primary" size="large">
- <template #icon>
- <n-icon>
- <DuplicateOutlineIcon v-show="designStore.getDarkTheme" />
- <DuplicateIcon v-show="!designStore.getDarkTheme" />
- </n-icon>
- </template>
- <span>
- 新建
- </span>
- </n-button>
- </div>
- <CreateModal :show="modalShow" @close="closeHandle" />
- </template>
- <script setup lang="ts">
- import { ref } from 'vue'
- import { computed } from 'node_modules/vue/dist/vue'
- import { useDesignStore } from '@/store/modules/designStore/designStore'
- import { CreateModal } from './components/CreateModal/index'
- import { icon } from '@/plugins'
- const { DuplicateIcon, DuplicateOutlineIcon } = icon.ionicons5
- const designStore = useDesignStore()
- const props = defineProps({
- collapsed: Boolean
- })
- const modalShow = ref<boolean>(false)
- const clickHandle = () => {
- modalShow.value = true
- }
- const closeHandle = () => {
- modalShow.value = false
- }
- </script>
|