1818 <template #icon >
1919 <IconReturn class="cursor-pointer" />
2020 </template >
21- </el-button >
21+ </el-button >
2222 </TextTip >
2323 <span class =" w-1" ></span >
2424 <TextTip content="恢复">
2525 <el-button :color =" primaryColor" title =" 恢复" >
2626 <template #icon >
2727 <IconNext class="cursor-pointer" />
2828 </template >
29- </el-button >
29+ </el-button >
3030 </TextTip >
3131 <span class =" w-1" ></span >
32- <TextTip content="导出 ">
33- <el-button :color =" primaryColor" title =" 导出 " >
32+ <TextTip content="导入JSON ">
33+ <el-button :color =" primaryColor" title =" 导入 " >
3434 <template #icon >
35- <IconExport class="cursor-pointer" />
35+ <IconImport class="cursor-pointer" />
3636 </template >
37- </el-button >
37+ </el-button >
3838 </TextTip >
3939 <span class =" w-1" ></span >
40+ <el-dropdown trigger =" hover" @command =" handleCommand" >
41+ <el-button :color =" primaryColor" >
42+ <template #icon >
43+ <IconExport class="cursor-pointer" />
44+ </template >
45+ </el-button >
46+ <template #dropdown >
47+ <el-dropdown-menu >
48+ <el-dropdown-item command =" code" >导出代码</el-dropdown-item >
49+ <el-dropdown-item command =" json" >导出JSON</el-dropdown-item >
50+ </el-dropdown-menu >
51+ </template >
52+ </el-dropdown >
53+ <span class =" w-1" ></span >
4054 <TextTip content="H5预览">
41- <el-button :color =" primaryColor" :icon =" View" style =" color : #fff ;" title =" 预览" @click =" clickH5Preview" />
55+ <el-button :color =" primaryColor" :icon =" View" style =" color : #fff ;" title =" 预览" @click =" clickH5Preview" />
4256 </TextTip >
4357 <span class =" w-1" ></span >
44- <el-popconfirm width =" 220" confirm-button-text =" 确定" cancel-button-text =" 取消" title =" 清空的操作不可恢复,确认清空当前编辑页面?" @confirm =" clearPageElement" >
58+ <el-popconfirm width =" 220" confirm-button-text =" 确定" cancel-button-text =" 取消" title =" 清空的操作不可恢复,确认清空当前编辑页面?"
59+ @confirm =" clearPageElement" >
4560 <template #reference >
4661 <TextTip content="清空页面元素">
4762 <el-button type =" danger" :icon =" Delete" title =" 清空页面元素" />
5065 </el-popconfirm >
5166 </div >
5267 </div >
53- <H5Preview v-model :visible =" isShowH5Preview " />
68+ <H5Preview v-model :visible =" isShowH5Preview " />
5469</template >
5570
56- <script lang="ts " setup>
71+ <script lang="tsx " setup>
5772import { onMounted , onUnmounted , ref } from ' vue' ;
5873import { Delete , View } from ' @element-plus/icons-vue' ;
59- import IconReturn from ' ../icons/IconReturn.vue' ;
60- import IconNext from ' ../icons/IconNext.vue' ;
6174import H5Preview from ' @/components/preview/h5Preview.vue'
6275import { getCssVariable , setTheme , watchThemeChange } from ' @/utils/theme' ;
6376import IconExport from ' ../icons/IconExport.vue' ;
6477import { useGlobalProperties } from ' @/hooks/useGlobalProperties' ;
6578import { localKey , useVisualData } from ' @/hooks/useVisualData' ;
6679import { useLayoutTypeStore } from ' @/stores/layoutType' ;
6780import { LayoutTypeEnum } from ' @/enums' ;
81+ import { useModal } from ' @/hooks/useModal' ;
6882
6983defineOptions ({
7084 name: ' HeaderButtonArea' ,
7185})
7286
7387const compLayoutType = ref (LayoutTypeEnum .Single )
74- const { updatePageBlock,jsonData } = useVisualData ()
88+ const { updatePageBlock, jsonData } = useVisualData ()
7589const primaryColor = ref (getCssVariable (' --primary-color' ))
7690const { globalProperties } = useGlobalProperties ()
7791// const router = useRouter();
@@ -98,11 +112,27 @@ const clickH5Preview = () => {
98112};
99113
100114const layoutTypeStore = useLayoutTypeStore ()
101- const changeCompLayoutType = (value )=> {
102- console .log (' 没有触发吗' ,value )
115+ const changeCompLayoutType = (value ) => {
103116 layoutTypeStore .changeLayoutType (value )
104117}
105118
119+ const handleCommand = (command : string ) => {
120+ let title = command === ' code' ? ' 导出代码' : ' 导出JSON' ;
121+
122+ useModal ({
123+ title: title ,
124+ props: {
125+ width: 750 ,
126+ },
127+ footer: null ,
128+ content : () => (
129+ <div class = { ' flex justify-center' } >
130+
131+ </div >
132+ ),
133+ });
134+ }
135+
106136// 初始化主题
107137onMounted (() => {
108138 // 启动监听
@@ -118,6 +148,12 @@ const screenType = ref('mobile')
118148
119149<style lang="scss" scoped>
120150:deep(.el-button ) {
121- padding : 5px ;
151+ padding : 10px ;
152+ font-size : 16px ;
153+ }
154+ :deep(.el-button :focus-visible ) {
155+ outline : none ;
156+ // outline-offset: 1px;
157+ // transition: outline-offset 0s,outline 0s;
122158}
123159 </style >
0 commit comments