Merge branch 'master' of https://github.com/zouzhibin/vue-admin-perfect into vue-i18n
This commit is contained in:
commit
b6d0f52585
|
|
@ -1,2 +1,5 @@
|
||||||
# 本地环境
|
# 本地环境
|
||||||
NODE_ENV = 'development'
|
NODE_ENV = 'development'
|
||||||
|
|
||||||
|
# 本地环境接口地址
|
||||||
|
VITE_API_URL = '/api'
|
||||||
|
|
|
||||||
10
README.md
10
README.md
|
|
@ -1,13 +1,8 @@
|
||||||
# 简介
|
# 简介
|
||||||
vue-element-perfect 是一个后台前端解决方案, 基于Vue3.0+TS+Element-plus实现。它使用了最新的前端技术栈、动态路由,权限验证,并且有着丰富的组件。
|
vue-element-perfect 是一个后台前端解决方案, 基于Vue3.0+TS+Element-plus实现。它使用了最新的前端技术栈、动态路由,权限验证,并且有着丰富的组件。
|
||||||
|
|
||||||
## 效果预览
|
|
||||||
|
|
||||||
### 在线预览点击 —— [企业级、通用型中后台前端解决方案 ](http://182.61.5.190:8889/)
|
### 在线预览点击 —— [企业级、通用型中后台前端解决方案 ](http://182.61.5.190:8889/)
|
||||||
|
|
||||||
### 附上github地址点击跳转 [vue-admin-perfect](https://github.com/zouzhibin/vue-admin-perfect)
|
|
||||||
|
|
||||||
|
|
||||||
## 项目功能
|
## 项目功能
|
||||||
- 使用Vue3.0开发,单文件组件采用<script setup>
|
- 使用Vue3.0开发,单文件组件采用<script setup>
|
||||||
- 登录逻辑,使用vue-router进行路由权限拦截,判断,路由懒加载
|
- 登录逻辑,使用vue-router进行路由权限拦截,判断,路由懒加载
|
||||||
|
|
@ -31,12 +26,13 @@ vue-element-perfect 是一个后台前端解决方案, 基于Vue3.0+TS+Element-p
|
||||||
```
|
```
|
||||||
|
|
||||||
## 分支管理
|
## 分支管理
|
||||||
- master 技术采用 vite + vue3.0 + Typescript + vuex + vue-router + Element-Plus scss
|
- master 技术采用 vite + vue3.0 + Typescript + pinia
|
||||||
```
|
```
|
||||||
注意:使用 Vite 构建工具,需要 Node.js 版本 >= 12.0.0 查看 Node.js 版本 node-v
|
注意:使用 Vite 构建工具,需要 Node.js 版本 >= 12.0.0 查看 Node.js 版本 node-v
|
||||||
```
|
```
|
||||||
|
- vite-vuex vite + vue3.0 + Typescript + vuex
|
||||||
- vue-i18n 语言切换版本
|
- vue-i18n 语言切换版本
|
||||||
- webpack 技术采用 webpack + vue3.0 + Typescript + vuex + vue-router + Element-Plus scss
|
- webpack 技术采用 webpack + vue3.0 + Typescript + vuex
|
||||||
- uniapp uniapp版本 uniapp +vuex +element scss
|
- uniapp uniapp版本 uniapp +vuex +element scss
|
||||||
```
|
```
|
||||||
# 本地开发 启动项目
|
# 本地开发 启动项目
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,12 @@
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
"build:dev": "vite build --mode development",
|
||||||
|
"build:test": "vite build --mode test",
|
||||||
|
"build:prod": "vite build --mode production",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
|
"build:ts": "vue-tsc --noEmit --skipLibCheck && vite build",
|
||||||
"lint": "eslint . --ext .vue,.js,.ts,.jsx,.tsx --fix",
|
"lint": "eslint . --ext .vue,.js,.ts,.jsx,.tsx --fix",
|
||||||
"lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\""
|
"lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\""
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
|
||||||
|
|
@ -16,7 +16,9 @@
|
||||||
@click="routerGo(tag)"
|
@click="routerGo(tag)"
|
||||||
>
|
>
|
||||||
<div class="tags-view-item">{{ tag.title }}</div>
|
<div class="tags-view-item">{{ tag.title }}</div>
|
||||||
<el-icon @click.prevent.stop="(e) => closeSelectedTag(e, tag)" class="tag-icon">
|
<el-icon
|
||||||
|
v-if="!isAffix(tag)"
|
||||||
|
@click.prevent.stop="(e) => closeSelectedTag(e, tag)" class="tag-icon">
|
||||||
<circle-close-filled
|
<circle-close-filled
|
||||||
/></el-icon>
|
/></el-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -169,11 +171,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// 关闭所有 去首页
|
// 关闭所有 去首页
|
||||||
const closeAllTab = ()=>{
|
const closeAllTab = async ()=>{
|
||||||
if(route.fullPath!=='/home'){
|
let visitedViews = await TagsViewStore.delAllViews()
|
||||||
TagsViewStore.delAllViews()
|
toLastView(visitedViews,route)
|
||||||
}
|
|
||||||
router.push('/')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const routerGo = (tag) => {
|
const routerGo = (tag) => {
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import externalLink from './modules/externalLink'
|
||||||
* meta ==> 路由元信息
|
* meta ==> 路由元信息
|
||||||
* meta.title ==> 路由标题
|
* meta.title ==> 路由标题
|
||||||
* meta.icon ==> 菜单icon
|
* meta.icon ==> 菜单icon
|
||||||
|
* meta.affix ==> 如果设置为true将会出现在 标签栏中
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const constantRoutes: Array<RouteRecordRaw&extendRoute> = [
|
export const constantRoutes: Array<RouteRecordRaw&extendRoute> = [
|
||||||
|
|
|
||||||
|
|
@ -47,10 +47,10 @@ export const useTagsViewStore = defineStore({
|
||||||
delVisitedView(view){
|
delVisitedView(view){
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
this.visitedViews = this.visitedViews.filter(v=>{
|
this.visitedViews = this.visitedViews.filter(v=>{
|
||||||
return v.path !== view.path
|
return (v.path !== view.path||v.meta.affix)
|
||||||
})
|
})
|
||||||
this.cachedViews = this.cachedViews.filter(v=>{
|
this.cachedViews = this.cachedViews.filter(v=>{
|
||||||
return v.path !== view.path
|
return (v.path !== view.path||v.meta.affix)
|
||||||
})
|
})
|
||||||
resolve([...this.visitedViews])
|
resolve([...this.visitedViews])
|
||||||
})
|
})
|
||||||
|
|
@ -69,8 +69,9 @@ export const useTagsViewStore = defineStore({
|
||||||
},
|
},
|
||||||
delAllViews(){
|
delAllViews(){
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
this.visitedViews = []
|
this.visitedViews = this.visitedViews.filter(v=>v.meta.affix)
|
||||||
this.visitedViews = []
|
console.log('===============',this.visitedViews)
|
||||||
|
this.cachedViews = this.visitedViews.filter(v=>v.meta.affix)
|
||||||
resolve([...this.visitedViews])
|
resolve([...this.visitedViews])
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { defineConfig,ConfigEnv, UserConfig } from 'vite'
|
import { defineConfig,ConfigEnv, UserConfig,loadEnv } from 'vite'
|
||||||
|
// vite.config.ts中无法使用import.meta.env 所以需要引入
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
// import AutoImport from 'unplugin-auto-import/vite'
|
// import AutoImport from 'unplugin-auto-import/vite'
|
||||||
// import Components from 'unplugin-vue-components/vite'
|
// import Components from 'unplugin-vue-components/vite'
|
||||||
|
|
@ -75,9 +76,9 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
|
||||||
},
|
},
|
||||||
// 生产环境打包配置
|
// 生产环境打包配置
|
||||||
//去除 console debugger
|
//去除 console debugger
|
||||||
esbuild: {
|
// esbuild: {
|
||||||
pure:mode==='production' ? ["console.log", "debugger"] : []
|
// pure:mode==='production' ? ["console.log", "debugger"] : []
|
||||||
},
|
// },
|
||||||
|
|
||||||
// build: {
|
// build: {
|
||||||
// terserOptions: {
|
// terserOptions: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue