|
|
@@ -3,6 +3,7 @@
|
|
|
v-for="item in projectMenu"
|
|
|
:key="item.label"
|
|
|
class="flex flex-col justify-center items-center h-full w-60px cursor-pointer mr-10px"
|
|
|
+ @click="handleClick(item)"
|
|
|
>
|
|
|
<img :src="item.img" class="w-35px h-35px" :alt="item.label" />
|
|
|
<div class="text-12px">{{ item.label }}</div>
|
|
|
@@ -10,7 +11,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { reactive } from 'vue'
|
|
|
+import { reactive, inject } from 'vue'
|
|
|
+const onMenuClick = inject<(item: { label: string; img: string }) => void>('onMenuClick', () => {})
|
|
|
const projectMenu = reactive([
|
|
|
{
|
|
|
label: '新建项目',
|
|
|
@@ -49,6 +51,10 @@ const projectMenu = reactive([
|
|
|
img: new URL('@/assets/down.svg', import.meta.url).href
|
|
|
}
|
|
|
])
|
|
|
+
|
|
|
+const handleClick = (item: { label: string; img: string }) => {
|
|
|
+ onMenuClick?.(item)
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped></style>
|