Skip to content

Commit

Permalink
fix(noticebar): remove blank element of left-icon (#2916)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu authored Feb 4, 2024
1 parent a8c8c7b commit e12cde8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/packages/__VUE/noticebar/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
:style="barStyle"
@click="handleClick"
>
<view class="nut-noticebar__page-lefticon">
<view v-if="leftIcon" class="nut-noticebar__page-lefticon">
<slot name="left-icon">
<Notice v-if="leftIcon" size="16px"></Notice>
<Notice size="16px"></Notice>
</slot>
</view>
<view ref="wrap" :class="`nut-noticebar__page-wrap wrap${id}`">
Expand Down Expand Up @@ -94,8 +94,10 @@ import {
import { Notice, CircleClose } from '@nutui/icons-vue-taro';
import { createComponent, renderIcon } from '@/packages/utils/create';
import { pxCheck } from '@/packages/utils/pxCheck';
const { create } = createComponent('noticebar');
import Taro from '@tarojs/taro';
import { NoticebarDirection } from './types';
const { create } = createComponent('noticebar');
interface stateProps {
wrapWidth: number;
Expand All @@ -116,9 +118,8 @@ interface stateProps {
export default create({
props: {
// 滚动方向 across 横向 vertical 纵向
direction: {
type: String,
type: String as PropType<NoticebarDirection>,
default: 'across'
},
list: {
Expand Down
8 changes: 4 additions & 4 deletions src/packages/__VUE/noticebar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
:style="barStyle"
@click="handleClick"
>
<view class="nut-noticebar__page-lefticon">
<view v-if="leftIcon" class="nut-noticebar__page-lefticon">
<slot name="left-icon">
<Notice v-if="leftIcon" size="16px"></Notice>
<Notice size="16px"></Notice>
</slot>
</view>
<view ref="wrap" class="nut-noticebar__page-wrap">
Expand Down Expand Up @@ -95,6 +95,7 @@ import { createComponent } from '@/packages/utils/create';
const { create } = createComponent('noticebar');
import { pxCheck } from '@/packages/utils/pxCheck';
import { PropType } from 'vue';
import { NoticebarDirection } from './types';
interface StateProps {
wrapWidth: number;
Expand All @@ -114,9 +115,8 @@ interface StateProps {
}
export default create({
props: {
// 滚动方向 across 横向 vertical 纵向
direction: {
type: String,
type: String as PropType<NoticebarDirection>,
default: 'across'
},
list: {
Expand Down
1 change: 1 addition & 0 deletions src/packages/__VUE/noticebar/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type NoticebarDirection = 'across' | 'vertical';

0 comments on commit e12cde8

Please sign in to comment.