Code Monkey home page Code Monkey logo

antdv-pro's Introduction

VbenAdmin Logo

Antdv Pro

gitee github

English | 简体中文

Introduction

AntdvPro is a complete set of enterprise-level mid-backend front-end/design solutions based on Vue3, Vite4, ant-design-vue4, Pinia, UnoCSS and Typescript. It refers to the design pattern of Ali react version antd-pro, using the latest and most popular The front-end technology stack has built-in dynamic routing, multi-theme, multi-layout and other functions, which can help you quickly build enterprise-level mid-background product prototypes.

Features

  • pnpm: Using the latest pnpm as a package management tool, it can greatly reduce the size of node_modules, speed up the installation speed of packages, and can also share dependencies to reduce disk usage.
  • vite: vite as a front-end development tool, it can greatly speed up the start-up speed of the project, and also supports hot updates, which can greatly improve development efficiency.
  • vue3: vue3.3.x as the front-end framework, the basic code is written in script-setup, with less code and low maintenance cost.
  • nitro mock: Use nitro as the server's mock data, decoupled from the project, and more flexible and easy to use.
  • ant-design-vue4: ant-design-vue4 as the UI framework, the author of admin-pro is also a core member of ant-design-vue, which can provide long-term maintenance support.
  • pinia: pinia as a state management tool, it can greatly improve the readability and maintainability of the code, and also supports Typescript.
  • UnoCSS: Atomic CSS framework, reduce the troubles caused by thinking about some common class names, and improve our development efficiency.
  • Code specification: We have encapsulated a set of eslint-based code specification configuration files, which can be used out of the box to unify the problems brought by different teams.
  • Theme: The design specifications of antd-pro of the react version are used, and a set of theme modes based on vue are developed. On this basis, some new functions are added to meet various different needs as much as possible.
  • Request function: Based on axios, a set of request functions with complete types and some basic interceptor encapsulations are encapsulated. You only need to make corresponding implementation adjustments according to the requirements to meet the different needs of various projects.
  • Mobile compatibility: We have tried our best to make the basic framework compatible with the mobile terminal mode, but because our main goal is the enterprise-level mid-background product, we have not made too much adaptation to the mobile terminal. If your project needs to adapt to the mobile terminal, you can refer to our code for corresponding adjustments.

Preview

antdv-pro - Test Account: admin/admin

antdv-pro-docs - Documentation

Community

QQ Group: apply wechat group

Wechat: aibayanyu2022

Discord: discord

WeChatGroup (二群扫码)

Antdv 小助手微信回复【101】邀请进一群

Useage

# Install degit
npm  i -g degit

# Pull the code
degit antdv-pro/antdv-pro [your project name]

#  Switch to the project directory
cd [your project name]

# Install
pnpm install

# Development
pnpm dev

Contribute

We are very welcome to have you participate in our open source project.

Pull Request:

  1. Fork code!
  2. Create your own branch: git checkout -b feat-xxxx
  3. Submit your changes: git commit -am 'feat(function): add xxxxx'
  4. Push your branch: git push origin feat-xxxx
  5. submitpull request

Thank you to all the people who already contributed to antdv-pro!

Support

If you like our project, you can support us by clicking the "Star" button in the upper right corner. Your support is my motivation. Thank you ~

Thanks to the open source project license provided by Jetbrains.

Sponsor

If you like our project, you can sponsor us to help us maintain the project better.

Alipay/Wechat

antdv-pro's People

Contributors

246859 avatar adekang avatar aibayanyu20 avatar alkaidcc avatar ashu-guo avatar autismsuperman avatar copofe avatar havoczhang avatar jiabochao avatar kai2128 avatar kaivanwong avatar kirklin avatar kovsu avatar liosummer avatar mynetfan avatar selicens avatar spectature avatar sun1090 avatar windlil avatar xoxosos avatar yizhankui avatar ziggszhao 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

antdv-pro's Issues

i18n规则中包含@符号导致控制台报错

Issue 描述:

在编写 i18n 国际化规则时,发现如果语句中包含 "@" 符号,会导致控制台报错。
创建一个包含 "@" 符号的 i18n 规则,例如:

{
  "error_message": "发生了一个@错误"
}

在应用中触发使用该 i18n 规则的场景,比如显示错误提示。

预期行为:

预期应用能够正确读取 i18n 规则中包含 "@" 符号的文本,并在界面上展示对应的翻译文本,而不会导致控制台报错。

实际行为:

当前应用在加载包含 "@" 符号的 i18n 规则时,控制台报告错误,可能类似如下的错误信息:
c5f99e49d44561e8ff76cd28ba71812

新功能

image
能支持这种导航菜单吗 顶部是1级左侧是2级的
还有希望能支持导航栏添加外链

翻页问题

在启用 pagination以后,total等设置ref的值,再次跳转别的菜单会报错,抱歉,由于个人原因未能够提供模拟数据
const pagination = computed(() => ({ total: 200, // total:total.value current:1, pageSize: 10, }));

报错:
[Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core at <RouterView> at <AWatermark h-full="" flex="" flex-col="" ... > at <Anonymous hasSider=undefined prefixCls="ant-layout-content" tagName="main" ... > at <ALayoutContent ref="layoutRef" class="ant-pro-basicLayout-content" flex="" ... > at <Anonymous hasSider=undefined prefixCls="ant-layout" tagName="section" > at <ALayout> at <Anonymous hasSider=undefined prefixCls="ant-layout" tagName="section" >

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'subTree') at getNextHostNode (runtime-core.esm-bundler.js:6319:46) at getNextHostNode (runtime-core.esm-bundler.js:6319:14) at getNextHostNode (runtime-core.esm-bundler.js:6319:14) at getNextHostNode (runtime-core.esm-bundler.js:6319:14) at getNextHostNode (runtime-core.esm-bundler.js:6319:14) at getNextHostNode (runtime-core.esm-bundler.js:6319:14) at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5779:11) at ReactiveEffect.run (reactivity.esm-bundler.js:178:19) at instance.update (runtime-core.esm-bundler.js:5814:51) at callWithErrorHandling (runtime-core.esm-bundler.js:158:32)

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'parentNode') at getPopupContainer (Options.js:123:59) at createVNode.getContainer (Trigger.js:665:51) at getParent3 (PortalWrapper.js:24:14) at PortalWrapper.js:145:25 at runtime-core.esm-bundler.js:2675:88 at callWithErrorHandling (runtime-core.esm-bundler.js:158:18) at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:166:17) at hook.__weh.hook.__weh (runtime-core.esm-bundler.js:2655:19) at invokeArrayFns (shared.esm-bundler.js:77:10) at unmountComponent (runtime-core.esm-bundler.js:6289:7)

启动问题

pnpm dev 启动后访问报错
image

进入servers目录后执行 pnpm run dev
等待一会自动执行成功了

image

菜单展开和关闭图标貌似反了

B站刷到过来看看,不怎么熟悉PR,就提issues吧。
如题,按钮点击的应该是预期行为,所以关闭的时候应该展示展开的按钮,展开的时候应该展示关闭的按钮。
unfold和fold
另外这两个图标的大小也不一致,一个14另一个是16

切换导航模式,控制台抛出key重复的警告

问题:

  1. 切换导航模式为“顶部布局模式时
    image

  2. 切换导航模式为“混合布局模式“,并且选中”自动分割菜单“时
    image

原因:

在顶部展示menu时,只有在Menu 水平空间不足时才会出现上述问题。

  1. 在template中使用v-bind:key时,传递给sub-menu组件的key都是0
<template v-for="item in selectedMenus" :key="item.path">
      <template v-if="!item.hideInMenu">
        <SubMenu :item="item" />
      </template>
</template>

image

  1. v-for遍历template,在sub-menu组件中传递
<template v-for="item in selectedMenus">
      <template v-if="!item.hideInMenu">
        <SubMenu :item="item"  :key="item.path"/>
      </template>
</template>

image

虽然修改传递key给子组件来解决问题,但是我发现官方建议是是在template中传递key,而不是在子组件中传递:

https://eslint.vuejs.org/rules/no-v-for-template-key-on-child.html

https://v3-migration.vuejs.org/breaking-changes/key-attribute.html#with-template-v-for

新功能征集!!!

如果大家在使用的过程中感觉某个功能可能会比较通用或者有自己的一些需求,您可以在下面进行留言,我们会进行确认需求的可行性和通用性,会逐步的为我们的开源项目新增一些常用的功能。

提交模板:

功能简述:可编辑表格功能
功能描述:希望新增可编辑表格的演示功能....(会优先考虑描述详细且合理的需求)

需求列表

需求认领

参考演示站点

如果你想开发其中某一个功能,请在下方评论认领功能例如多功能表格:

  • 多功能表格示例

认领后我会将当前的功能分发给你,请尽量在两周内完成,如果长时间完不成我们将会对任务进行二次分发

主题色配置后 很多场景 配置色并未同步修改

主题色配置后 很多场景 配置色并未同步修改
目前已发现的有:
1、首屏加载的loading 图标的颜色 还是蓝色
2、a-button type为link状态时 颜色还是蓝色 应该还有其他类似问题 有时间可以一同检查一下
辛苦啦

【募集-新功能】动画效果动态配置

新增动画效果可动态配置功能,需要再功能设置按钮中实现该功能。
image
放到内容区域。

在app.ts中新增animationlayout属性,用于动态控制动画效果。

考虑在config/default-setting.ts中存放导出animationList来存放所有动画列表

在assets/styles/motion.css中添加动画效果

设置布局时还是会占用元素宽度

效果:

如下是设置的:
{"title":"Antdv Pro","theme":"inverted","logo":"/logo.svg","collapsed":false,"drawerVisible":true,"colorPrimary":"#1677FF","layout":"side","contentWidth":"Fluid","fixedHeader":true,"fixedSider":false,"splitMenus":false,"header":true,"menu":false,"menuHeader":false,"footer":false,"colorWeak":false,"multiTab":false,"multiTabFixed":false,"keepAlive":true,"accordionMode":false,"headerHeight":48,"copyright":"Antdv Pro Team 2023","animationName":"slide-fadein-right"}

Dynamic route with params issues 带参数的动态路由问题

When I set the routing path as a dynamic route with parameters
当我把路由路径设置成带参数的动态路由时

path: '/app/edit/:id'

The changeMenu method in layout-menu.ts is matched based on route.path, which causes the actual path /app/edit/1 not to match /app/edit:id
layout-menu.ts里的changeMenu方法是根据route.path来匹配的,这样会导致实际的路径/app/edit/1匹配不上/app/edit:id

It then fails to update selectedKeys, causing the page title and breadcrumbs to display incorrectly
然后就无法更新selectedKeys,导致页面title和面包屑显示错误

执行打包命令时报错

src/components/base-loading/index.vue:46:11 - error TS2322: Type 'Element' is not assignable to type 'ReactNode'.
  Type 'Element' is not assignable to type 'ReactPortal'.
    Types of property 'key' are incompatible.
      Type 'string | number | symbol | null' is not assignable to type 'Key | null'.
        Type 'symbol' is not assignable to type 'Key | null'.

46           <div class="loading-wrapper">
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47             {renderBasicLoading() }
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48           </div>
   ~~~~~~~~~~~~~~~~

src/components/base-loading/index.vue:47:13 - error TS2322: Type 'VNode<RendererNode, RendererElement, { [key: string]: any; }>' is not assignable to type 'ReactNode'.
  Type 'VNode<RendererNode, RendererElement, { [key: string]: any; }>' is not assignable to type 'ReactPortal'.
    Types of property 'key' are incompatible.
      Type 'string | number | symbol | null' is not assignable to type 'Key | null'.

47             {renderBasicLoading() }
               ~~~~~~~~~~~~~~~~~~~~~~~

  ../../../node_modules/@types/react/index.d.ts:1386:9
    1386         children?: ReactNode | undefined;
                 ~~~~~~~~
    The expected type comes from property 'children' which is declared here on type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'

src/components/base-loading/index.vue:49:11 - error TS2322: Type 'Element' is not assignable to type 'ReactNode'.

49           <div class="text" style={{ color: textColor }}>
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50               {text}
   ~~~~~~~~~~~~~~~~~~~~
51             </div>
   ~~~~~~~~~~~~~~~~~~

src/components/base-loading/index.vue:49:16 - error TS2322: Type '{ children: string; class: string; style: { color: string; }; }' is not assignable to type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'.
  Property 'class' does not exist on type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'. Did you mean 'className'?

49           <div class="text" style={{ color: textColor }}>
                  ~~~~~


Found 4 errors in the same file, starting at: src/components/base-loading/index.vue:46

复现步骤:

  1. 切换到main分支
  2. 执行:npm run build

解决方案:

修改tsconfig.json,添加:

 "jsxImportSource": "vue",

似乎Typescript编译TSX时将模板认为是ReactNode,官方文档上有提到JSX 类型推断。但是全局搜了下,并没有依赖react。所以并不太清楚是什么原因导致的打包失败

谁在用Antdv Pro

如果你的公司或者个人的开源项目有在使用我们的项目做为基础框架进行二次开发,
您这里在这里留下使用过的脚印

  • 【公司名称或开源项目名称】
  • 【应用项目介绍】
  • 【如果允许可以公开官网地址】

【优化】多页签优化

监听路由变化在multi-tab和menu别用watch,用发布订阅模式在路由router.beforeEach这里添加一个,性能会高一些

base-loading 样式错位

image

原因:

 <div
          style={modal ? { background } : {}}
          class={{ 'loading-container': true, 'is-fullscreen': full }}
        >
          <div class="loading-wrapper">
            {renderBasicLoading() }
          </div>
          <div class="text" style={{ color: textColor }}>
              {text}
          </div>
</div>
.loading-wrapper {
    position: absolute;
    top: 50%;
    width: 100%;
    margin-top: -21px;
    text-align: center;

    .text {
      width: 100%;
      margin: 8px 0;
    }

    .loading-icon {
      animation: rotating 1.5s linear infinite;
    }
  }

css层级不正确,导致样式未添加成功

Ignore "components.d.ts" in Git Repository

Issue Description:
Currently, the "components.d.ts" file is being tracked in the Git repository. However, this file should not be included in version control, as it's generated or specific to individual development environments. To maintain a clean and consistent repository, we need to add the "components.d.ts" file to the so that it won't be tracked by Git..gitignore

Steps to Resolve:

Modify the file located at the root of the repository..gitignore
Add an entry for the "components.d.ts" file to the file..gitignore
Commit the changes to the file..gitignore
Ensure that the "components.d.ts" file is no longer tracked by Git and will not appear in future commits.
Additional Information:
Ignoring auto-generated or environment-specific files in version control helps prevent unnecessary clutter and potential conflicts. It's essential to keep the repository clean and focused on the actual source code and project-related assets.

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.