From 470615eb0537958a21ee4df9be5f6ad0677d39b9 Mon Sep 17 00:00:00 2001 From: Mike Hartington Date: Mon, 8 Jul 2019 20:26:39 -0400 Subject: [PATCH] chore(): add page component --- vue/package.json | 8 +++----- vue/rollup.config.js | 6 +----- vue/src/components/{ => navigation}/ion-page.ts | 2 +- vue/src/components/{ => navigation}/ion-vue-router.ts | 0 vue/src/ionic.ts | 6 ++++-- vue/src/router.ts | 2 +- 6 files changed, 10 insertions(+), 14 deletions(-) rename vue/src/components/{ => navigation}/ion-page.ts (73%) rename vue/src/components/{ => navigation}/ion-vue-router.ts (100%) diff --git a/vue/package.json b/vue/package.json index f8650eb233..65a298632d 100644 --- a/vue/package.json +++ b/vue/package.json @@ -53,17 +53,15 @@ "tslint": "5.11.0", "tslint-ionic-rules": "0.0.19", "typescript": "3.1.1", - "vue-class-component": "^6.2.0", - "vue-property-decorator": "^7.2.0", "vue": "^2.5.17", "vue-template-compiler": "^2.5.17", - "vue-router": "^3.0.1", - "ionicons": "^4.6.0" + "vue-router": "^3.0.1" }, "dependencies": { "@ionic/core": "^4.6.0" }, "peerDependencies": { - "ionicons": "^4.5.10-2" + "vue": "^2.5.17", + "vue-router": "^3.0.1" } } diff --git a/vue/rollup.config.js b/vue/rollup.config.js index a41ba05349..28e798975f 100644 --- a/vue/rollup.config.js +++ b/vue/rollup.config.js @@ -24,9 +24,7 @@ function baseConfig() { output: [ outputConfig('', 'umd', { globals: { - vue: 'Vue', - 'vue-class-component': 'VueClassComponent', - 'vue-property-decorator': 'vue-property-decorator', + vue: 'Vue' }, }), outputConfig('.esm', 'esm'), @@ -35,8 +33,6 @@ function baseConfig() { external: [ 'vue', 'vue-router', - 'vue-class-component', - 'vue-property-decorator', '@ionic/core', '@ionic/core/loader', 'ionicons', diff --git a/vue/src/components/ion-page.ts b/vue/src/components/navigation/ion-page.ts similarity index 73% rename from vue/src/components/ion-page.ts rename to vue/src/components/navigation/ion-page.ts index 122cb0616d..6230e7ae2e 100644 --- a/vue/src/components/ion-page.ts +++ b/vue/src/components/navigation/ion-page.ts @@ -4,6 +4,6 @@ export default { name: 'IonPage', functional: true, render(h: CreateElement, { children }: RenderContext) { - return h('div', { class: { 'ion-page':true } }, children); + return h('div', { class: { 'ion-page': true } }, children); } }; diff --git a/vue/src/components/ion-vue-router.ts b/vue/src/components/navigation/ion-vue-router.ts similarity index 100% rename from vue/src/components/ion-vue-router.ts rename to vue/src/components/navigation/ion-vue-router.ts diff --git a/vue/src/ionic.ts b/vue/src/ionic.ts index 48132ab234..d83929d3ab 100644 --- a/vue/src/ionic.ts +++ b/vue/src/ionic.ts @@ -12,6 +12,7 @@ import { IonicConfig } from '@ionic/core'; import { appInitialize } from './app-initialize'; import { VueDelegate } from './controllers/vue-delegate'; import IonTabs from './components/navigation/ion-tabs'; +import IonPage from './components/navigation/ion-page'; import { createInputComponent } from './components/inputs'; export interface Controllers { @@ -31,9 +32,9 @@ declare module 'vue/types/vue' { } -function createApi(Vue: VueConstructor) { +function createApi(vueInstance: VueConstructor) { const cache: Partial = {}; - const vueDelegate = new VueDelegate(Vue); + const vueDelegate = new VueDelegate(vueInstance); return { get actionSheetController() { @@ -95,6 +96,7 @@ export const install: PluginFunction = (_Vue, config) => { Vue = _Vue; Vue.config.ignoredElements.push(/^ion-/); Vue.component('IonTabs', IonTabs); + Vue.component('IonPage', IonPage); createInputComponent('IonCheckboxVue', 'ion-checkbox', 'ionChange', 'checked'); createInputComponent('IonDatetimeVue', 'ion-datetime'); diff --git a/vue/src/router.ts b/vue/src/router.ts index 588b831bcc..ba3fa90de5 100644 --- a/vue/src/router.ts +++ b/vue/src/router.ts @@ -1,7 +1,7 @@ import VueRouter, { Route } from 'vue-router'; import { PluginFunction } from 'vue'; import { RouterArgs } from './interfaces'; -import IonVueRouter from './components/ion-vue-router'; +import IonVueRouter from './components/navigation/ion-vue-router'; import { BackButtonEvent, RouterDirection } from '@ionic/core'; // Extend the official VueRouter