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

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-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" />

View File

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

View File

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