mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
baby config
This commit is contained in:
@ -13,6 +13,7 @@ import {TabButton} from './tab-button';
|
|||||||
import {Icon} from '../icon/icon';
|
import {Icon} from '../icon/icon';
|
||||||
import {IonicComponent} from '../../config/component';
|
import {IonicComponent} from '../../config/component';
|
||||||
import {ModeComponent} from '../../config/component';
|
import {ModeComponent} from '../../config/component';
|
||||||
|
import {Config} from '../../config/component';
|
||||||
|
|
||||||
|
|
||||||
@ModeComponent({
|
@ModeComponent({
|
||||||
@ -21,6 +22,10 @@ import {ModeComponent} from '../../config/component';
|
|||||||
'tabBarPlacement',
|
'tabBarPlacement',
|
||||||
'tabBarIcons'
|
'tabBarIcons'
|
||||||
],
|
],
|
||||||
|
hostProperties: {
|
||||||
|
'tabBarPlacement': 'attr.tab-bar-placement',
|
||||||
|
'tabBarIcons': 'attr.tab-bar-icons'
|
||||||
|
},
|
||||||
classId: 'tabs'
|
classId: 'tabs'
|
||||||
})
|
})
|
||||||
@View({
|
@View({
|
||||||
@ -51,6 +56,13 @@ export class Tabs extends ViewController {
|
|||||||
) {
|
) {
|
||||||
super(viewCtrl, compiler, elementRef, loader, injector);
|
super(viewCtrl, compiler, elementRef, loader, injector);
|
||||||
this.item = item;
|
this.item = item;
|
||||||
|
Config(this, {
|
||||||
|
'tabBarPlacement': {
|
||||||
|
'default': 'bottom',
|
||||||
|
'android': 'top',
|
||||||
|
'ios': 'bottom'
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
addTab(tabItem) {
|
addTab(tabItem) {
|
||||||
|
@ -10,6 +10,13 @@ let platformMode = Platform.getMode();
|
|||||||
// BackButton.config.bind.icon.value = 'ion-chevron-right'
|
// BackButton.config.bind.icon.value = 'ion-chevron-right'
|
||||||
// BackButton.config._computeDefaultValue(BackButton.config.bind.icon)
|
// BackButton.config._computeDefaultValue(BackButton.config.bind.icon)
|
||||||
|
|
||||||
|
export function Config(instance, config){
|
||||||
|
//todo: user config
|
||||||
|
for (var setting in config) {
|
||||||
|
instance[setting] = config[setting][platformMode];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class ModeComponent extends Component {
|
export class ModeComponent extends Component {
|
||||||
constructor(config) {
|
constructor(config) {
|
||||||
config.hostAttributes = config.hostAttributes || {};
|
config.hostAttributes = config.hostAttributes || {};
|
||||||
|
Reference in New Issue
Block a user