Showing
6 changed files
with
41 additions
and
9 deletions
components.d.ts
0 → 100644
| 1 | +/* eslint-disable */ | ||
| 2 | +// @ts-nocheck | ||
| 3 | +// Generated by unplugin-vue-components | ||
| 4 | +// Read more: https://github.com/vuejs/core/pull/3399 | ||
| 5 | +export {} | ||
| 6 | + | ||
| 7 | +/* prettier-ignore */ | ||
| 8 | +declare module 'vue' { | ||
| 9 | + export interface GlobalComponents { | ||
| 10 | + ElCol: typeof import('element-ui/lib/col')['default'] | ||
| 11 | + ElRow: typeof import('element-ui/lib/row')['default'] | ||
| 12 | + HagerFooter: typeof import('./src/components/common/hagerFooter.vue')['default'] | ||
| 13 | + HagerHeader: typeof import('./src/components/common/hagerHeader.vue')['default'] | ||
| 14 | + Navbar: typeof import('./src/components/navbar.vue')['default'] | ||
| 15 | + RouterLink: typeof import('vue-router')['RouterLink'] | ||
| 16 | + RouterView: typeof import('vue-router')['RouterView'] | ||
| 17 | + SlideComp: typeof import('./src/components/slideComp.vue')['default'] | ||
| 18 | + VideoPlayer: typeof import('./src/components/videoPlayer.vue')['default'] | ||
| 19 | + } | ||
| 20 | +} |
| ... | @@ -22,10 +22,12 @@ | ... | @@ -22,10 +22,12 @@ |
| 22 | "@vitejs/plugin-legacy": "^5.4.2", | 22 | "@vitejs/plugin-legacy": "^5.4.2", |
| 23 | "@vitejs/plugin-vue": "^5.1.2", | 23 | "@vitejs/plugin-vue": "^5.1.2", |
| 24 | "@vitejs/plugin-vue2": "^2.3.1", | 24 | "@vitejs/plugin-vue2": "^2.3.1", |
| 25 | + "babel-plugin-component": "^1.1.1", | ||
| 25 | "less": "^4.2.0", | 26 | "less": "^4.2.0", |
| 26 | "path-browserify": "^1.0.1", | 27 | "path-browserify": "^1.0.1", |
| 27 | "qs": "^6.13.0", | 28 | "qs": "^6.13.0", |
| 28 | "sass-embedded": "1.55.0", | 29 | "sass-embedded": "1.55.0", |
| 30 | + "unplugin-vue-components": "^0.27.4", | ||
| 29 | "vite": "^5.4.1", | 31 | "vite": "^5.4.1", |
| 30 | "vite-plugin-dynamic-import": "^1.5.0" | 32 | "vite-plugin-dynamic-import": "^1.5.0" |
| 31 | } | 33 | } | ... | ... |
| 1 | /* | 1 | /* |
| 2 | * @Date: 2024-08-26 10:12:56 | 2 | * @Date: 2024-08-26 10:12:56 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-09-24 18:05:09 | 4 | + * @LastEditTime: 2024-09-26 15:24:16 |
| 5 | - * @FilePath: /vue2_vite_web/src/main.js | 5 | + * @FilePath: /hager/src/main.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| 8 | import "@babel/polyfill"; | 8 | import "@babel/polyfill"; |
| ... | @@ -10,13 +10,15 @@ import Vue from "vue"; | ... | @@ -10,13 +10,15 @@ import Vue from "vue"; |
| 10 | import App from './App.vue' | 10 | import App from './App.vue' |
| 11 | import VueRouter from 'vue-router' | 11 | import VueRouter from 'vue-router' |
| 12 | import router from './router' | 12 | import router from './router' |
| 13 | -import ElementUI from 'element-ui'; | 13 | +// import ElementUI from 'element-ui'; |
| 14 | -import 'element-ui/lib/theme-chalk/index.css'; | 14 | +// import 'element-ui/lib/theme-chalk/index.css'; |
| 15 | import 'element-ui/lib/theme-chalk/display.css'; // 基于断点的隐藏类,用于在某些条件下隐藏元素 | 15 | import 'element-ui/lib/theme-chalk/display.css'; // 基于断点的隐藏类,用于在某些条件下隐藏元素 |
| 16 | -import '@/styles/element-ui/element-variables.scss' // 自定义主题, 不需要展示屏蔽 | 16 | +// import '@/styles/element-ui/element-variables.scss' // 自定义主题, 不需要展示屏蔽 |
| 17 | +// import { Button, Row, Col, } from 'element-ui'; | ||
| 17 | 18 | ||
| 18 | Vue.use(VueRouter); | 19 | Vue.use(VueRouter); |
| 19 | -Vue.use(ElementUI); | 20 | +// Vue.use(ElementUI); |
| 21 | +// Vue.use(Button).use(Row).use(Col) | ||
| 20 | 22 | ||
| 21 | new Vue({ | 23 | new Vue({ |
| 22 | router, | 24 | router, | ... | ... |
| 1 | /* | 1 | /* |
| 2 | * @Date: 2024-08-26 10:12:56 | 2 | * @Date: 2024-08-26 10:12:56 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-08-29 17:50:26 | 4 | + * @LastEditTime: 2024-09-26 15:25:44 |
| 5 | - * @FilePath: /vue2_vite_web/vite.config.js | 5 | + * @FilePath: /hager/vite.config.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| 8 | // import vue from '@vitejs/plugin-vue' | 8 | // import vue from '@vitejs/plugin-vue' |
| ... | @@ -10,7 +10,10 @@ import vue from "@vitejs/plugin-vue2"; | ... | @@ -10,7 +10,10 @@ import vue from "@vitejs/plugin-vue2"; |
| 10 | import legacy from "@vitejs/plugin-legacy"; | 10 | import legacy from "@vitejs/plugin-legacy"; |
| 11 | import dynamicImport from 'vite-plugin-dynamic-import'; | 11 | import dynamicImport from 'vite-plugin-dynamic-import'; |
| 12 | import { defineConfig, loadEnv } from 'vite'; | 12 | import { defineConfig, loadEnv } from 'vite'; |
| 13 | -import { createProxy } from './build/proxy' | 13 | +import { createProxy } from './build/proxy'; |
| 14 | +import Components from 'unplugin-vue-components/vite'; | ||
| 15 | +import { ElementUiResolver } from 'unplugin-vue-components/resolvers'; | ||
| 16 | + | ||
| 14 | 17 | ||
| 15 | // var path = require('path'); | 18 | // var path = require('path'); |
| 16 | import path from 'path-browserify'; | 19 | import path from 'path-browserify'; |
| ... | @@ -51,6 +54,9 @@ return defineConfig({ | ... | @@ -51,6 +54,9 @@ return defineConfig({ |
| 51 | ], | 54 | ], |
| 52 | }), | 55 | }), |
| 53 | dynamicImport(), | 56 | dynamicImport(), |
| 57 | + Components({ // 自动按需求引入组件 | ||
| 58 | + resolvers: [ElementUiResolver()], | ||
| 59 | + }), | ||
| 54 | ], | 60 | ], |
| 55 | publicDir: 'public', // 作为静态资源服务的文件夹。这个目录中的文件会在开发中被服务于 /,在开发模式时,会被拷贝到 outDir 的根目录,并没有转换,永远只是复制到这里。该值可以是文件系统的绝对路径,也可以是相对于项目的根目录路径。 | 61 | publicDir: 'public', // 作为静态资源服务的文件夹。这个目录中的文件会在开发中被服务于 /,在开发模式时,会被拷贝到 outDir 的根目录,并没有转换,永远只是复制到这里。该值可以是文件系统的绝对路径,也可以是相对于项目的根目录路径。 |
| 56 | // cacheDir: '', // 存储缓存文件的目录。此目录下会存储预打包的依赖项或 vite 生成的某些缓存文件,使用缓存可以提高性能。如需重新生成缓存文件,你可以使用 --force 命令行选项或手动删除目录。此选项的值可以是文件的绝对路径,也可以是以项目根目录为基准的相对路径。 | 62 | // cacheDir: '', // 存储缓存文件的目录。此目录下会存储预打包的依赖项或 vite 生成的某些缓存文件,使用缓存可以提高性能。如需重新生成缓存文件,你可以使用 --force 命令行选项或手动删除目录。此选项的值可以是文件的绝对路径,也可以是以项目根目录为基准的相对路径。 | ... | ... |
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment