Ng-zorro-antd: 将按钮宽度调整为其父宽度的选项失效

Created on 12 Aug 2019  ·  10Comments  ·  Source: NG-ZORRO/ng-zorro-antd

Reproduction link

https://lzhd.github.io/button-bug/welcome

Steps to reproduce

ng new test
ng add ng-zorro-antd
添加如下代码

<button nz-button nzType="primary" nzBlock>Primary</button>

What is expected?

按钮充满父宽度

What is actually happening?

开发环境下按钮可以充满父宽度,生产环境样式丢失

| Environment | Info |
|---|---|
| ng-zorro-antd | 8.1.2 |
| Browser | chrome 76.0.3809.100 |

Bug Button 🤚 Blocked By @angular

Most helpful comment

All 10 comments

Translation of this issue:

The option to adjust the button width to its parent width is invalid

Reproduction link

https://lzhd.github.io/button-bug/welcome

Steps to reproduce

Ng new test
Ng add ng-zorro-antd
Add the following code

<button nz-button nzType="primary" nzBlock>Primary</button>

What is expected?

Button full of parent width

What is actually happening?

The button in the development environment can be filled with the parent width, and the production environment style is lost.

| Environment | Info |
|---|---|
| ng-zorro-antd | 8.1.2 |
| Browser | chrome 76.0.3809.100 |

重现链接无效,请检查。

我们的官网是有效的 https://ng.ant.design/components/button/zh#components-button-demo-block

Hello @LZHD. Please provide a online reproduction by forking this link https://stackblitz.com/edit/ng-zorro-antd-start or a minimal GitHub repository.
Issues labeled by Need Reproduce will be closed if no activities in 7 days.

你好 @LZHD, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 创建一个 stackblitz 或者提供一个最小化的 GitHub 仓库
被标记为 Need Reproduce 的 issue 7 天内未跟进将会被自动关闭。

@wendzhue
代码: https://github.com/LZHD/button-bug
重现链接: https://lzhd.github.io/button-bug/#/welcome
只是在生产环境下有问题

看上去是 @InputBoolean 方法在 prod 模式下失效了

@LZHD
只在 target 为 es2015 下会有这个问题,可以暂时使用 [nzBlock]="true" 的方式,我们在想办法解决了

好的,万分感谢。

Was this page helpful?
0 / 5 - 0 ratings