Commit 9eff5a3b by xinla

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

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