Giter Club home page Giter Club logo

un-pany / v3-admin-vite Goto Github PK

View Code? Open in Web Editor NEW
4.0K 32.0 708.0 40.4 MB

☀️ A vue3 admin template | vue3 admin/element plus admin/vite admin/vue3 template/vue3 后台/vue3 模板/vue3 后台管理系统

Home Page: https://un-pany.github.io/v3-admin-vite

License: MIT License

HTML 0.23% Vue 53.46% TypeScript 36.62% JavaScript 1.16% SCSS 3.04% CSS 5.47% Shell 0.03%
vue3 element-plus pinia vite typescript admin vue3-admin sass vue-router axios

v3-admin-vite's Introduction

V3 Admin Vite Logo

V3 Admin Vite

English | 中文

⚡ Introduction

V3 Admin Vite is a free and open source middle and background management system basic solution, based on mainstream framework such as Vue3, TypeScript, Element Plus, Pinia and Vite

China repository: Gitee

📚 Document

  • Chinese documentation: link
  • Chinese getting started tutorial: link

📺 Online preview

Location account Link
github-pages admin or editor link

❤️ Generate electricity with love

  • Completely free:But hopefully you order a star !!!
  • Very concise:No complicated encapsulation, no complicated type gymnastics, out of the box
  • Detailed annotations:Each configuration item is written with as detailed comments as possible
  • Latest dependencies: Regularly update all third-party dependencies to the latest version
  • Very specification: The code style is unified, the naming style is unified, and the comment style is unified

Feature

  • Vue3:The latest Vue3 composition API using Vue3 + script setup
  • Element Plus:Vue3 version of Element UI
  • Pinia: An alternative to Vuex in Vue3
  • Vite:Really fast
  • Vue Router:router
  • TypeScript:JavaScript With Syntax For Types
  • PNPM:Faster, disk space saving package management tool
  • Scss:Consistent with Element Plus
  • CSS variable:Mainly controls the layout and color of the item
  • ESlint:Code verification
  • Prettier: Code formatting
  • Axios: Promise based HTTP client (encapsulated)
  • UnoCSS: Real-time atomized CSS engine with high performance and flexibility
  • Mobile Compatible: The layout is compatible with mobile page resolution

Functions

  • User management: Log in and out of the demo
  • Authority management: Page-level permissions (dynamic routing), button-level permissions (directive permissions, permission functions), and route navigation guards
  • Multiple Environments: Development, Staging, Production
  • Multiple themes: Normal, Dark, Dark Blue, three theme modes
  • Multiple layouts:Left, Top, Left Top, three layout modes
  • Error page: 403, 404
  • Dashboard: Display different Dashboard pages according to different users
  • Other functions:SVG, Dynamic Sidebar, Dynamic Breadcrumb Navigation, Tabbed Navigation, Screenfull, Adaptive Shrink Sidebar, Hook (Composables)

🚀 Development

# configure
1. installation of the recommended plugins in the .vscode directory
2. node version 18.x or 20+
3. pnpm version 8.x or latest

# clone
git clone https://github.com/un-pany/v3-admin-vite.git

# enter the project directory
cd v3-admin-vite

# install dependencies
pnpm i

# start the service
pnpm dev

✔️ Preview

# stage environment
pnpm preview:stage

# prod environment
pnpm preview:prod

📦️ Multi-environment packaging

# build the stage environment
pnpm build:stage

# build the prod environment
pnpm build:prod

🔧 Code inspection

# code formatting
pnpm lint

# unit test
pnpm test

Git commit specification reference

  • feat add new functions
  • fix Fix issues/bugs
  • perf Optimize performance
  • style Change the code style without affecting the running result
  • refactor Re-factor code
  • revert Undo changes
  • test Test related, does not involve changes to business code
  • docs Documentation and Annotation
  • chore Updating dependencies/modifying scaffolding configuration, etc.
  • workflow Work flow Improvements
  • ci CICD
  • types Type definition
  • wip In development

Project preview

preview1.png preview2.png preview3.png

💕 Contributors

Thanks to all the contributors!

💕 Thanks star

Small projects are not easy to get a star, if you like this project, welcome to support a star! This is the only motivation for the author to maintain it on an ongoing basis (whisper: it's free after all)

☕ Donate

See how to donate

Group

QQ group:1014374415 (left) && add me on WeChat,Invite you to join WeChat group (right)

qq.png wechat.png

📄 License

MIT

Copyright (c) 2022-present pany

v3-admin-vite's People

Contributors

aaron-zon avatar allihol avatar azronchan avatar betterwusy avatar chilfish avatar cilliandevops avatar greasen avatar gzbox avatar havoczhang avatar heavenly-zy avatar imaginarykhy avatar imarman avatar jds-jh avatar jiangyitao avatar kellercai avatar moon-in-river avatar nevlf avatar pany-ang avatar pddzl avatar qc2168 avatar qppq54s avatar sunny-117 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

v3-admin-vite's Issues

❤️ Awesome Project

如果你或你所在的团队正在使用 V3 Admin / V3 Admin Vite 或对应的 Electron 版,欢迎你和团队在这里留言合影~

如果你基于我的项目进行二次开发,欢迎你贴出你的链接,供大家学习参考。

If you or your team is using V3 Admin / V3 Admin Vite or the corresponding Electron version, you are welcome to leave a message and take a photo with your team here~

If you are doing secondary development based on my project, you are welcome to post your link for everyone to learn and reference.

🔧 维护计划

不一定全都要实现,因为还是想继续将这个项目定义为最小的后台管理系统(方便大家在此基础上做加法进行二开)解决方案,所以不会添加太多功能进去

Routine

  • 同步升级所有第三方依赖

Easy

  • 系统配色优化(主要是左侧导航菜单)
  • 头像右侧显示用户名,以及优化一下对应的下拉框 UI
  • 首页开发(新增一些漂亮的图表)
  • 404、403 页面优化
  • 权限管理页面布局优化
  • 登录页布局优化
  • 新增表格 CRUD 页面
  • 新增一些常见功能示例(文件下载、打印、文件预览、富文本等)
  • 新增 src/config/layout 配置项缓存功能
  • 路由的 icon 配置项支持 Element Plus 的 Icon
  • 完善中文文档(已新增针对新手的手摸手教程)
  • 新增英文文档
  • 新增英文 README
  • 新 Logo 设计
  • keep alive 缓存
  • 消息通知功能
  • 内容区全屏
  • 灰色模式 & 色弱模式
  • Axios 响应数据支持通过泛型推导
  • 优化 createRequest 方法,防止 headers 默认配置被完全覆盖
  • 优化路由白名单判断规则
  • 新增标签栏缓存功能
  • 新增可开关的 Footer 页脚
  • 新增可开关的全局水印
  • 可拖拽动态改变宽度的左侧菜单
  • 动态浏览器 Title

Medium

  • 新增大屏可视化示例页面
  • 新增后端返回动态路由功能(配套用户、角色、权限管理三个页面)
  • 新增不同的 layout 一键切换(左侧模式、顶部模式、混合模式)
  • 混合布局模式新增分割菜单功能(顶部展示一级菜单,侧边展示二级及其以上菜单)
  • 左侧布局模式新增分割菜单功能(左侧展示一级菜单,面板内展示二级及其以上菜单)
  • 新增菜单搜索功能
  • 三级路由缓存功能
  • 深度优化所有代码(已在 v4.0.0 版本上线)
  • 炫酷锁屏
  • 将 TagsView 组件内的方法提取至 hook,并支持手动修改 title(#70
  • 国际化

Hard

  • 给出一个更加简洁的版本(移除:多主题、多布局、权限)

项目启动失败,控制台报错

按照文档提示安装相关依赖,启动程序时会报错
Uncaught SyntaxError: Unexpected reserved word __uno.css:15

pnpm版本是8.6.6
node版本 18.16.0
执行pnpm i 依赖安装正常,没有问题

vue-router编译后chunk文件路径404问题

这个问题在vue2中也会出现,由于使用了懒加载的问题,所以用户已经在A页面使用,同时前端资源重新发布了一个新的版本,因为B页面代码有所改动导致js的hash值变化,这个时候,用户切换页面到B页面会出现资源加载404的问题。

解决:之前的解决方式是前端在router.error中判断404的问题,并主动刷新页面重新加载最新资源。个人觉得有点风险。请教一下从前端的角度有无更好的方式呢?
image

打包的时候提示这个

NODE_ENV=production is not supported in the .env file. Only NODE_ENV=development is supported to create a development build of your project. If you need to set process.env.NODE_ENV, you can set it in the Vite config instead

搜了一下,有的文说是vite要降级到3版本,有没有什么正常的解决办法?

近期 API 服务不太稳定,已切换新服务

旧地址像下面这样修改登录模块的这两个接口即可模拟登录:

/** 登录并返回 Token */
export function loginApi(data: Login.LoginRequestData) {
  // return request<Login.LoginResponseData>({
  //   url: "users/login",
  //   method: "post",
  //   data
  // })
  return {
    code: 0,
    data: { token: "xxx" },
    message: "登录成功"
  }
}
/** 获取用户详情 */
export function getUserInfoApi() {
  // return request<Login.UserInfoResponseData>({
  //   url: "users/info",
  //   method: "get"
  // })
  return {
    code: 0,
    data: {
      username: "xxx",
      roles: []
    },
    message: "获取用户详情成功"
  }
}

打包失败

复现 将下面代码粘到 login.vue 或者其他vue 文件中,运行 build 命令 会失败
`

Default
With shortcuts
<script lang="ts" setup> import { ref } from 'vue' const value1 = ref([ new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10), ]) const value2 = ref('') const shortcuts = [ { text: 'Last week', value: () => { const end = new Date() const start = new Date() start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) return [start, end] }, }, { text: 'Last month', value: () => { const end = new Date() const start = new Date() start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) return [start, end] }, }, { text: 'Last 3 months', value: () => { const end = new Date() const start = new Date() start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) return [start, end] }, }, ] </script> <style scoped> .block { padding: 30px 0; text-align: center; border-right: solid 1px var(--el-border-color); flex: 1; } .block:last-child { border-right: none; } .block .demonstration { display: block; color: var(--el-text-color-secondary); font-size: 14px; margin-bottom: 20px; } </style>

错误src/views/dashboard/index.vue:5:7 - error TS2322: Type '{ toString: () => string; toDateString: () => string; toTimeString: () => string; toLocaleString: { (): string; (locales?: string | string[] | undefined, options?: DateTimeFormatOptions | undefined): string; (locales?: LocalesArgument, options?: DateTimeFormatOptions | undefined): string; }; ... 39 more ...; [Symbol...' is not assignable to type 'EpPropMergeType<(new (...args: any[]) => ModelValueType & {}) | (() => ModelValueType) | ((new (...args: any[]) => ModelValueType & {}) | (() => ModelValueType))[], unknown, unknown> | undefined'.
Type '{ toString: () => string; toDateString: () => string; toTimeString: () => string; toLocaleString: { (): string; (locales?: string | string[] | undefined, options?: DateTimeFormatOptions | undefined): string;
(locales?: LocalesArgument, options?: DateTimeFormatOptions | undefined): string; }; ... 39 more ...; [Symbol...' is not assignable to type '[DateModelType, DateModelType]'.
Target requires 2 element(s) but source may have fewer.

5 v-model="value1"
~~~~~~~`

编译失败

1、版本:
node: v16.15.1
pnpm: 7.5.0

2、复现路径:
pnpm build

3、报错如下图:
image

transition

页面切换动画后半段比较生硬

模板

您好,能提供一个简洁点的模板吗?

☕ Donate 捐赠

If this project is helpful to you, you can buy the author a cup of coffee!

如果这个项目对你有帮助,你可以请作者喝杯咖啡!

Donate

麻烦帮忙看下这个问题

error.ts:14 ElementPlusError: [ElPagination] 你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档
at debugWarn (error.ts:13:37)
at Proxy. (pagination.ts:203:9)
at renderComponentRoot (runtime-core.esm-bundler.js:914:44)
at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5649:57)
at ReactiveEffect.run (reactivity.esm-bundler.js:190:25)
at instance.update (runtime-core.esm-bundler.js:5763:56)
at setupRenderEffect (runtime-core.esm-bundler.js:5777:9)
at mountComponent (runtime-core.esm-bundler.js:5559:9)
at processComponent (runtime-core.esm-bundler.js:5517:17)
at patch (runtime-core.esm-bundler.js:5119:21)

这个是控制台输出的,我也不太懂前端。

Cannot find module 'unplugin-vue-define-options/vite' or its corresponding type declarations

如果出现类似报错:Cannot find module 'xxx/vite' or its corresponding type declarations

是因为 v3-admin-vite v3.3.4 及其以下版本依赖的 ts 版本小于 5(马上发版的 v3.4.0 依赖的 ts 大于 5),但是最新版 vscode 内置的 ts 版本大于 5,这时候 vscode 默认是使用的内置 ts 版本,你可以手动在右下角切换:

ts 版本

切换 ts 版本

这样确保项目依赖的 ts 版本和实际使用的一致,就没问题了

三级路由keepAlive缓存问题

您好:
非常感谢您这个非常棒的开源项目,本人在table部分keepAlive是成功的,但如果是三级及三级以上使用keepAlive确是失效的,麻烦有空看看?

toggle tabs issue

When the tabs more than the screen width, it cannot auto scoll to that tab after you click the menu which is hidden.

tab toogle issue

Should like this:
image

[bug report] router switch error

When the component has mutiple root, the component can't be animated that target compontent can't be displayed(blank content).

image
image

vue3的报错,打开控制台会出现奇怪断点

使用vue3的时候经常会出现一种情况,语法写法没问题,但是打开控制台就会出现奇怪断点,点击继续运行却没有报错
async function waitForDomElementReady() { try { return await waitFor(() => { let mainText = getMainText(document.body); if (mainText && mainText.length >= 10) return !0; throw new Error("there is no main text"); }, { timeout: 1e4 }), !0; } catch (e3) { throw e3; } }
在throw new Error("there is no main text");这行

[bug] 自定义主题时,切换到深蓝模式后,primary样式没有覆盖完成

自定义样式

@forward 'element-plus/theme-chalk/src/common/var.scss' with (
  $colors: (
    'primary': (
      'base': #ffbf13,  // 黄色
    ),
  ),
  $font-size : (
    'base' : 12px
  ),
);

切换到深蓝模式后,hover 按钮时应用了自定义样式:

没有自定义样式时,深蓝皮肤hover时也没有应用到定义的primary样式:

bug原因是,深蓝模式下,没有完全覆盖原本的 primary样式,只是重写了--el-color-primary,还有--el-color-primary-light-x 没有覆盖,如果需要我可以提供pr

设置一个详情页keepAlive缓存,打开多个详情页。关闭其中一个,其它的详情页面会刷新

例如我配置一个路由设置keepAlive为true,这里跳转详情页面会根据id的不同创建新的tag页
image

并在页面设置相同的name
image

如果是点击关闭其它的页面,上面配置的这个详情页面都是正常的,切换过去并不会刷新。
但是,点击关闭 详情A页面,详情B页面 就会刷新,导致 详情B页面 之前输入的内容被清空,页面也重新加载页面、接口了。
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.