You should review these changes with git diff and commit them.
加入 ionic4
接下来为应用加入ionic4支持,执行:
1
yarn add @ionic/vue @ionic/core
系统显示:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
yarn add v1.13.0 [1/4] 🔍 Resolving packages... [2/4] 🚚 Fetching packages... [3/4] 🔗 Linking dependencies... [4/4] 🔨 Building fresh packages... success Saved lockfile. success Saved 2 new dependencies. info Direct dependencies ├─ @ionic/core@4.9.1 └─ @ionic/vue@0.0.4 info All dependencies ├─ @ionic/core@4.9.1 └─ @ionic/vue@0.0.4 ✨ Done in 16.09s.
安装 ionicons
1
yarn add ionicons@4.5.9–1
系统会提示你选择版本,选择 4.5.9-1 版。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
yarn add v1.13.0 [1/4] 🔍 Resolving packages... Couldn't find any versions for "ionicons" that matches "4.5.9–1" ? Please choose a version of "ionicons" from this list: 4.5.9-1 [2/4] 🚚 Fetching packages... [3/4] 🔗 Linking dependencies... [4/4] 🔨 Building fresh packages... success Saved lockfile. success Saved 1 new dependency. info Direct dependencies └─ ionicons@4.5.9-1 info All dependencies └─ ionicons@4.5.9-1 ✨ Done in 29.25s.
import Vue from'vue' // import Router from 'vue-router' import Home from'./views/Home.vue' import { IonicVueRouter } from'@ionic/vue';
// Vue.use(Router) Vue.use(IonicVueRouter);
// export default new Router({ exportdefaultnew IonicVueRouter({ mode: 'history', base: process.env.BASE_URL, routes: [ { path: '/', name: 'home', component: Home }, { path: '/about', name: 'about', // route level code-splitting // this generates a separate chunk (about.[hash].js) for this route // which is lazy-loaded when the route is visited. component: () =>import(/* webpackChunkName: "about" */'./views/About.vue') } ] })