Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-05-26 17:08:21 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
450f6ff06644fcdd900a65571fd744b974db1a3e
450f6ff0
1 parent
7431e577
新增vite插件处理vue3,setup函数中无法写name的问题
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
149 additions
and
19 deletions
package.json
src/App.vue
src/views/client/bookDetail.vue
vite.config.js
yarn.lock
package.json
View file @
450f6ff
...
...
@@ -40,6 +40,7 @@
"postcss-px-to-viewport"
:
"^1.1.1"
,
"qs"
:
"^6.10.3"
,
"tslint"
:
"^6.1.3"
,
"unplugin-vue-define-options"
:
"^0.6.1"
,
"vite"
:
"^2.9.9"
,
"vite-plugin-style-import"
:
"1.4.1"
,
"vue-router"
:
"4"
...
...
src/App.vue
View file @
450f6ff
<template>
<!-- 页面缓存 -->
<router-view v-slot="{ Component, route }">
<keep-alive :include="keepPages">
<keep-alive :include="keepPages"
:max="10"
>
<component :is="Component" :key="route.name" />
</keep-alive>
</router-view>
...
...
src/views/client/bookDetail.vue
View file @
450f6ff
...
...
@@ -311,20 +311,6 @@ const goToDetail = (prod_id, book_id, type) => { // 跳转作品详情页
/*****************************************************/
</script>
<script>
export default {
name: 'bookDetail',
data() {
return {
}
},
mounted() {
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import url('@css/content-bg.less');
...
...
vite.config.js
View file @
450f6ff
...
...
@@ -4,6 +4,7 @@ import dynamicImport from 'vite-plugin-dynamic-import';
import
styleImport
,
{
VantResolve
}
from
'vite-plugin-style-import'
;
import
{
defineConfig
,
loadEnv
}
from
'vite'
;
import
{
createProxy
}
from
'./build/proxy'
import
DefineOptions
from
'unplugin-vue-define-options/vite'
;
var
path
=
require
(
'path'
);
...
...
@@ -29,6 +30,7 @@ export default ({ command, mode }) => {
// legacy({
// targets: ['defaults', 'not IE 11']
// }), // Vite 的默认旧版浏览器支持时提供此插件本机ESM的支持。
DefineOptions
(),
// 插件来对组件名进行注册的, 解决setup没法写name的问题
],
publicDir
:
'public'
,
// 作为静态资源服务的文件夹。这个目录中的文件会在开发中被服务于 /,在开发模式时,会被拷贝到 outDir 的根目录,并没有转换,永远只是复制到这里。该值可以是文件系统的绝对路径,也可以是相对于项目的根目录路径。
// cacheDir: '', // 存储缓存文件的目录。此目录下会存储预打包的依赖项或 vite 生成的某些缓存文件,使用缓存可以提高性能。如需重新生成缓存文件,你可以使用 --force 命令行选项或手动删除目录。此选项的值可以是文件的绝对路径,也可以是以项目根目录为基准的相对路径。
...
...
yarn.lock
View file @
450f6ff
...
...
@@ -74,6 +74,14 @@
estree-walker "^2.0.1"
picomatch "^2.2.2"
"@rollup/pluginutils@^4.2.0":
version "4.2.1"
resolved "https://mirrors.tencent.com/npm/@rollup%2fpluginutils/-/pluginutils-4.2.1.tgz#e6c6c3aba0744edce3fb2074922d3776c0af2a6d"
integrity sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==
dependencies:
estree-walker "^2.0.1"
picomatch "^2.2.2"
"@types/jquery@^3.5.14":
version "3.5.14"
resolved "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.14.tgz"
...
...
@@ -141,6 +149,16 @@
estree-walker "^2.0.2"
source-map "^0.6.1"
"@vue/compiler-core@3.2.36":
version "3.2.36"
resolved "https://mirrors.tencent.com/npm/@vue%2fcompiler-core/-/compiler-core-3.2.36.tgz#2fa44595308c95610602df54dcb69063ba2c8383"
integrity sha512-bbyZM5hvBicv0PW3KUfVi+x3ylHnfKG7DOn5wM+f2OztTzTjLEyBb/5yrarIYpmnGitVGbjZqDbODyW4iK8hqw==
dependencies:
"@babel/parser" "^7.16.4"
"@vue/shared" "3.2.36"
estree-walker "^2.0.2"
source-map "^0.6.1"
"@vue/compiler-dom@3.2.34":
version "3.2.34"
resolved "https://mirrors.cloud.tencent.com/npm/@vue%2fcompiler-dom/-/compiler-dom-3.2.34.tgz#3aadd83fd789c7feaa56f838e86c5c7146395579"
...
...
@@ -149,6 +167,14 @@
"@vue/compiler-core" "3.2.34"
"@vue/shared" "3.2.34"
"@vue/compiler-dom@3.2.36":
version "3.2.36"
resolved "https://mirrors.tencent.com/npm/@vue%2fcompiler-dom/-/compiler-dom-3.2.36.tgz#16d911ff163ed5fc8087a01645bf14bb7f325401"
integrity sha512-tcOTAOiW4s24QLnq+ON6J+GRONXJ+A/mqKCORi0LSlIh8XQlNnlm24y8xIL8la+ZDgkdbjarQ9ZqYSvEja6gVA==
dependencies:
"@vue/compiler-core" "3.2.36"
"@vue/shared" "3.2.36"
"@vue/compiler-sfc@3.2.34", "@vue/compiler-sfc@^3.2.34":
version "3.2.34"
resolved "http://mirrors.cloud.tencent.com/npm/@vue%2fcompiler-sfc/-/compiler-sfc-3.2.34.tgz#3c02b261e631f20587b31e2b9ddc5596cd36c9da"
...
...
@@ -165,6 +191,22 @@
postcss "^8.1.10"
source-map "^0.6.1"
"@vue/compiler-sfc@^3.2.31":
version "3.2.36"
resolved "https://mirrors.tencent.com/npm/@vue%2fcompiler-sfc/-/compiler-sfc-3.2.36.tgz#e5065e7c0e5170ffa750e3c3dd93a29db109d0f2"
integrity sha512-AvGb4bTj4W8uQ4BqaSxo7UwTEqX5utdRSMyHy58OragWlt8nEACQ9mIeQh3K4di4/SX+41+pJrLIY01lHAOFOA==
dependencies:
"@babel/parser" "^7.16.4"
"@vue/compiler-core" "3.2.36"
"@vue/compiler-dom" "3.2.36"
"@vue/compiler-ssr" "3.2.36"
"@vue/reactivity-transform" "3.2.36"
"@vue/shared" "3.2.36"
estree-walker "^2.0.2"
magic-string "^0.25.7"
postcss "^8.1.10"
source-map "^0.6.1"
"@vue/compiler-ssr@3.2.34":
version "3.2.34"
resolved "http://mirrors.cloud.tencent.com/npm/@vue%2fcompiler-ssr/-/compiler-ssr-3.2.34.tgz#5e2acc9c051cf877e6a5da20ffd4ff0257d9f4c5"
...
...
@@ -173,6 +215,14 @@
"@vue/compiler-dom" "3.2.34"
"@vue/shared" "3.2.34"
"@vue/compiler-ssr@3.2.36":
version "3.2.36"
resolved "https://mirrors.tencent.com/npm/@vue%2fcompiler-ssr/-/compiler-ssr-3.2.36.tgz#314f3a9424db58142c3608f48cbda7aa05fc66cb"
integrity sha512-+KugInUFRvOxEdLkZwE+W43BqHyhBh0jpYXhmqw1xGq2dmE6J9eZ8UUSOKNhdHtQ/iNLWWeK/wPZkVLUf3YGaw==
dependencies:
"@vue/compiler-dom" "3.2.36"
"@vue/shared" "3.2.36"
"@vue/devtools-api@^6.0.0":
version "6.1.3"
resolved "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.1.3.tgz"
...
...
@@ -194,6 +244,17 @@
estree-walker "^2.0.2"
magic-string "^0.25.7"
"@vue/reactivity-transform@3.2.36":
version "3.2.36"
resolved "https://mirrors.tencent.com/npm/@vue%2freactivity-transform/-/reactivity-transform-3.2.36.tgz#8426a941b0b09d1b94fc162d4642758183b5d133"
integrity sha512-Jk5o2BhpODC9XTA7o4EL8hSJ4JyrFWErLtClG3NH8wDS7ri9jBDWxI7/549T7JY9uilKsaNM+4pJASLj5dtRwA==
dependencies:
"@babel/parser" "^7.16.4"
"@vue/compiler-core" "3.2.36"
"@vue/shared" "3.2.36"
estree-walker "^2.0.2"
magic-string "^0.25.7"
"@vue/reactivity@3.2.34":
version "3.2.34"
resolved "http://mirrors.cloud.tencent.com/npm/@vue%2freactivity/-/reactivity-3.2.34.tgz#660e7217a529d788326d22ff89473cdd101ce1ad"
...
...
@@ -231,6 +292,11 @@
resolved "https://mirrors.cloud.tencent.com/npm/@vue%2fshared/-/shared-3.2.34.tgz#b71750d05120feb644102088a09be64518cd3a86"
integrity sha512-zhEeB8TrFmTXmTXmu/wcjEhgrjO4xqdDQrCdPhjX7NxfoLqoBVKguOm8qyihWNLbP+41svYY4za9mqXyqFLzNg==
"@vue/shared@3.2.36":
version "3.2.36"
resolved "https://mirrors.tencent.com/npm/@vue%2fshared/-/shared-3.2.36.tgz#35e11200542cf29068ba787dad57da9bdb82f644"
integrity sha512-JtB41wXl7Au3+Nl3gD16Cfpj7k/6aCroZ6BbOiCMFCMvrOpkg/qQUXTso2XowaNqBbnkuGHurLAqkLBxNGc1hQ==
"@vueuse/core@^8.5.0":
version "8.5.0"
resolved "https://mirrors.cloud.tencent.com/npm/@vueuse%2fcore/-/core-8.5.0.tgz#2b7548e52165c88e1463756c36188e105d806543"
...
...
@@ -269,6 +335,14 @@ ansi-styles@^3.2.1:
dependencies:
color-convert "^1.9.0"
anymatch@~3.1.2:
version "3.1.2"
resolved "https://mirrors.tencent.com/npm/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==
dependencies:
normalize-path "^3.0.0"
picomatch "^2.0.4"
argparse@^1.0.7:
version "1.0.10"
resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz"
...
...
@@ -293,6 +367,11 @@ base64-arraybuffer@^1.0.2:
resolved "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz"
integrity sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==
binary-extensions@^2.0.0:
version "2.2.0"
resolved "https://mirrors.tencent.com/npm/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz"
...
...
@@ -301,7 +380,7 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0"
concat-map "0.0.1"
braces@^3.0.2:
braces@^3.0.2
, braces@~3.0.2
:
version "3.0.2"
resolved "http://mirrors.tencent.com/npm/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
...
...
@@ -365,6 +444,21 @@ change-case@^4.1.2:
snake-case "^3.0.4"
tslib "^2.0.3"
chokidar@^3.5.3:
version "3.5.3"
resolved "https://mirrors.tencent.com/npm/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==
dependencies:
anymatch "~3.1.2"
braces "~3.0.2"
glob-parent "~5.1.2"
is-binary-path "~2.1.0"
is-glob "~4.0.1"
normalize-path "~3.0.0"
readdirp "~3.6.0"
optionalDependencies:
fsevents "~2.3.2"
color-convert@^1.9.0:
version "1.9.3"
resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz"
...
...
@@ -668,7 +762,7 @@ get-intrinsic@^1.0.2:
has "^1.0.3"
has-symbols "^1.0.1"
glob-parent@^5.1.2:
glob-parent@^5.1.2
, glob-parent@~5.1.2
:
version "5.1.2"
resolved "https://mirrors.cloud.tencent.com/npm/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
...
...
@@ -762,6 +856,13 @@ inherits@2:
resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
is-binary-path@~2.1.0:
version "2.1.0"
resolved "https://mirrors.tencent.com/npm/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
dependencies:
binary-extensions "^2.0.0"
is-core-module@^2.8.1:
version "2.8.1"
resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz"
...
...
@@ -774,7 +875,7 @@ is-extglob@^2.1.1:
resolved "https://mirrors.cloud.tencent.com/npm/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
is-glob@^4.0.1:
is-glob@^4.0.1
, is-glob@~4.0.1
:
version "4.0.3"
resolved "http://mirrors.tencent.com/npm/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
...
...
@@ -963,6 +1064,11 @@ no-case@^3.0.4:
lower-case "^2.0.2"
tslib "^2.0.3"
normalize-path@^3.0.0, normalize-path@~3.0.0:
version "3.0.0"
resolved "https://mirrors.tencent.com/npm/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
object-assign@>=4.0.1:
version "4.1.1"
resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz"
...
...
@@ -1024,7 +1130,7 @@ picocolors@^1.0.0:
resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz"
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
picomatch@^2.2.2, picomatch@^2.3.1:
picomatch@^2.
0.4, picomatch@^2.2.1, picomatch@^2.
2.2, picomatch@^2.3.1:
version "2.3.1"
resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
...
...
@@ -1085,6 +1191,13 @@ queue-microtask@^1.2.2:
resolved "http://mirrors.cloud.tencent.com/npm/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==
readdirp@~3.6.0:
version "3.6.0"
resolved "https://mirrors.tencent.com/npm/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==
dependencies:
picomatch "^2.2.1"
regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.9:
version "0.13.9"
resolved "https://mirrors.cloud.tencent.com/npm/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52"
...
...
@@ -1251,6 +1364,24 @@ universalify@^2.0.0:
resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz"
integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==
unplugin-vue-define-options@^0.6.1:
version "0.6.1"
resolved "https://mirrors.cloud.tencent.com/npm/unplugin-vue-define-options/-/unplugin-vue-define-options-0.6.1.tgz#79e066d1152ecb908bdcd204b185af2bcb9a2c76"
integrity sha512-YZQxE3vC7Tb4Ev10blfYPC23hR3t8UNynoVSt2bY9GtHB2usxpywPQqRj7xdUtuj6JsDfrZ9wRKKbEkcMEXI1A==
dependencies:
"@rollup/pluginutils" "^4.2.0"
"@vue/compiler-sfc" "^3.2.31"
unplugin "^0.6.0"
unplugin@^0.6.0:
version "0.6.3"
resolved "https://mirrors.cloud.tencent.com/npm/unplugin/-/unplugin-0.6.3.tgz#b8721e2b163a410a7efed726e6a0fc6fbadf975a"
integrity sha512-CoW88FQfCW/yabVc4bLrjikN9HC8dEvMU4O7B6K2jsYMPK0l6iAnd9dpJwqGcmXJKRCU9vwSsy653qg+RK0G6A==
dependencies:
chokidar "^3.5.3"
webpack-sources "^3.2.3"
webpack-virtual-modules "^0.4.3"
upper-case-first@^2.0.2:
version "2.0.2"
resolved "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz"
...
...
@@ -1368,6 +1499,16 @@ vue@^3.2.34:
"@vue/server-renderer" "3.2.34"
"@vue/shared" "3.2.34"
webpack-sources@^3.2.3:
version "3.2.3"
resolved "https://mirrors.tencent.com/npm/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==
webpack-virtual-modules@^0.4.3:
version "0.4.3"
resolved "https://mirrors.cloud.tencent.com/npm/webpack-virtual-modules/-/webpack-virtual-modules-0.4.3.tgz#cd597c6d51d5a5ecb473eea1983a58fa8a17ded9"
integrity sha512-5NUqC2JquIL2pBAAo/VfBP6KuGkHIZQXW/lNKupLPfhViwh8wNsu0BObtl09yuKZszeEUfbXz8xhrHvSG16Nqw==
weixin-js-sdk@^1.6.0:
version "1.6.0"
resolved "https://registry.npmjs.org/weixin-js-sdk/-/weixin-js-sdk-1.6.0.tgz"
...
...
Please
register
or
login
to post a comment