营销:适配商城装修组件【分割线】

pull/20/head
owen 2023-12-02 00:51:58 +08:00
parent ff6788b685
commit 51a0d8792e
3 changed files with 40 additions and 20 deletions

View File

@ -21,8 +21,8 @@
<s-image-cube v-if="type === 'MagicCube'" :data="data" :styles="styles" /> <s-image-cube v-if="type === 'MagicCube'" :data="data" :styles="styles" />
<!-- 图文组件视频播放 --> <!-- 图文组件视频播放 -->
<s-video-block v-if="type === 'VideoPlayer'" :data="data" :styles="styles" /> <s-video-block v-if="type === 'VideoPlayer'" :data="data" :styles="styles" />
<!-- 基础组件辅助线 --> <!-- 基础组件分割线 -->
<s-line-block v-if="type === 'lineBlock'" :data="data" /> <s-line-block v-if="type === 'Divider'" :data="data" />
<!-- 图文组件热区 --> <!-- 图文组件热区 -->
<s-hotzone-block v-if="type === 'hotzone'" :data="data" :styles="styles" /> <s-hotzone-block v-if="type === 'hotzone'" :data="data" :styles="styles" />

View File

@ -1,12 +1,12 @@
<template> <template>
<su-subline :color="data.lineColor" :lineStyle="data.style"></su-subline> <su-subline v-bind="data"></su-subline>
</template> </template>
<script setup> <script setup>
const props = defineProps({ const props = defineProps({
data: { data: {
type: Object, type: Object,
default() {}, default: {},
}, },
}); });
</script> </script>

View File

@ -1,42 +1,62 @@
<template> <template>
<view class="ui-subline-wrap" :style="[elStyle]"></view> <view class="wrap" :style="{height: `${height}px`}">
<view class="divider" :style="[elStyle]"></view>
</view>
</template> </template>
<script setup> <script setup>
/** /**
* 辅助线 * 分割线
*
* @property {String} width = ['thin', 'medium', 'thick', '10px'] - 线条宽度
* @property {String} color = #000 - 线条颜色
* @property {String} style = ['dotted', 'solid', 'double', 'dashed'] - 线条样式,圆点实线双线虚线
*
*/ */
import { computed } from 'vue'; import { computed } from 'vue';
// //
const props = defineProps({ const props = defineProps({
color: { // 线
lineColor: {
type: String, type: String,
default: '#000', default: '#000',
}, },
lineStyle: { // 线'dotted', 'solid', 'double', 'dashed'
borderType: {
type: String, type: String,
default: 'dashed', default: 'dashed',
}, },
width: { // 线
type: String, lineWidth: {
default: 'thin', type: Number,
default: 1,
}, },
//
height: {
type: [Number, String],
default: 'auto'
},
// none - horizontal -
paddingType: {
type: String,
default: 'none'
}
}); });
const elStyle = computed(() => { const elStyle = computed(() => {
return { return {
'border-top-width': props.width, 'border-top-width': `${props.lineWidth}px`,
'border-top-color': props.color, 'border-top-color': props.lineColor,
'border-top-style': props.lineStyle, 'border-top-style': props.borderType,
margin: props.paddingType === 'none' ? '0' : '0px 16px'
}; };
}); });
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
.wrap {
display: flex;
align-items: center;
.divider {
width: 100%;
}
}
</style>