mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 05:21:52 +08:00
Merge branch 'pr/6203' into 2.0
This commit is contained in:
4
ionic/components/button/test/dynamic/e2e.ts
Normal file
4
ionic/components/button/test/dynamic/e2e.ts
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
it('should unify buttons', function() {
|
||||
element(by.css('.e2eButtonDynamicUnify')).click();
|
||||
});
|
49
ionic/components/button/test/dynamic/index.ts
Normal file
49
ionic/components/button/test/dynamic/index.ts
Normal file
@ -0,0 +1,49 @@
|
||||
import {App, IonicApp} from 'ionic-angular';
|
||||
|
||||
|
||||
@App({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class E2EApp {
|
||||
isDestructive: boolean;
|
||||
isSecondary: boolean;
|
||||
isCustom: boolean;
|
||||
isOutline: boolean;
|
||||
isClear: boolean;
|
||||
isClicked: boolean;
|
||||
myColor1: string;
|
||||
myColor2: string;
|
||||
multiColor: Array<string>;
|
||||
|
||||
constructor() {
|
||||
this.reset();
|
||||
}
|
||||
|
||||
unify() {
|
||||
this.isDestructive = false;
|
||||
this.isSecondary = false;
|
||||
this.isCustom = false;
|
||||
this.isOutline = false;
|
||||
this.isClear = false;
|
||||
this.isClicked = false;
|
||||
this.myColor1 = 'primary';
|
||||
this.myColor2 = 'primary';
|
||||
this.multiColor = ['primary'];
|
||||
}
|
||||
|
||||
reset() {
|
||||
this.isDestructive = true;
|
||||
this.isSecondary = true;
|
||||
this.isCustom = true;
|
||||
this.isOutline = true;
|
||||
this.isClear = true;
|
||||
this.isClicked = false;
|
||||
this.myColor1 = 'custom1';
|
||||
this.myColor2 = 'custom2';
|
||||
this.multiColor = ['primary','secondary'];
|
||||
}
|
||||
|
||||
toggle() {
|
||||
this.isClicked = !this.isClicked;
|
||||
}
|
||||
}
|
19
ionic/components/button/test/dynamic/main.html
Normal file
19
ionic/components/button/test/dynamic/main.html
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
<ion-toolbar>
|
||||
<ion-title>Default Buttons</ion-title>
|
||||
</ion-toolbar>
|
||||
|
||||
<ion-content padding text-center>
|
||||
<h1>Button Attributes Test</h1>
|
||||
<button block>Primary</button>
|
||||
<button block [color]="isDestructive ? 'danger' : 'primary'" [outline]="isOutline">Danger (Outline)</button>
|
||||
<button block [color]="isSecondary ? 'secondary' : 'primary'" [clear]="isClear">Secondary (Clear)</button>
|
||||
<button block [color]="myColor1" [round]="isCustom">Custom #1</button>
|
||||
<button block [color]="myColor2" [outline]="isOutline" [round]="isCustom">Custom #2 (Outline)</button>
|
||||
<button block primary light [clear]="isClear" [round]="isCustom">Multicolor (Clear)</button>
|
||||
<button block danger dark [outline]="isOutline" [round]="isCustom">Multicolor (Outline)</button>
|
||||
<button block [color]="multiColor" [solid]="!isClicked" [outline]="isClicked" [round]="isCustom" (click)="toggle()">Multicolor (Toggle)</button>
|
||||
<hr/>
|
||||
<button block outline danger (click)="unify()" class="e2eButtonDynamicUnify">Unify all buttons</button>
|
||||
<button block clear danger (click)="reset()">Reset all buttons</button>
|
||||
</ion-content>
|
Reference in New Issue
Block a user