This commit is contained in:
2025-09-19 14:25:20 +08:00
parent 269893a435
commit fbf3f77229
24949 changed files with 2839404 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
---
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>
<nav>
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
</nav>
<router-view/>
</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 %>

View File

@@ -0,0 +1,45 @@
import { createRouter<%
if (historyMode) {
%>, createWebHistory<%
} else {
%>, createWebHashHistory<%
}
if (hasTypeScript) {
%>, RouteRecordRaw<%
}
%> } from 'vue-router'
import HomeView from '../views/HomeView.vue'
const routes<% if (hasTypeScript) { %>: Array<RouteRecordRaw><% } %> = [
{
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 = createRouter({
<%_ if (historyMode) { _%>
history: createWebHistory(process.env.BASE_URL),
<%_ } else { _%>
history: createWebHashHistory(),
<%_ } _%>
routes
})
export default router