mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 14:01:20 +08:00
Added property class feature to IonicComponent
This commit is contained in:
@ -2,7 +2,7 @@ import {NgElement, Decorator} from 'angular2/angular2'
|
||||
import {IonicComponent} from 'ionic2/config/component'
|
||||
|
||||
@Decorator({
|
||||
selector: '.button',
|
||||
selector: 'ion-button, [ion-button],.button',
|
||||
})
|
||||
export class Button {
|
||||
constructor(
|
||||
@ -12,4 +12,6 @@ export class Button {
|
||||
this.config = Button.config.invoke(this)
|
||||
}
|
||||
}
|
||||
new IonicComponent(Button, {})
|
||||
new IonicComponent(Button, {
|
||||
propClasses: ['primary', 'secondary', 'danger', 'light', 'stable', 'dark']
|
||||
})
|
||||
|
@ -47,3 +47,14 @@
|
||||
<button class="button button-dark hover">hover</button>
|
||||
<button class="button button-dark activated">activated</button>
|
||||
</div>
|
||||
|
||||
<h2>With Properties</h2>
|
||||
|
||||
<div>
|
||||
<button ion-button primary>button.primary</button>
|
||||
<button ion-button secondary>button.secondary</button>
|
||||
<button ion-button stable>button.stable</button>
|
||||
<button ion-button light>button.light</button>
|
||||
<button ion-button dark>button.dark</button>
|
||||
<button ion-button danger>button.danger</button>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user