chore(components): 所有diy组件,添加data-component-name属性

This commit is contained in:
2025-10-30 17:17:15 +08:00
parent 0fabacd71c
commit fc232ad938
49 changed files with 16780 additions and 16770 deletions

View File

@@ -1,56 +1,56 @@
<template>
<view class="rich-text-box" :style="richTextWarpCss">
<rich-text :nodes="html"></rich-text>
</view>
</template>
<script>
// 富文本
import htmlParser from '@/common/js/html-parser';
export default {
name: 'diy-rich-text',
props: {
value: {
type: Object
}
},
data() {
return {
html: ''
};
},
created() {
this.html = htmlParser(this.value.html);
},
watch: {
// 组件刷新监听
componentRefresh: function(nval) {}
},
computed: {
richTextWarpCss: function() {
var obj = '';
obj += 'background-color:' + this.value.componentBgColor + ';';
if (this.value.componentAngle == 'round') {
obj += 'border-top-left-radius:' + this.value.topAroundRadius * 2 + 'rpx;';
obj += 'border-top-right-radius:' + this.value.topAroundRadius * 2 + 'rpx;';
obj += 'border-bottom-left-radius:' + this.value.bottomAroundRadius * 2 + 'rpx;';
obj += 'border-bottom-right-radius:' + this.value.bottomAroundRadius * 2 + 'rpx;';
}
return obj;
}
},
mounted() {},
methods: {}
};
</script>
<style lang="scss">
.rich-text-box {
padding: $padding;
box-sizing: border-box;
height: auto;
line-height: 1.5;
white-space: pre-wrap;
word-break: break-all;
}
</style>
<template>
<view data-component-name="diy-rich-text" class="rich-text-box" :style="richTextWarpCss">
<rich-text :nodes="html"></rich-text>
</view>
</template>
<script>
// 富文本
import htmlParser from '@/common/js/html-parser';
export default {
name: 'diy-rich-text',
props: {
value: {
type: Object
}
},
data() {
return {
html: ''
};
},
created() {
this.html = htmlParser(this.value.html);
},
watch: {
// 组件刷新监听
componentRefresh: function(nval) {}
},
computed: {
richTextWarpCss: function() {
var obj = '';
obj += 'background-color:' + this.value.componentBgColor + ';';
if (this.value.componentAngle == 'round') {
obj += 'border-top-left-radius:' + this.value.topAroundRadius * 2 + 'rpx;';
obj += 'border-top-right-radius:' + this.value.topAroundRadius * 2 + 'rpx;';
obj += 'border-bottom-left-radius:' + this.value.bottomAroundRadius * 2 + 'rpx;';
obj += 'border-bottom-right-radius:' + this.value.bottomAroundRadius * 2 + 'rpx;';
}
return obj;
}
},
mounted() {},
methods: {}
};
</script>
<style lang="scss">
.rich-text-box {
padding: $padding;
box-sizing: border-box;
height: auto;
line-height: 1.5;
white-space: pre-wrap;
word-break: break-all;
}
</style>