Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否把NoticeBar的option对象拆分成独立的属性? #841

Open
Coder7777 opened this issue May 27, 2022 · 0 comments
Open

能否把NoticeBar的option对象拆分成独立的属性? #841

Coder7777 opened this issue May 27, 2022 · 0 comments

Comments

@Coder7777
Copy link

Coder7777 commented May 27, 2022

Version

6.0.0

Environment

mac os monterey

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-mobile

Steps to reproduce

N/A

What is expected?

NoticeBar的option属性拆分成独立属性。
比如option包含 scrolling, content, fontSize, mode等一大堆属性。
业务场景中,需要动态的修改content的值,此时我需要传整个option给NoticeBar, 而我改的仅仅是其中的一个属性content.
尤其在自定义组件包含NoticeBar组件时,使用起来尤其痛苦。

并且,现有的NoticeBar的option属性,全是必填,没有可空类型,导致复制官网的demo代码,根本无法运行。

   <NoticeBar
      [option]="{ content: '我是小黄条,小黄条的小,小黄条的黄!!!', font: '14px', mode: 'link' }"
      (onClick)="onClick()"
    >   </NoticeBar>

另外官网的demo代码有错误,font属性已经被fontSize属性替代,但是官网的demo代码依然在使用font属性。

What is actually happening?

1,option内的属性独立拆分出来,变成单独的mode, fontSize, content 等基础类型的属性,

   <NoticeBar
      content='我是小黄条,小黄条的小,小黄条的黄!!!'
      fontSize='14px'
      mode='link' 
     [action]='noticeBarTpl'
    >
      <ng-template #noticeBarTpl>
        <Icon type='cross' size="xs"></Icon>
        <Icon type='right' size="xs"></Icon>
      </ng-template>
   </NoticeBar>

2,同步正确的demo code到 https://ng.mobile.ant.design/#/components/notice-bar/en

Other?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant