From 78e57384671abc88802d654ea60f1c9515d2f300 Mon Sep 17 00:00:00 2001 From: weixin_46115723 Date: Tue, 5 Nov 2024 15:01:30 +0800 Subject: [PATCH] Auto Commit --- package.json | 19 +++++++++++-------- src/main.js | 5 +++++ vite.config.js | 14 +------------- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 3dcd187..f639684 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,23 @@ { "name": "vuejs-with-vite", "version": "0.0.0", + "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", - "preview": "vite preview --port 4173" + "preview": "vite preview" }, "dependencies": { - "element-plus": "^2.7.0", - "guess": "^1.0.2", - "pinia": "^2.1.7", - "vue": "^3.2.37", - "vue-router": "^4.3.0" + "@element-plus/icons-vue": "^2.3.1", + "element-plus": "^2.8.7", + "pinia": "^2.2.4", + "vue": "^3.5.12", + "vue-router": "^4.4.5" }, "devDependencies": { - "@vitejs/plugin-vue": "^3.0.1", - "vite": "^5.0.1" + "@vitejs/plugin-vue": "^5.1.4", + "less": "^4.2.0", + "vite": "^5.4.10" } } diff --git a/src/main.js b/src/main.js index 442b37a..41d9427 100644 --- a/src/main.js +++ b/src/main.js @@ -4,12 +4,17 @@ import { createApp } from 'vue' import { createPinia } from 'pinia' import 'element-plus/dist/index.css' import ElementPlus from 'element-plus' +import * as ElementPlusIconsVue from '@element-plus/icons-vue' import App from './App.vue' + import router from './router' const app = createApp(App) +for (const [key, component] of Object.entries(ElementPlusIconsVue)) { + app.component(key, component) +} app.use(createPinia()).use(ElementPlus) app.use(router) diff --git a/vite.config.js b/vite.config.js index 4d9f38e..21d97d5 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,21 +1,9 @@ -// import { defineConfig } from 'vite' -// import vue from '@vitejs/plugin-vue' - -// // https://vitejs.dev/config/ -// export default defineConfig({ -// server: { -// host: true -// }, -// plugins: [vue()] -// }) - - import { fileURLToPath, URL } from 'node:url' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' -// https://vitejs.dev/config/ +// https://vite.dev/config/ export default defineConfig({ plugins: [ vue(), -- GitLab