|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <n-space>
|
|
|
|
|
|
|
+ <n-space class="header-left-btn">
|
|
|
<n-tooltip
|
|
<n-tooltip
|
|
|
v-for="item in btnList"
|
|
v-for="item in btnList"
|
|
|
:key="item.title"
|
|
:key="item.title"
|
|
@@ -7,7 +7,7 @@
|
|
|
trigger="hover"
|
|
trigger="hover"
|
|
|
>
|
|
>
|
|
|
<template #trigger>
|
|
<template #trigger>
|
|
|
- <n-button type="info" size="small" ghost>
|
|
|
|
|
|
|
+ <n-button type="info" size="small" ghost @click="item.fn">
|
|
|
<component :is="item.icon"></component>
|
|
<component :is="item.icon"></component>
|
|
|
</n-button>
|
|
</n-button>
|
|
|
</template>
|
|
</template>
|
|
@@ -20,20 +20,45 @@
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { reactive } from 'vue'
|
|
import { reactive } from 'vue'
|
|
|
-import { icon } from '@/plugins'
|
|
|
|
|
-const { AlbumsIcon, BarChartIcon } = icon.ionicons5
|
|
|
|
|
import { renderIcon } from '@/utils'
|
|
import { renderIcon } from '@/utils'
|
|
|
|
|
+import { icon } from '@/plugins'
|
|
|
|
|
+const { LayersIcon, BarChartIcon, PrismIcon } = icon.ionicons5
|
|
|
|
|
+
|
|
|
|
|
+const layers = () => {
|
|
|
|
|
+ console.log('选择了图层控制')
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const charts = () => {
|
|
|
|
|
+ console.log('选择了图表组件')
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const details = () => {
|
|
|
|
|
+ console.log('选择了详情')
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const btnList = reactive([
|
|
const btnList = reactive([
|
|
|
{
|
|
{
|
|
|
|
|
+ fn: layers,
|
|
|
select: true,
|
|
select: true,
|
|
|
title: '图层控制',
|
|
title: '图层控制',
|
|
|
- icon: renderIcon(AlbumsIcon)
|
|
|
|
|
|
|
+ icon: renderIcon(LayersIcon)
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
|
|
+ fn: charts,
|
|
|
select: true,
|
|
select: true,
|
|
|
title: '图表组件',
|
|
title: '图表组件',
|
|
|
icon: renderIcon(BarChartIcon)
|
|
icon: renderIcon(BarChartIcon)
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ fn: details,
|
|
|
|
|
+ select: true,
|
|
|
|
|
+ title: '详情设置',
|
|
|
|
|
+ icon: renderIcon(PrismIcon)
|
|
|
}
|
|
}
|
|
|
])
|
|
])
|
|
|
</script>
|
|
</script>
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
|
+.header-left-btn {
|
|
|
|
|
+ padding-right: 212px;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|