|
|
@@ -110,11 +110,28 @@ export default {
|
|
|
fadein: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 是否使用 customContent 插槽
|
|
|
+ * 小程序端勿用 $slots 判断(会触发 then 未定义告警),由页面显式传入
|
|
|
+ */
|
|
|
+ useCustomContent: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
|
+ /** 优先用 prop;H5 可兜底读 slot(避免仅依赖 $slots 在 MP 上报错) */
|
|
|
isCustomContent(){
|
|
|
- return !!this.$slots.customContent
|
|
|
+ if (this.useCustomContent) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ // #ifdef H5
|
|
|
+ return !!(this.$slots && this.$slots.customContent)
|
|
|
+ // #endif
|
|
|
+ // #ifndef H5
|
|
|
+ return false
|
|
|
+ // #endif
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
@@ -122,9 +139,6 @@ export default {
|
|
|
|
|
|
}
|
|
|
},
|
|
|
- mounted(){
|
|
|
- console.log(this)
|
|
|
- },
|
|
|
methods: {
|
|
|
handleClick(e) {
|
|
|
if (!this.show) return
|