Commit 9eff5a3b by xinla

PhoneDialog组件去除isOther props属性,优化为自动根据slot判断

1 parent 0416232c
......@@ -6,10 +6,6 @@ export default {
type: String,
default: '',
},
isOther: {
type: Boolean,
default: false,
},
imageList: {
type: Array,
default: () => [],
......@@ -25,7 +21,11 @@ export default {
watch: {},
computed: {},
created() {},
mounted() {},
mounted() {
setTimeout(() => {
console.log(this.$slots.default())
}, 1000)
},
methods: {},
}
</script>
......@@ -42,7 +42,7 @@ export default {
</li>
<!-- 自定义消息 -->
<li class="flex msg-li" v-if="isOther">
<li class="flex msg-li" v-if="$slots.default && Array.isArray($slots.default()[0].children)">
<div class="avatar fxnone">
<svg-icon icon="user" />
</div>
......
......@@ -42,10 +42,11 @@
<div class="preview-wrap g-card mt0">
<!-- 预览 -->
<PhoneDialog
:message="form.welcomeMsg || '请输入加群引导语'"
:isOther="groupQrCode && groupQrCode.codeUrl ? true : false">
<el-image style="border-radius: 6px; width: 100px" :src="groupQrCode.codeUrl"></el-image>
<PhoneDialog :message="form.welcomeMsg || '请输入加群引导语'">
<el-image
style="border-radius: 6px; width: 100px"
v-if="groupQrCode?.codeUrl"
:src="groupQrCode.codeUrl"></el-image>
</PhoneDialog>
</div>
......
......@@ -251,13 +251,15 @@ export default {
<div class="preview-wrap g-card sticky-t">
<div class="g-card-title">预览</div>
<PhoneDialog :message="form.welcomeMsg || '请输入加群引导语'">
<div style="line-height: 1.5">
<div class="msg-title">{{ form.linkTitle }}</div>
<div class="msg-content">
<div class="msg-desc">{{ form.linkDesc }}</div>
<el-image class="phone-dialog-image fxnone" :src="form.linkCoverUrl" fit="contain"></el-image>
<template v-if="form.linkTitle">
<div style="line-height: 1.5">
<div class="msg-title">{{ form.linkTitle }}</div>
<div class="msg-content">
<div class="msg-desc">{{ form.linkDesc }}</div>
<el-image class="phone-dialog-image fxnone" :src="form.linkCoverUrl" fit="contain"></el-image>
</div>
</div>
</div>
</template>
</PhoneDialog>
</div>
</div>
......
......@@ -110,10 +110,11 @@
<div class="preview-wrap g-card mt0">
<!-- 预览 -->
<PhoneDialog
:message="form.welcomeMsg || '请输入加群引导语'"
:isOther="groupQrCode && groupQrCode.codeUrl ? true : false">
<el-image style="border-radius: 6px; width: 100px" :src="groupQrCode.codeUrl"></el-image>
<PhoneDialog :message="form.welcomeMsg || '请输入加群引导语'">
<el-image
style="border-radius: 6px; width: 100px"
v-if="groupQrCode?.codeUrl"
:src="groupQrCode?.codeUrl"></el-image>
</PhoneDialog>
</div>
......
......@@ -219,8 +219,8 @@ export default {
<div class="tip mb20">扫码标签样式</div>
<!-- 预览 -->
<PhoneDialog :message="form.welcomeMsg || '请输入欢迎语'" :isOther="!!materialSelected">
<el-image style="border-radius: 6px" :src="materialSelected" fit="fill"></el-image>
<PhoneDialog :message="form.welcomeMsg || '请输入欢迎语'">
<el-image style="border-radius: 6px" v-if="materialSelected" :src="materialSelected" fit="fill"></el-image>
</PhoneDialog>
<div class="tip">欢迎语样式</div>
</div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!