fix(vue): update imports for types and ionicons

Closes #18701
This commit is contained in:
Simon Wicki
2019-07-02 21:57:47 +02:00
committed by Mike Hartington
parent f16b118794
commit f56fea6a1f
6 changed files with 40 additions and 7 deletions

View File

@ -57,9 +57,13 @@
"vue-property-decorator": "^7.2.0", "vue-property-decorator": "^7.2.0",
"vue": "^2.5.17", "vue": "^2.5.17",
"vue-template-compiler": "^2.5.17", "vue-template-compiler": "^2.5.17",
"vue-router": "^3.0.1" "vue-router": "^3.0.1",
"ionicons": "^4.6.0"
}, },
"dependencies": { "dependencies": {
"@ionic/core": "^4.0.0" "@ionic/core": "^4.6.0"
},
"peerDependencies": {
"ionicons": "^4.5.10-2"
} }
} }

View File

@ -1,3 +1,5 @@
import { HTMLStencilElement } from '@ionic/core';
// A proxy method that initializes the controller and calls requested method // A proxy method that initializes the controller and calls requested method
export function proxyMethod(tag: string, method: string, ...opts: any[]): Promise<any> { export function proxyMethod(tag: string, method: string, ...opts: any[]): Promise<any> {
return initController(tag).then((ctrl: any) => ctrl[method].apply(ctrl, opts)); return initController(tag).then((ctrl: any) => ctrl[method].apply(ctrl, opts));

View File

@ -4,7 +4,7 @@ import { IonicConfig } from '@ionic/core';
// Webpack import for ionicons // Webpack import for ionicons
import { addIcons } from 'ionicons'; import { addIcons } from 'ionicons';
import { ICON_PATHS } from 'ionicons/icons'; import { close, reorder, menu, arrowDown, arrowForward, arrowBack, search, closeCircle } from 'ionicons/icons';
// import '@ionic/core/css/ionic.bundle.css'; // import '@ionic/core/css/ionic.bundle.css';
// import 'ionicons/dist/collection/icon/icon.css'; // import 'ionicons/dist/collection/icon/icon.css';
@ -18,5 +18,23 @@ export function appInitialize(config?: IonicConfig) {
Ionic.config = config; Ionic.config = config;
defineCustomElements(window); defineCustomElements(window);
addIcons(ICON_PATHS); // Icons that are used by internal components
addIcons({
'ios-close': close.ios,
'md-close': close.md,
'ios-reorder': reorder.ios,
'md-reorder': reorder.md,
'ios-menu': menu.ios,
'md-menu': menu.md,
'ios-arrow-forward': arrowForward.ios,
'md-arrow-forward': arrowForward.md,
'ios-arrow-back': arrowBack.ios,
'md-arrow-back': arrowBack.md,
'ios-arrow-down': arrowDown.ios,
'md-arrow-down': arrowDown.md,
'ios-search': search.ios,
'md-search': search.md,
'ios-close-circle': closeCircle.ios,
'md-close-circle': closeCircle.md,
});
} }

View File

@ -0,0 +1,9 @@
import { CreateElement, RenderContext } from 'vue';
export default {
name: 'IonPage',
functional: true,
render(h: CreateElement, { children }: RenderContext) {
return h('div', { class: { 'ion-page':true } }, children);
}
};

View File

@ -1,6 +1,6 @@
import Vue from 'vue'; import Vue from 'vue';
import VueRouter from 'vue-router'; import VueRouter from 'vue-router';
import { RouterDirection } from '@ionic/core'; import { RouterDirection, HTMLStencilElement } from '@ionic/core';
import { RouterOptions } from 'vue-router/types/router'; import { RouterOptions } from 'vue-router/types/router';
declare module 'vue-router/types/router' { declare module 'vue-router/types/router' {
@ -42,8 +42,6 @@ export interface IonicWindow extends Window {
Ionic: IonicGlobal; Ionic: IonicGlobal;
} }
export interface FrameworkDelegate { export interface FrameworkDelegate {
attachViewToDom(parentElement: HTMLElement, component: HTMLElement | WebpackFunction | object | Vue, opts?: object, classes?: string[]): Promise<HTMLElement>; attachViewToDom(parentElement: HTMLElement, component: HTMLElement | WebpackFunction | object | Vue, opts?: object, classes?: string[]): Promise<HTMLElement>;
removeViewFromDom(parentElement: HTMLElement, childElement: HTMLVueElement): Promise<void>; removeViewFromDom(parentElement: HTMLElement, childElement: HTMLVueElement): Promise<void>;

View File

@ -1,3 +1,5 @@
import { HTMLStencilElement } from '@ionic/core';
export class OverlayBaseController<Opts, Overlay> { export class OverlayBaseController<Opts, Overlay> {
constructor(private ctrl: string) {} constructor(private ctrl: string) {}