File tree Expand file tree Collapse file tree 4 files changed +70
-1
lines changed
src/components/DiyEditor/components Expand file tree Collapse file tree 4 files changed +70
-1
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<el-tabs stretch >
3
- <el-tab-pane label =" 内容" >
3
+ <el-tab-pane label =" 内容" v-if = " $slots.default " >
4
4
<slot ></slot >
5
5
</el-tab-pane >
6
6
<el-tab-pane label =" 样式" lazy >
Original file line number Diff line number Diff line change
1
+ import { ComponentStyle , DiyComponent } from '@/components/DiyEditor/util'
2
+
3
+ /** 用户卡片属性 */
4
+ export interface UserCardProperty {
5
+ // 组件样式
6
+ style : ComponentStyle
7
+ }
8
+
9
+ // 定义组件
10
+ export const component = {
11
+ id : 'UserCard' ,
12
+ name : '用户卡片' ,
13
+ icon : 'mdi:user-card-details' ,
14
+ property : {
15
+ style : {
16
+ bgType : 'color' ,
17
+ bgColor : '' ,
18
+ marginLeft : 8 ,
19
+ marginRight : 8 ,
20
+ marginBottom : 8
21
+ } as ComponentStyle
22
+ }
23
+ } as DiyComponent < UserCardProperty >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" flex flex-col" >
3
+ <div class =" flex items-center justify-between p-x-18px p-y-24px" >
4
+ <div class =" flex flex-1 items-center gap-16px" >
5
+ <el-avatar :size =" 60" >
6
+ <Icon icon =" ep:avatar" :size =" 60" />
7
+ </el-avatar >
8
+ <span class =" text-18px font-bold" >芋道源码</span >
9
+ </div >
10
+ <Icon icon =" tdesign:qrcode" :size =" 20" />
11
+ </div >
12
+ <div
13
+ class =" flex items-center justify-between justify-between bg-white p-x-20px p-y-8px text-12px"
14
+ >
15
+ <span class =" color-#ff690d" >点击绑定手机号</span >
16
+ <span class =" rounded-26px bg-#ff6100 p-x-8px p-y-5px color-white" >去绑定</span >
17
+ </div >
18
+ </div >
19
+ </template >
20
+ <script setup lang="ts">
21
+ import { UserCardProperty } from ' ./config'
22
+
23
+ /** 用户卡片 */
24
+ defineOptions ({ name: ' UserCard' })
25
+ // 定义属性
26
+ defineProps <{ property: UserCardProperty }>()
27
+ </script >
28
+
29
+ <style scoped lang="scss"></style >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <ComponentContainerProperty v-model =" formData.style" />
3
+ </template >
4
+
5
+ <script setup lang="ts">
6
+ import { UserCardProperty } from ' ./config'
7
+ import { usePropertyForm } from ' @/components/DiyEditor/util'
8
+
9
+ // 用户卡片属性面板
10
+ defineOptions ({ name: ' UserCardProperty' })
11
+
12
+ const props = defineProps <{ modelValue: UserCardProperty }>()
13
+ const emit = defineEmits ([' update:modelValue' ])
14
+ const { formData } = usePropertyForm (props .modelValue , emit )
15
+ </script >
16
+
17
+ <style scoped lang="scss"></style >
You can’t perform that action at this time.
0 commit comments