From 96f8adca402f0c96e95868f3e39b6cf458324544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E8=89=B2?= Date: Fri, 23 Nov 2018 22:18:27 +0800 Subject: [PATCH] fix(module:sf:button): fix invalid button size (#294) --- packages/form/spec/form.spec.ts | 12 ++++++++++++ packages/form/src/sf.component.html | 8 ++++++-- packages/form/src/sf.component.ts | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/form/spec/form.spec.ts b/packages/form/spec/form.spec.ts index edec1b00d..8ee4aaf69 100644 --- a/packages/form/spec/form.spec.ts +++ b/packages/form/spec/form.spec.ts @@ -135,6 +135,18 @@ describe('form: component', () => { ); }); }); + describe('#size', () => { + it('with small', () => { + context.button = { render: { size: 'small' } }; + fixture.detectChanges(); + page.checkCount('.ant-btn-sm', 2); + }); + it('with large', () => { + context.button = { render: { size: 'large' } }; + fixture.detectChanges(); + page.checkCount('.ant-btn-lg', 2); + }); + }); }); describe('properites', () => { diff --git a/packages/form/src/sf.component.html b/packages/form/src/sf.component.html index 2d78d8050..1e035261e 100644 --- a/packages/form/src/sf.component.html +++ b/packages/form/src/sf.component.html @@ -10,8 +10,12 @@ [nzLg]="_btn.render.grid.lg" [nzXl]="_btn.render.grid.xl" [nzXXl]="_btn.render.grid.xxl">
- - + +
diff --git a/packages/form/src/sf.component.ts b/packages/form/src/sf.component.ts index e3ce5645b..4c4d7197c 100644 --- a/packages/form/src/sf.component.ts +++ b/packages/form/src/sf.component.ts @@ -328,7 +328,7 @@ export class SFComponent implements OnInit, OnChanges, OnDestroy { private coverButtonProperty() { this._btn = Object.assign( - { render: {} }, + { render: { size: 'default' } }, this.locale, this.options.button, this.button,