Pure Admin Vue Dashboard Template

repository·main·Indexed 12 days ago

https://github.com/pure-admin/vue-pure-admin

A Vue-based administrative dashboard template. Version 7.0.0 features an ESM-only architecture, RBAC permission control, and a comprehensive set of UI components including ReCountTo for number animations, ReDialog for functional pop-ups, and advanced table features via @pureadmin/table. Supports JSON-based form generation, dynamic routing cache management, and a flexible menu configuration system.

Tokens
21.3K
Snippets
88
Records
134
Agent score
97%

What's inside Pure Admin

  1. Use RBAC permission control modes

    main

    As of version 3.6.0, the permission module uses Role-Based Access Control (RBAC). Button permissions support three distinct operation modes:

    1. Component mode: Judging permissions directly within Vue components.
    2. Function mode: Judging permissions via function calls.
    3. Instruction mode: Judging permissions using directives.
  2. Manage dynamic routing cache in development

    main
    In version 3.9.7, CachingAsyncRoutes (the dynamic routing cache) was disabled by default in local development environments to simplify debugging. When modifying dynamic routes, you no longer need to manually clear the local cache. However, it is recommended to enable this feature in production environments for better performance.
  3. Implement RBAC permission control

    main

    Starting from version 3.6.0, the permission module uses the RBAC (Role-Based Access Control) model. The hierarchy is: User -> Role -> Permission.

    Button permissions support three distinct operation modes:

    1. Component mode: Determining permissions via Vue components.
    2. Function mode: Determining permissions via logic functions.
    3. Directive mode: Determining permissions via custom directives.
  4. Use kebab-case for globally registered components in TSX

    main
    As of version 7.0.0, global type declarations have been refactored to include a PascalCase to kebab-case type mapping. This allows you to use kebab-case syntax for globally registered components while still receiving full type hints when working in TSX.
  5. Upgrade to v5.0.0 ESM version

    main

    Version 5.0.0 introduced a complete transition to ESM (ES Modules). Key changes for developers include:

    • Node.js Requirement: Must be >18.18.0.
    • Package Manager: pnpm version >=8.6.10 is required.
    • Mocking Tools: vite-plugin-mock has been replaced by vite-plugin-fake-server, and mockjs has been replaced by @faker-js/faker.
    • Configuration Files: The following files have been updated to ESM syntax:
      • tailwind.config.ts (renamed from .js)
      • .prettierrc.js
      • postcss.config.js
      • commitlint.config.js
      • eslint.config.js (replacing .eslintrc.js)
      • stylelint (upgraded to v16 with ESM support)
    • Iconography: All search icons are unified to @iconify-icons/ri/search-line and included in global offline icons.
    # Required versions
    node > 18.18.0
    pnpm >= 8.6.10
  6. Migrate to v7.0.0 breaking changes

    main

    Version 7.0.0 introduces several significant refactors and dependency upgrades that may require manual updates to your implementation:

    • Global Configuration: The ShowModel key in platform-config.json has been renamed to TagsStyle to better reflect its semantic purpose.
    • Router Navigation: In vue-router navigation guards, use return statements instead of the deprecated next() function.
    • Dependency Upgrades:
      • vite is upgraded to v8 (using Rolldown and Oxc).
      • typescript is upgraded to v6.
      • eslint is upgraded to v10.
      • stylelint is upgraded to v17.
    • Component Types: Global component registration now supports kebab-case in TSX with full type hints due to a new PascalCase to kebab-case type mapping.
    • Removed from CDN: pinia and vue-demi have been removed from CDN mode.
  7. Migrate to @pureadmin/utils for tools and hooks

    main

    Starting from version 3.3.0 (excluding 3.3.0 itself), most utility functions and Vue hooks in vue-pure-admin have been moved to a dedicated package: @pureadmin/utils.

    If you are using a newer version of vue-pure-admin, you should install and use @pureadmin/utils directly instead of looking for these utilities within the main repository. This ensures you are using the most up-to-date and optimized versions of the tools and hooks.

    npm install @pureadmin/utils
  8. Activate menu items using activePath in route meta

    main

    In version 4.4.0, the route meta object was updated to include an activePath attribute. This is specifically useful for routes that pass parameters via query or params and have showLink: false configured (meaning they don't appear directly in the menu). By setting activePath to the path of the desired active menu item, you can ensure the correct menu item is highlighted even when the current route is a child or a parameter-based route not explicitly listed in the menu configuration.

    // Example route meta configuration
    { 
      path: '/some-param-route', 
      meta: { 
        showLink: false, 
        activePath: '/target-menu-path' 
      } 
    }