mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
yup
This commit is contained in:
@@ -1,11 +1,48 @@
|
||||
import * as Platform from '../platform';
|
||||
import * as util from '../util';
|
||||
|
||||
export class Ion {
|
||||
export class Ion {}
|
||||
|
||||
extend(...args) {
|
||||
args.unshift(this);
|
||||
return util.extend.apply(null, args);
|
||||
}
|
||||
// export class IonElement extends Ion {
|
||||
// constructor() {
|
||||
|
||||
}
|
||||
// this.children = [];
|
||||
// }
|
||||
|
||||
// addChild(child) {
|
||||
|
||||
// }
|
||||
// removeChild(child) {
|
||||
// }
|
||||
// insertChild(index, child) {
|
||||
// }
|
||||
|
||||
// behaviors: Array<Behavior>;
|
||||
// events: Array<String>;
|
||||
// }
|
||||
|
||||
// class Behavior {
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// class IonButton extends IonElement {
|
||||
// text: String;
|
||||
// type: String;
|
||||
// }
|
||||
|
||||
// class TabBar extends IonElement {
|
||||
// tabbuttons: Array<IonTabButton>
|
||||
|
||||
// onClickTab() {
|
||||
// let clickedTab = ev.target;
|
||||
|
||||
// }
|
||||
// }
|
||||
// class IonTabButton extends IonButton {
|
||||
|
||||
// }
|
||||
|
||||
@@ -2,7 +2,10 @@ import {NgElement, Component, Template} from 'angular2/angular2';
|
||||
import {Ion} from '../ion';
|
||||
|
||||
@Component({
|
||||
selector: 'ion-switch'
|
||||
selector: 'ion-switch',
|
||||
bind: {
|
||||
checked: 'checked'
|
||||
}
|
||||
})
|
||||
@Template({
|
||||
inline: `
|
||||
@@ -17,13 +20,53 @@ import {Ion} from '../ion';
|
||||
</div>
|
||||
`
|
||||
})
|
||||
export class Switch extends Ion {
|
||||
constructor(@NgElement() el : NgElement) {
|
||||
this.element = el
|
||||
console.log('element', el)
|
||||
export class Switch extends IonElement {
|
||||
constructor(
|
||||
@NgElement() el : NgElement,
|
||||
@EventEmitter('change') emitChange: Function
|
||||
) {
|
||||
this.ngElement = el;
|
||||
this.emitChange = emitChange;
|
||||
}
|
||||
onClick(el) {
|
||||
//el.checked = !el.checked;
|
||||
console.log(el.checked);
|
||||
onClick() {
|
||||
this.emitChange(this.checked);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
<ion-view>
|
||||
|
||||
<aside/>
|
||||
|
||||
<tabs>
|
||||
<my-page-3 title="My Page 3" />
|
||||
<tab>
|
||||
static content
|
||||
</tab>
|
||||
</tabs>
|
||||
|
||||
</ion-view>
|
||||
|
||||
@Component({
|
||||
selector: 'my-page-3',
|
||||
defaults: {
|
||||
title: 'My Page 3',
|
||||
icon: 'Super icon'
|
||||
},
|
||||
})
|
||||
@Template( {
|
||||
url: 'my-page-3.html'
|
||||
})
|
||||
@Route({
|
||||
name: 'my-page-3'
|
||||
})
|
||||
class MyPage3 extends TabComponent {
|
||||
|
||||
}
|
||||
|
||||
|
||||
1) Sign in page, 1 view
|
||||
2) Navigate to a tabs view, 3 tabs, all have the same side menu
|
||||
3) Tab 2, page 2 navigates to nested tabs with it's own side menu
|
||||
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user