first
This commit is contained in:
65
node_modules/@vue/cli-plugin-router/generator/template/src/App.vue
generated
vendored
Normal file
65
node_modules/@vue/cli-plugin-router/generator/template/src/App.vue
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
---
|
||||
extend: '@vue/cli-service/generator/template/src/App.vue'
|
||||
replace:
|
||||
- !!js/regexp /<template>[^]*?<\/template>/
|
||||
- !!js/regexp /\n<script>[^]*?<\/script>\n/
|
||||
- !!js/regexp / margin-top[^]*?<\/style>/
|
||||
---
|
||||
|
||||
<%# REPLACE %>
|
||||
<template>
|
||||
<div id="app">
|
||||
<nav>
|
||||
<router-link to="/">Home</router-link> |
|
||||
<router-link to="/about">About</router-link>
|
||||
</nav>
|
||||
<router-view/>
|
||||
</div>
|
||||
</template>
|
||||
<%# END_REPLACE %>
|
||||
|
||||
<%# REPLACE %>
|
||||
<%# END_REPLACE %>
|
||||
|
||||
<%# REPLACE %>
|
||||
}
|
||||
|
||||
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
|
||||
<%_ if (!rootOptions.cssPreprocessor) { _%>
|
||||
nav {
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
nav a {
|
||||
font-weight: bold;
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
nav a.router-link-exact-active {
|
||||
color: #42b983;
|
||||
}
|
||||
<%_ } else { _%>
|
||||
nav {
|
||||
padding: 30px;
|
||||
|
||||
a {
|
||||
font-weight: bold;
|
||||
color: #2c3e50;
|
||||
|
||||
&.router-link-exact-active {
|
||||
color: #42b983;
|
||||
}
|
||||
}
|
||||
}
|
||||
<%_ } _%>
|
||||
<%_ } else { _%>
|
||||
nav
|
||||
padding 30px
|
||||
a
|
||||
font-weight bold
|
||||
color #2c3e50
|
||||
&.router-link-exact-active
|
||||
color #42b983
|
||||
<%_ } _%>
|
||||
</style>
|
||||
<%# END_REPLACE %>
|
45
node_modules/@vue/cli-plugin-router/generator/template/src/router/index.js
generated
vendored
Normal file
45
node_modules/@vue/cli-plugin-router/generator/template/src/router/index.js
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
import Vue from 'vue'
|
||||
<%_ if (hasTypeScript) { _%>
|
||||
import VueRouter, { RouteConfig } from 'vue-router'
|
||||
<%_ } else { _%>
|
||||
import VueRouter from 'vue-router'
|
||||
<%_ } _%>
|
||||
import HomeView from '../views/HomeView.vue'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
<%_ if (hasTypeScript) { _%>
|
||||
const routes: Array<RouteConfig> = [
|
||||
<%_ } else { _%>
|
||||
const routes = [
|
||||
<%_ } _%>
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: HomeView
|
||||
},
|
||||
{
|
||||
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.
|
||||
<%_ if (doesCompile) { _%>
|
||||
component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
|
||||
<%_ } else { _%>
|
||||
component: function () {
|
||||
return import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
|
||||
}
|
||||
<%_ } _%>
|
||||
}
|
||||
]
|
||||
|
||||
const router = new VueRouter({
|
||||
<%_ if (historyMode) { _%>
|
||||
mode: 'history',
|
||||
base: process.env.BASE_URL,
|
||||
<%_ } _%>
|
||||
routes
|
||||
})
|
||||
|
||||
export default router
|
5
node_modules/@vue/cli-plugin-router/generator/template/src/views/AboutView.vue
generated
vendored
Normal file
5
node_modules/@vue/cli-plugin-router/generator/template/src/views/AboutView.vue
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
<template>
|
||||
<div class="about">
|
||||
<h1>This is an about page</h1>
|
||||
</div>
|
||||
</template>
|
24
node_modules/@vue/cli-plugin-router/generator/template/src/views/HomeView.vue
generated
vendored
Normal file
24
node_modules/@vue/cli-plugin-router/generator/template/src/views/HomeView.vue
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
<template>
|
||||
<div class="home">
|
||||
<img alt="Vue logo" src="../assets/logo.png">
|
||||
<%_ if (!rootOptions.bare) { _%>
|
||||
<HelloWorld msg="Welcome to Your Vue.js App"/>
|
||||
<%_ } else { _%>
|
||||
<h1>Welcome to Your Vue.js App</h1>
|
||||
<%_ } _%>
|
||||
</div>
|
||||
</template>
|
||||
<%_ if (!rootOptions.bare) { _%>
|
||||
|
||||
<script>
|
||||
// @ is an alias to /src
|
||||
import HelloWorld from '@/components/HelloWorld.vue'
|
||||
|
||||
export default {
|
||||
name: 'HomeView',
|
||||
components: {
|
||||
HelloWorld
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<%_ } _%>
|
Reference in New Issue
Block a user