chore(components): diy组件部分添加点击事件句柄重新处理
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
<template>
|
||||
<view data-component-name="diy-rich-text" class="rich-text-box" :style="richTextWarpCss">
|
||||
<rich-text :nodes="html"></rich-text>
|
||||
<rich-text :nodes="html" @click="handlerClick" @tap="handlerClick"></rich-text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 富文本
|
||||
import htmlParser from '@/common/js/html-parser';
|
||||
import DiyMinx from './minx.js'
|
||||
export default {
|
||||
name: 'diy-rich-text',
|
||||
props: {
|
||||
@@ -22,6 +23,7 @@ export default {
|
||||
created() {
|
||||
this.html = htmlParser(this.value.html);
|
||||
},
|
||||
mixins: [DiyMinx],
|
||||
watch: {
|
||||
// 组件刷新监听
|
||||
componentRefresh: function(nval) {}
|
||||
@@ -40,7 +42,13 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {}
|
||||
methods: {
|
||||
async handlerClick(item) {
|
||||
await this.__$emitEvent({eventName: 'rich-text-tap', data: item, promiseCallback: (event, handler, awaitedResult) => {
|
||||
if (!awaitedResult) return;
|
||||
}})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user