Skip to content

Commit af67db5

Browse files
committed
营销:适配商城装修组件【用户卡片】
1 parent d5f9d31 commit af67db5

File tree

4 files changed

+70
-1
lines changed

4 files changed

+70
-1
lines changed

src/components/DiyEditor/components/ComponentContainerProperty.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<el-tabs stretch>
3-
<el-tab-pane label="内容">
3+
<el-tab-pane label="内容" v-if="$slots.default">
44
<slot></slot>
55
</el-tab-pane>
66
<el-tab-pane label="样式" lazy>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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>

0 commit comments

Comments
 (0)