first commit
This commit is contained in:
21
app_vue/node_modules/@vue/cli-plugin-router/LICENSE
generated
vendored
Normal file
21
app_vue/node_modules/@vue/cli-plugin-router/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017-present, Yuxi (Evan) You
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
9
app_vue/node_modules/@vue/cli-plugin-router/README.md
generated
vendored
Normal file
9
app_vue/node_modules/@vue/cli-plugin-router/README.md
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
# @vue/cli-plugin-router
|
||||
|
||||
> router plugin for vue-cli
|
||||
|
||||
## Installing in an Already Created Project
|
||||
|
||||
```bash
|
||||
vue add router
|
||||
```
|
44
app_vue/node_modules/@vue/cli-plugin-router/generator/index.js
generated
vendored
Normal file
44
app_vue/node_modules/@vue/cli-plugin-router/generator/index.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
module.exports = (api, options = {}, rootOptions = {}) => {
|
||||
const isVue3 = (rootOptions.vueVersion === '3')
|
||||
|
||||
api.injectImports(api.entryFile, `import router from './router'`)
|
||||
|
||||
if (isVue3) {
|
||||
api.transformScript(api.entryFile, require('./injectUseRouter'))
|
||||
api.extendPackage({
|
||||
dependencies: {
|
||||
'vue-router': '^4.0.3'
|
||||
}
|
||||
})
|
||||
} else {
|
||||
api.injectRootOptions(api.entryFile, `router`)
|
||||
|
||||
api.extendPackage({
|
||||
dependencies: {
|
||||
'vue-router': '^3.5.1'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
api.render('./template', {
|
||||
historyMode: options.historyMode,
|
||||
doesCompile: api.hasPlugin('babel') || api.hasPlugin('typescript'),
|
||||
hasTypeScript: api.hasPlugin('typescript')
|
||||
})
|
||||
|
||||
if (isVue3) {
|
||||
api.render('./template-vue3', {
|
||||
historyMode: options.historyMode,
|
||||
doesCompile: api.hasPlugin('babel') || api.hasPlugin('typescript'),
|
||||
hasTypeScript: api.hasPlugin('typescript')
|
||||
})
|
||||
}
|
||||
|
||||
if (api.invoking) {
|
||||
if (api.hasPlugin('typescript')) {
|
||||
/* eslint-disable-next-line node/no-extraneous-require */
|
||||
const convertFiles = require('@vue/cli-plugin-typescript/generator/convert')
|
||||
convertFiles(api)
|
||||
}
|
||||
}
|
||||
}
|
29
app_vue/node_modules/@vue/cli-plugin-router/generator/injectUseRouter.js
generated
vendored
Normal file
29
app_vue/node_modules/@vue/cli-plugin-router/generator/injectUseRouter.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
module.exports = (file, api) => {
|
||||
const j = api.jscodeshift
|
||||
const root = j(file.source)
|
||||
|
||||
const appRoots = root.find(j.CallExpression, (node) => {
|
||||
if (j.Identifier.check(node.callee) && node.callee.name === 'createApp') {
|
||||
return true
|
||||
}
|
||||
|
||||
if (
|
||||
j.MemberExpression.check(node.callee) &&
|
||||
j.Identifier.check(node.callee.object) &&
|
||||
node.callee.object.name === 'Vue' &&
|
||||
j.Identifier.check(node.callee.property) &&
|
||||
node.callee.property.name === 'createApp'
|
||||
) {
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
appRoots.replaceWith(({ node: createAppCall }) => {
|
||||
return j.callExpression(
|
||||
j.memberExpression(createAppCall, j.identifier('use')),
|
||||
[j.identifier('router')]
|
||||
)
|
||||
})
|
||||
|
||||
return root.toSource()
|
||||
}
|
63
app_vue/node_modules/@vue/cli-plugin-router/generator/template-vue3/src/App.vue
generated
vendored
Normal file
63
app_vue/node_modules/@vue/cli-plugin-router/generator/template-vue3/src/App.vue
generated
vendored
Normal 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 %>
|
45
app_vue/node_modules/@vue/cli-plugin-router/generator/template-vue3/src/router/index.js
generated
vendored
Normal file
45
app_vue/node_modules/@vue/cli-plugin-router/generator/template-vue3/src/router/index.js
generated
vendored
Normal 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
|
65
app_vue/node_modules/@vue/cli-plugin-router/generator/template/src/App.vue
generated
vendored
Normal file
65
app_vue/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
app_vue/node_modules/@vue/cli-plugin-router/generator/template/src/router/index.js
generated
vendored
Normal file
45
app_vue/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
app_vue/node_modules/@vue/cli-plugin-router/generator/template/src/views/AboutView.vue
generated
vendored
Normal file
5
app_vue/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
app_vue/node_modules/@vue/cli-plugin-router/generator/template/src/views/HomeView.vue
generated
vendored
Normal file
24
app_vue/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>
|
||||
<%_ } _%>
|
1
app_vue/node_modules/@vue/cli-plugin-router/index.js
generated
vendored
Normal file
1
app_vue/node_modules/@vue/cli-plugin-router/index.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = (api, options = {}) => {}
|
35
app_vue/node_modules/@vue/cli-plugin-router/package.json
generated
vendored
Normal file
35
app_vue/node_modules/@vue/cli-plugin-router/package.json
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "@vue/cli-plugin-router",
|
||||
"version": "5.0.8",
|
||||
"description": "router plugin for vue-cli",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue-cli.git",
|
||||
"directory": "packages/@vue/cli-plugin-router"
|
||||
},
|
||||
"keywords": [
|
||||
"vue",
|
||||
"cli",
|
||||
"router"
|
||||
],
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue-cli/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-router#readme",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/cli-shared-utils": "^5.0.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-test-utils": "^5.0.8"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vue/cli-service": "^3.0.0 || ^4.0.0 || ^5.0.0-0"
|
||||
},
|
||||
"gitHead": "b154dbd7aca4b4538e6c483b1d4b817499d7b8eb"
|
||||
}
|
13
app_vue/node_modules/@vue/cli-plugin-router/prompts.js
generated
vendored
Normal file
13
app_vue/node_modules/@vue/cli-plugin-router/prompts.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
// these prompts are used if the plugin is late-installed into an existing
|
||||
// project and invoked by `vue invoke`.
|
||||
|
||||
const { chalk } = require('@vue/cli-shared-utils')
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
name: 'historyMode',
|
||||
type: 'confirm',
|
||||
message: `Use history mode for router? ${chalk.yellow(`(Requires proper server setup for index fallback in production)`)}`,
|
||||
description: `By using the HTML5 History API, the URLs don't need the '#' character anymore.`
|
||||
}
|
||||
]
|
Reference in New Issue
Block a user