From 84ec4ff1ae161d14fecf12fd2165ba36843d9a1c Mon Sep 17 00:00:00 2001 From: roger_home_pc Date: Sat, 21 Oct 2023 11:36:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=AC=AC8=E5=BC=A0=E5=AD=A6?= =?UTF-8?q?=E4=B9=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/App.vue | 14 ++++++++++++-- src/main.js | 9 ++++++++- src/views/About.vue | 2 +- src/views/Home.vue | 17 +++++++++++++---- vite.config.js | 23 ++++++++++++----------- yarn.lock | 18 ++++++++++++++++-- 7 files changed, 63 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 14937b0..cca11b7 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^4.2.3", + "sass": "^1.69.4", "unplugin-auto-import": "^0.16.6", "unplugin-vue-components": "^0.25.2", "vite": "^4.4.5" diff --git a/src/App.vue b/src/App.vue index 3188684..0a8fcf1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,12 +1,22 @@ diff --git a/src/main.js b/src/main.js index e2361c1..c52f2e0 100644 --- a/src/main.js +++ b/src/main.js @@ -2,5 +2,12 @@ import { createApp } from 'vue' import App from './App.vue' import router from "./router/index.js"; import store from "./store/index.js"; +import * as ElIcons from "@element-plus/icons-vue"; -createApp(App).use(router).use(store).mount('#app') +const app = createApp(App); + +for (const name in ElIcons){ + app.component(name, ElIcons[name]); +} + +app.use(router).use(store).mount('#app') diff --git a/src/views/About.vue b/src/views/About.vue index da41eb4..3a9e434 100644 --- a/src/views/About.vue +++ b/src/views/About.vue @@ -21,4 +21,4 @@ function increase() { \ No newline at end of file + diff --git a/src/views/Home.vue b/src/views/Home.vue index e23b426..1433c99 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -1,7 +1,10 @@ - \ No newline at end of file + diff --git a/vite.config.js b/vite.config.js index 1ff52c9..6675067 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,18 +1,19 @@ -import { defineConfig } from 'vite' +import {defineConfig} from 'vite' import vue from '@vitejs/plugin-vue' import AutoImport from 'unplugin-auto-import/vite' import Components from 'unplugin-vue-components/vite' -import { ElementPlusResolver } from "unplugin-vue-components/resolvers"; +import {ElementPlusResolver} from "unplugin-vue-components/resolvers"; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [ - vue(), - AutoImport({ - resolvers: [ElementPlusResolver()], - }), - Components({ - resolvers: [ElementPlusResolver()] - }) - ], + plugins: [ + vue(), + AutoImport({ + // imports: ['vue', 'vue-router', 'vuex', 'vue-i18n'], + resolvers: [ElementPlusResolver()], + }), + Components({ + resolvers: [ElementPlusResolver()] + }) + ], }) diff --git a/yarn.lock b/yarn.lock index 23c2da1..334186f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -378,7 +378,7 @@ braces@^3.0.2, braces@~3.0.2: dependencies: fill-range "^7.0.1" -chokidar@^3.5.3: +"chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.3: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -516,6 +516,11 @@ has@^1.0.3: resolved "https://registry.yarnpkg.com/has/-/has-1.0.4.tgz#2eb2860e000011dae4f1406a86fe80e530fb2ec6" integrity sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ== +immutable@^4.0.0: + version "4.3.4" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.4.tgz#2e07b33837b4bb7662f288c244d1ced1ef65a78f" + integrity sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA== + is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" @@ -712,12 +717,21 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" +sass@^1.69.4: + version "1.69.4" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.69.4.tgz#10c735f55e3ea0b7742c6efa940bce30e07fbca2" + integrity sha512-+qEreVhqAy8o++aQfCJwp0sklr2xyEzkm9Pp/Igu9wNPoe7EZEQ8X/MBvvXggI2ql607cxKg/RKOwDj6pp2XDA== + dependencies: + chokidar ">=3.0.0 <4.0.0" + immutable "^4.0.0" + source-map-js ">=0.6.2 <2.0.0" + scule@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/scule/-/scule-1.0.0.tgz#895e6f4ba887e78d8b9b4111e23ae84fef82376d" integrity sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ== -source-map-js@^1.0.2: +"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==