diff --git a/pages/index/index.vue b/pages/index/index.vue index 64e6e4aa..50ea8101 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -2,7 +2,7 @@ - + diff --git a/sheep/components/s-block-item/s-block-item.vue b/sheep/components/s-block-item/s-block-item.vue index ee5b3fc8..1b98456e 100644 --- a/sheep/components/s-block-item/s-block-item.vue +++ b/sheep/components/s-block-item/s-block-item.vue @@ -6,7 +6,7 @@ - + diff --git a/sheep/components/s-block/s-block.vue b/sheep/components/s-block/s-block.vue index 529839cb..19638fca 100644 --- a/sheep/components/s-block/s-block.vue +++ b/sheep/components/s-block/s-block.vue @@ -20,12 +20,12 @@ const elBackground = computed(() => { if (props.styles) { - if (props.styles.background.type == 'color') - return { background: props.styles.background.bgColor }; - if (props.styles.background.type == 'image') + if (props.styles.bgType === 'color') + return { background: props.styles.bgColor }; + if (props.styles.bgType === 'img') return { background: `url(${sheep.$url.cdn( - props.styles.background.bgImage, + props.styles.bgImage, )}) no-repeat top center / 100% auto`, }; } @@ -34,15 +34,18 @@ const elStyles = computed(() => { if (props.styles) { return { - marginTop: `${props.styles.marginTop}px`, - marginBottom: props.styles.marginBottom + 'px', - marginLeft: `${props.styles.marginLeft}px`, - marginRight: props.styles.marginRight + 'px', - 'border-top-left-radius': props.styles.borderRadiusTop + 'px', - 'border-top-right-radius': props.styles.borderRadiusTop + 'px', - 'border-bottom-left-radius': props.styles.borderRadiusBottom + 'px', - 'border-bottom-right-radius': props.styles.borderRadiusBottom + 'px', - padding: props.styles.padding + 'px', + marginTop: `${props.styles.marginTop || 0}px`, + marginBottom: `${props.styles.marginBottom || 0}px`, + marginLeft: `${props.styles.marginLeft || 0}px`, + marginRight: `${props.styles.marginRight || 0}px`, + paddingTop: `${props.styles.paddingTop || 0}px`, + paddingRight: `${props.styles.paddingRight || 0}px`, + paddingBottom: `${props.styles.paddingBottom || 0}px`, + paddingLeft: `${props.styles.paddingLeft || 0}px`, + borderTopLeftRadius: `${props.styles.borderTopLeftRadius || 0}px`, + borderTopRightRadius: `${props.styles.borderTopRightRadius || 0}px`, + borderBottomRightRadius: `${props.styles.borderBottomRightRadius || 0}px`, + borderBottomLeftRadius: `${props.styles.borderBottomLeftRadius || 0}px`, overflow: 'hidden', }; } diff --git a/sheep/components/s-search-block/s-search-block.vue b/sheep/components/s-search-block/s-search-block.vue index 5e3e08fa..1e9c2b51 100644 --- a/sheep/components/s-search-block/s-search-block.vue +++ b/sheep/components/s-search-block/s-search-block.vue @@ -29,24 +29,23 @@ v-model="state.searchVal" /> - + {{ item.text }}{{ item }} - - +