File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
packages/@vue/cli-plugin-router/generator Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ module.exports = (api, options = {}) => {
1010
1111 api . render ( './template' , {
1212 historyMode : options . historyMode ,
13- doesCompile : api . hasPlugin ( 'babel' ) || api . hasPlugin ( 'typescript' )
13+ doesCompile : api . hasPlugin ( 'babel' ) || api . hasPlugin ( 'typescript' ) ,
14+ hasTypeScript : api . hasPlugin ( 'typescript' )
1415 } )
1516
1617 if ( api . invoking ) {
Original file line number Diff line number Diff line change 11import Vue from 'vue'
2+ < % _ if ( hasTypeScript ) { _ % >
3+ import VueRouter , { RouteConfig } from 'vue-router'
4+ < % _ } else { _ % >
25import VueRouter from 'vue-router'
6+ < % _ } _ % >
37import Home from '../views/Home.vue'
48
59Vue . use ( VueRouter )
610
7- const routes = [
11+ < % _ if ( hasTypeScript ) { _ % >
12+ const routes : Array < RouteConfig > = [
13+ < % _ } else { _ % >
14+ const routes = [
15+ < % _ } _ % >
816 {
917 path : '/' ,
1018 name : 'Home' ,
You can’t perform that action at this time.
0 commit comments