mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	Merge branch 'main' into pages
This commit is contained in:
		
						commit
						bf0d7dd060
					
				
							
								
								
									
										1
									
								
								.vscode/extensions.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.vscode/extensions.json
									
									
									
									
										vendored
									
									
								
							@ -1,6 +1,7 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "recommendations": [
 | 
					  "recommendations": [
 | 
				
			||||||
    "christian-kohler.path-intellisense",
 | 
					    "christian-kohler.path-intellisense",
 | 
				
			||||||
 | 
					    "warmthsea.vscode-custom-code-color",
 | 
				
			||||||
    "vscode-icons-team.vscode-icons",
 | 
					    "vscode-icons-team.vscode-icons",
 | 
				
			||||||
    "davidanson.vscode-markdownlint",
 | 
					    "davidanson.vscode-markdownlint",
 | 
				
			||||||
    "ms-azuretools.vscode-docker",
 | 
					    "ms-azuretools.vscode-docker",
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										24
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							@ -31,11 +31,18 @@
 | 
				
			|||||||
  "i18n-ally.keystyle": "nested",
 | 
					  "i18n-ally.keystyle": "nested",
 | 
				
			||||||
  "i18n-ally.sortKeys": true,
 | 
					  "i18n-ally.sortKeys": true,
 | 
				
			||||||
  "i18n-ally.namespace": true,
 | 
					  "i18n-ally.namespace": true,
 | 
				
			||||||
  "i18n-ally.enabledParsers": ["yaml", "js"],
 | 
					  "i18n-ally.enabledParsers": [
 | 
				
			||||||
 | 
					    "yaml",
 | 
				
			||||||
 | 
					    "js"
 | 
				
			||||||
 | 
					  ],
 | 
				
			||||||
  "i18n-ally.sourceLanguage": "en",
 | 
					  "i18n-ally.sourceLanguage": "en",
 | 
				
			||||||
  "i18n-ally.displayLanguage": "zh-CN",
 | 
					  "i18n-ally.displayLanguage": "zh-CN",
 | 
				
			||||||
  "i18n-ally.enabledFrameworks": ["vue"],
 | 
					  "i18n-ally.enabledFrameworks": [
 | 
				
			||||||
  "iconify.excludes": ["el"],
 | 
					    "vue"
 | 
				
			||||||
 | 
					  ],
 | 
				
			||||||
 | 
					  "iconify.excludes": [
 | 
				
			||||||
 | 
					    "el"
 | 
				
			||||||
 | 
					  ],
 | 
				
			||||||
  "vsmqtt.brokerProfiles": [
 | 
					  "vsmqtt.brokerProfiles": [
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      "name": "broker.emqx.io",
 | 
					      "name": "broker.emqx.io",
 | 
				
			||||||
@ -43,5 +50,14 @@
 | 
				
			|||||||
      "port": 1883,
 | 
					      "port": 1883,
 | 
				
			||||||
      "clientId": "vsmqtt_client_db34"
 | 
					      "clientId": "vsmqtt_client_db34"
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  ]
 | 
					  ],
 | 
				
			||||||
 | 
					  "vscodeCustomCodeColor.highlightValue": [
 | 
				
			||||||
 | 
					    "v-loading",
 | 
				
			||||||
 | 
					    "v-auth",
 | 
				
			||||||
 | 
					    "v-copy",
 | 
				
			||||||
 | 
					    "v-longpress",
 | 
				
			||||||
 | 
					    "v-optimize",
 | 
				
			||||||
 | 
					    "v-ripple"
 | 
				
			||||||
 | 
					  ],
 | 
				
			||||||
 | 
					  "vscodeCustomCodeColor.highlightValueColor": "#b392f0",
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -35,6 +35,14 @@ The simplified version is based on the shelf extracted from [vue-pure-admin](htt
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[Click me for details](https://pure-admin.github.io/pure-admin-doc/pages/service/)
 | 
					[Click me for details](https://pure-admin.github.io/pure-admin-doc/pages/service/)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## `js` version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Click me to view js version](https://pure-admin.github.io/pure-admin-doc/pages/js/)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## `max` version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Click me to view the max version](https://github.com/pure-admin/vue-pure-admin-max)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Tauri
 | 
					## Tauri
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Click Watch Tauri](https://github.com/pure-admin/tauri-pure-admin)
 | 
					[Click Watch Tauri](https://github.com/pure-admin/tauri-pure-admin)
 | 
				
			||||||
 | 
				
			|||||||
@ -36,6 +36,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[点我查看详情](https://pure-admin.github.io/pure-admin-doc/pages/service/)
 | 
					[点我查看详情](https://pure-admin.github.io/pure-admin-doc/pages/service/)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## `js` 版本
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[点我查看 js 版本](https://pure-admin.github.io/pure-admin-doc/pages/js/)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## `max` 版本
 | 
					## `max` 版本
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[点我查看 max 版本](https://github.com/pure-admin/vue-pure-admin-max)
 | 
					[点我查看 max 版本](https://github.com/pure-admin/vue-pure-admin-max)
 | 
				
			||||||
 | 
				
			|||||||
@ -5,6 +5,7 @@ import { viteBuildInfo } from "./info";
 | 
				
			|||||||
import svgLoader from "vite-svg-loader";
 | 
					import svgLoader from "vite-svg-loader";
 | 
				
			||||||
import type { PluginOption } from "vite";
 | 
					import type { PluginOption } from "vite";
 | 
				
			||||||
import vueJsx from "@vitejs/plugin-vue-jsx";
 | 
					import vueJsx from "@vitejs/plugin-vue-jsx";
 | 
				
			||||||
 | 
					import Inspector from "vite-plugin-vue-inspector";
 | 
				
			||||||
import { configCompressPlugin } from "./compress";
 | 
					import { configCompressPlugin } from "./compress";
 | 
				
			||||||
import removeNoMatch from "vite-plugin-router-warn";
 | 
					import removeNoMatch from "vite-plugin-router-warn";
 | 
				
			||||||
import { visualizer } from "rollup-plugin-visualizer";
 | 
					import { visualizer } from "rollup-plugin-visualizer";
 | 
				
			||||||
@ -27,6 +28,8 @@ export function getPluginsList(
 | 
				
			|||||||
      jitCompilation: false,
 | 
					      jitCompilation: false,
 | 
				
			||||||
      include: [pathResolve("../locales/**")]
 | 
					      include: [pathResolve("../locales/**")]
 | 
				
			||||||
    }),
 | 
					    }),
 | 
				
			||||||
 | 
					    // 按下Command(⌘)+Shift(⇧),然后点击页面元素会自动打开本地IDE并跳转到对应的代码位置
 | 
				
			||||||
 | 
					    Inspector(),
 | 
				
			||||||
    viteBuildInfo(),
 | 
					    viteBuildInfo(),
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 开发环境下移除非必要的vue-router动态路由警告No match found for location with path
 | 
					     * 开发环境下移除非必要的vue-router动态路由警告No match found for location with path
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										39
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										39
									
								
								package.json
									
									
									
									
									
								
							@ -56,9 +56,9 @@
 | 
				
			|||||||
    "@pureadmin/table": "^3.1.2",
 | 
					    "@pureadmin/table": "^3.1.2",
 | 
				
			||||||
    "@pureadmin/utils": "^2.4.7",
 | 
					    "@pureadmin/utils": "^2.4.7",
 | 
				
			||||||
    "@vue-flow/background": "^1.3.0",
 | 
					    "@vue-flow/background": "^1.3.0",
 | 
				
			||||||
    "@vue-flow/core": "^1.34.0",
 | 
					    "@vue-flow/core": "^1.34.1",
 | 
				
			||||||
    "@vueuse/core": "^10.10.0",
 | 
					    "@vueuse/core": "^10.10.0",
 | 
				
			||||||
    "@vueuse/motion": "^2.2.0",
 | 
					    "@vueuse/motion": "^2.2.3",
 | 
				
			||||||
    "@wangeditor/editor": "^5.1.23",
 | 
					    "@wangeditor/editor": "^5.1.23",
 | 
				
			||||||
    "@wangeditor/editor-for-vue": "^5.1.12",
 | 
					    "@wangeditor/editor-for-vue": "^5.1.12",
 | 
				
			||||||
    "@zxcvbn-ts/core": "^3.0.4",
 | 
					    "@zxcvbn-ts/core": "^3.0.4",
 | 
				
			||||||
@ -69,7 +69,7 @@
 | 
				
			|||||||
    "dayjs": "^1.11.11",
 | 
					    "dayjs": "^1.11.11",
 | 
				
			||||||
    "echarts": "^5.5.0",
 | 
					    "echarts": "^5.5.0",
 | 
				
			||||||
    "el-table-infinite-scroll": "^3.0.5",
 | 
					    "el-table-infinite-scroll": "^3.0.5",
 | 
				
			||||||
    "element-plus": "^2.7.3",
 | 
					    "element-plus": "^2.7.4",
 | 
				
			||||||
    "intro.js": "^7.2.0",
 | 
					    "intro.js": "^7.2.0",
 | 
				
			||||||
    "js-cookie": "^3.0.5",
 | 
					    "js-cookie": "^3.0.5",
 | 
				
			||||||
    "jsbarcode": "^3.11.6",
 | 
					    "jsbarcode": "^3.11.6",
 | 
				
			||||||
@ -81,7 +81,7 @@
 | 
				
			|||||||
    "path": "^0.12.7",
 | 
					    "path": "^0.12.7",
 | 
				
			||||||
    "pinia": "^2.1.7",
 | 
					    "pinia": "^2.1.7",
 | 
				
			||||||
    "pinyin-pro": "^3.21.1",
 | 
					    "pinyin-pro": "^3.21.1",
 | 
				
			||||||
    "plus-pro-components": "^0.1.7",
 | 
					    "plus-pro-components": "^0.1.8",
 | 
				
			||||||
    "qrcode": "^1.5.3",
 | 
					    "qrcode": "^1.5.3",
 | 
				
			||||||
    "qs": "^6.12.1",
 | 
					    "qs": "^6.12.1",
 | 
				
			||||||
    "responsive-storage": "^2.2.0",
 | 
					    "responsive-storage": "^2.2.0",
 | 
				
			||||||
@ -112,7 +112,7 @@
 | 
				
			|||||||
    "@commitlint/cli": "^19.3.0",
 | 
					    "@commitlint/cli": "^19.3.0",
 | 
				
			||||||
    "@commitlint/config-conventional": "^19.2.2",
 | 
					    "@commitlint/config-conventional": "^19.2.2",
 | 
				
			||||||
    "@commitlint/types": "^19.0.3",
 | 
					    "@commitlint/types": "^19.0.3",
 | 
				
			||||||
    "@eslint/js": "^9.3.0",
 | 
					    "@eslint/js": "^9.4.0",
 | 
				
			||||||
    "@faker-js/faker": "^8.4.1",
 | 
					    "@faker-js/faker": "^8.4.1",
 | 
				
			||||||
    "@iconify-icons/ep": "^1.2.12",
 | 
					    "@iconify-icons/ep": "^1.2.12",
 | 
				
			||||||
    "@iconify-icons/ri": "^1.2.10",
 | 
					    "@iconify-icons/ri": "^1.2.10",
 | 
				
			||||||
@ -123,20 +123,20 @@
 | 
				
			|||||||
    "@types/gradient-string": "^1.1.6",
 | 
					    "@types/gradient-string": "^1.1.6",
 | 
				
			||||||
    "@types/intro.js": "^5.1.5",
 | 
					    "@types/intro.js": "^5.1.5",
 | 
				
			||||||
    "@types/js-cookie": "^3.0.6",
 | 
					    "@types/js-cookie": "^3.0.6",
 | 
				
			||||||
    "@types/node": "^20.12.13",
 | 
					    "@types/node": "^20.14.2",
 | 
				
			||||||
    "@types/nprogress": "^0.2.3",
 | 
					    "@types/nprogress": "^0.2.3",
 | 
				
			||||||
    "@types/qrcode": "^1.5.5",
 | 
					    "@types/qrcode": "^1.5.5",
 | 
				
			||||||
    "@types/qs": "^6.9.15",
 | 
					    "@types/qs": "^6.9.15",
 | 
				
			||||||
    "@types/sortablejs": "^1.15.8",
 | 
					    "@types/sortablejs": "^1.15.8",
 | 
				
			||||||
    "@typescript-eslint/eslint-plugin": "^7.11.0",
 | 
					    "@typescript-eslint/eslint-plugin": "^7.12.0",
 | 
				
			||||||
    "@typescript-eslint/parser": "^7.11.0",
 | 
					    "@typescript-eslint/parser": "^7.12.0",
 | 
				
			||||||
    "@vitejs/plugin-vue": "^5.0.4",
 | 
					    "@vitejs/plugin-vue": "^5.0.5",
 | 
				
			||||||
    "@vitejs/plugin-vue-jsx": "^3.1.0",
 | 
					    "@vitejs/plugin-vue-jsx": "^4.0.0",
 | 
				
			||||||
    "autoprefixer": "^10.4.19",
 | 
					    "autoprefixer": "^10.4.19",
 | 
				
			||||||
    "boxen": "^7.1.1",
 | 
					    "boxen": "^7.1.1",
 | 
				
			||||||
    "cssnano": "^7.0.1",
 | 
					    "cssnano": "^7.0.2",
 | 
				
			||||||
    "dagre": "^0.8.5",
 | 
					    "dagre": "^0.8.5",
 | 
				
			||||||
    "eslint": "^9.3.0",
 | 
					    "eslint": "^9.4.0",
 | 
				
			||||||
    "eslint-config-prettier": "^9.1.0",
 | 
					    "eslint-config-prettier": "^9.1.0",
 | 
				
			||||||
    "eslint-define-config": "^2.1.0",
 | 
					    "eslint-define-config": "^2.1.0",
 | 
				
			||||||
    "eslint-plugin-prettier": "^5.1.3",
 | 
					    "eslint-plugin-prettier": "^5.1.3",
 | 
				
			||||||
@ -148,7 +148,7 @@
 | 
				
			|||||||
    "postcss-html": "^1.7.0",
 | 
					    "postcss-html": "^1.7.0",
 | 
				
			||||||
    "postcss-import": "^16.1.0",
 | 
					    "postcss-import": "^16.1.0",
 | 
				
			||||||
    "postcss-scss": "^4.0.9",
 | 
					    "postcss-scss": "^4.0.9",
 | 
				
			||||||
    "prettier": "^3.2.5",
 | 
					    "prettier": "^3.3.1",
 | 
				
			||||||
    "rimraf": "^5.0.7",
 | 
					    "rimraf": "^5.0.7",
 | 
				
			||||||
    "rollup-plugin-visualizer": "^5.12.0",
 | 
					    "rollup-plugin-visualizer": "^5.12.0",
 | 
				
			||||||
    "sass": "^1.77.4",
 | 
					    "sass": "^1.77.4",
 | 
				
			||||||
@ -158,7 +158,7 @@
 | 
				
			|||||||
    "stylelint-config-standard-scss": "^13.1.0",
 | 
					    "stylelint-config-standard-scss": "^13.1.0",
 | 
				
			||||||
    "stylelint-prettier": "^5.0.0",
 | 
					    "stylelint-prettier": "^5.0.0",
 | 
				
			||||||
    "svgo": "^3.3.2",
 | 
					    "svgo": "^3.3.2",
 | 
				
			||||||
    "tailwindcss": "^3.4.3",
 | 
					    "tailwindcss": "^3.4.4",
 | 
				
			||||||
    "typescript": "^5.4.5",
 | 
					    "typescript": "^5.4.5",
 | 
				
			||||||
    "vite": "^5.2.12",
 | 
					    "vite": "^5.2.12",
 | 
				
			||||||
    "vite-plugin-cdn-import": "^1.0.1",
 | 
					    "vite-plugin-cdn-import": "^1.0.1",
 | 
				
			||||||
@ -166,8 +166,9 @@
 | 
				
			|||||||
    "vite-plugin-fake-server": "^2.1.1",
 | 
					    "vite-plugin-fake-server": "^2.1.1",
 | 
				
			||||||
    "vite-plugin-remove-console": "^2.2.0",
 | 
					    "vite-plugin-remove-console": "^2.2.0",
 | 
				
			||||||
    "vite-plugin-router-warn": "^1.0.0",
 | 
					    "vite-plugin-router-warn": "^1.0.0",
 | 
				
			||||||
 | 
					    "vite-plugin-vue-inspector": "^5.1.2",
 | 
				
			||||||
    "vite-svg-loader": "^5.1.0",
 | 
					    "vite-svg-loader": "^5.1.0",
 | 
				
			||||||
    "vue-eslint-parser": "^9.4.2",
 | 
					    "vue-eslint-parser": "^9.4.3",
 | 
				
			||||||
    "vue-tsc": "^1.8.27"
 | 
					    "vue-tsc": "^1.8.27"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "engines": {
 | 
					  "engines": {
 | 
				
			||||||
@ -176,11 +177,17 @@
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  "pnpm": {
 | 
					  "pnpm": {
 | 
				
			||||||
    "allowedDeprecatedVersions": {
 | 
					    "allowedDeprecatedVersions": {
 | 
				
			||||||
 | 
					      "are-we-there-yet": "*",
 | 
				
			||||||
      "sourcemap-codec": "*",
 | 
					      "sourcemap-codec": "*",
 | 
				
			||||||
      "domexception": "*",
 | 
					      "domexception": "*",
 | 
				
			||||||
      "w3c-hr-time": "*",
 | 
					      "w3c-hr-time": "*",
 | 
				
			||||||
 | 
					      "inflight": "*",
 | 
				
			||||||
 | 
					      "npmlog": "*",
 | 
				
			||||||
 | 
					      "rimraf": "*",
 | 
				
			||||||
      "stable": "*",
 | 
					      "stable": "*",
 | 
				
			||||||
      "abab": "*"
 | 
					      "gauge": "*",
 | 
				
			||||||
 | 
					      "abab": "*",
 | 
				
			||||||
 | 
					      "glob": "*"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "peerDependencyRules": {
 | 
					    "peerDependencyRules": {
 | 
				
			||||||
      "allowedVersions": {
 | 
					      "allowedVersions": {
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										1281
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1281
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -2,7 +2,7 @@ import { hasAuth } from "@/router/utils";
 | 
				
			|||||||
import type { Directive, DirectiveBinding } from "vue";
 | 
					import type { Directive, DirectiveBinding } from "vue";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const auth: Directive = {
 | 
					export const auth: Directive = {
 | 
				
			||||||
  mounted(el: HTMLElement, binding: DirectiveBinding) {
 | 
					  mounted(el: HTMLElement, binding: DirectiveBinding<string | Array<string>>) {
 | 
				
			||||||
    const { value } = binding;
 | 
					    const { value } = binding;
 | 
				
			||||||
    if (value) {
 | 
					    if (value) {
 | 
				
			||||||
      !hasAuth(value) && el.parentNode?.removeChild(el);
 | 
					      !hasAuth(value) && el.parentNode?.removeChild(el);
 | 
				
			||||||
 | 
				
			|||||||
@ -3,13 +3,13 @@ import { useEventListener } from "@vueuse/core";
 | 
				
			|||||||
import { copyTextToClipboard } from "@pureadmin/utils";
 | 
					import { copyTextToClipboard } from "@pureadmin/utils";
 | 
				
			||||||
import type { Directive, DirectiveBinding } from "vue";
 | 
					import type { Directive, DirectiveBinding } from "vue";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface CopyEl extends HTMLElement {
 | 
					export interface CopyEl extends HTMLElement {
 | 
				
			||||||
  copyValue: string;
 | 
					  copyValue: string;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** 文本复制指令(默认双击复制) */
 | 
					/** 文本复制指令(默认双击复制) */
 | 
				
			||||||
export const copy: Directive = {
 | 
					export const copy: Directive = {
 | 
				
			||||||
  mounted(el: CopyEl, binding: DirectiveBinding) {
 | 
					  mounted(el: CopyEl, binding: DirectiveBinding<string>) {
 | 
				
			||||||
    const { value } = binding;
 | 
					    const { value } = binding;
 | 
				
			||||||
    if (value) {
 | 
					    if (value) {
 | 
				
			||||||
      el.copyValue = value;
 | 
					      el.copyValue = value;
 | 
				
			||||||
 | 
				
			|||||||
@ -3,7 +3,7 @@ import type { Directive, DirectiveBinding } from "vue";
 | 
				
			|||||||
import { subBefore, subAfter, isFunction } from "@pureadmin/utils";
 | 
					import { subBefore, subAfter, isFunction } from "@pureadmin/utils";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const longpress: Directive = {
 | 
					export const longpress: Directive = {
 | 
				
			||||||
  mounted(el: HTMLElement, binding: DirectiveBinding) {
 | 
					  mounted(el: HTMLElement, binding: DirectiveBinding<Function>) {
 | 
				
			||||||
    const cb = binding.value;
 | 
					    const cb = binding.value;
 | 
				
			||||||
    if (cb && isFunction(cb)) {
 | 
					    if (cb && isFunction(cb)) {
 | 
				
			||||||
      let timer = null;
 | 
					      let timer = null;
 | 
				
			||||||
 | 
				
			|||||||
@ -8,9 +8,22 @@ import {
 | 
				
			|||||||
import { useEventListener } from "@vueuse/core";
 | 
					import { useEventListener } from "@vueuse/core";
 | 
				
			||||||
import type { Directive, DirectiveBinding } from "vue";
 | 
					import type { Directive, DirectiveBinding } from "vue";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export interface OptimizeOptions {
 | 
				
			||||||
 | 
					  /** 事件名 */
 | 
				
			||||||
 | 
					  event: string;
 | 
				
			||||||
 | 
					  /** 事件触发的方法 */
 | 
				
			||||||
 | 
					  fn: (...params: any) => any;
 | 
				
			||||||
 | 
					  /** 是否立即执行 */
 | 
				
			||||||
 | 
					  immediate?: boolean;
 | 
				
			||||||
 | 
					  /** 防抖或节流的延迟时间(防抖默认:`200`毫秒、节流默认:`1000`毫秒) */
 | 
				
			||||||
 | 
					  timeout?: number;
 | 
				
			||||||
 | 
					  /** 传递的参数 */
 | 
				
			||||||
 | 
					  params?: any;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** 防抖(v-optimize或v-optimize:debounce)、节流(v-optimize:throttle)指令 */
 | 
					/** 防抖(v-optimize或v-optimize:debounce)、节流(v-optimize:throttle)指令 */
 | 
				
			||||||
export const optimize: Directive = {
 | 
					export const optimize: Directive = {
 | 
				
			||||||
  mounted(el: HTMLElement, binding: DirectiveBinding) {
 | 
					  mounted(el: HTMLElement, binding: DirectiveBinding<OptimizeOptions>) {
 | 
				
			||||||
    const { value } = binding;
 | 
					    const { value } = binding;
 | 
				
			||||||
    const optimizeType = binding.arg ?? "debounce";
 | 
					    const optimizeType = binding.arg ?? "debounce";
 | 
				
			||||||
    const type = ["debounce", "throttle"].find(t => t === optimizeType);
 | 
					    const type = ["debounce", "throttle"].find(t => t === optimizeType);
 | 
				
			||||||
 | 
				
			|||||||
@ -2,8 +2,10 @@ import "./index.scss";
 | 
				
			|||||||
import { isObject } from "@pureadmin/utils";
 | 
					import { isObject } from "@pureadmin/utils";
 | 
				
			||||||
import type { Directive, DirectiveBinding } from "vue";
 | 
					import type { Directive, DirectiveBinding } from "vue";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface RippleOptions {
 | 
					export interface RippleOptions {
 | 
				
			||||||
 | 
					  /** 自定义`ripple`颜色,支持`tailwindcss` */
 | 
				
			||||||
  class?: string;
 | 
					  class?: string;
 | 
				
			||||||
 | 
					  /** 是否从中心扩散 */
 | 
				
			||||||
  center?: boolean;
 | 
					  center?: boolean;
 | 
				
			||||||
  circle?: boolean;
 | 
					  circle?: boolean;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -220,13 +222,6 @@ function updated(el: HTMLElement, binding: RippleDirectiveBinding) {
 | 
				
			|||||||
  updateRipple(el, binding, wasEnabled);
 | 
					  updateRipple(el, binding, wasEnabled);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
 * @description 指令 v-ripple
 | 
					 | 
				
			||||||
 * @use 用法如下
 | 
					 | 
				
			||||||
 * 1. v-ripple 代表启用基本的 ripple 功能
 | 
					 | 
				
			||||||
 * 2. v-ripple="{ class: 'text-red' }" 代表自定义 ripple 颜色,支持 tailwindcss,生效样式是 color
 | 
					 | 
				
			||||||
 * 3. v-ripple.center 代表从中心扩散
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
export const Ripple: Directive = {
 | 
					export const Ripple: Directive = {
 | 
				
			||||||
  mounted,
 | 
					  mounted,
 | 
				
			||||||
  unmounted,
 | 
					  unmounted,
 | 
				
			||||||
 | 
				
			|||||||
@ -107,6 +107,7 @@ import {
 | 
				
			|||||||
  ElWatermark,
 | 
					  ElWatermark,
 | 
				
			||||||
  ElTour,
 | 
					  ElTour,
 | 
				
			||||||
  ElTourStep,
 | 
					  ElTourStep,
 | 
				
			||||||
 | 
					  ElSegmented,
 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * 为了方便演示平台将 element-plus 导出的所有插件引入,实际使用中如果你没用到哪个插件,将其注释掉就行
 | 
					   * 为了方便演示平台将 element-plus 导出的所有插件引入,实际使用中如果你没用到哪个插件,将其注释掉就行
 | 
				
			||||||
   * 导出来源:https://github.com/element-plus/element-plus/blob/dev/packages/element-plus/plugin.ts#L11-L16
 | 
					   * 导出来源:https://github.com/element-plus/element-plus/blob/dev/packages/element-plus/plugin.ts#L11-L16
 | 
				
			||||||
@ -221,7 +222,8 @@ const components = [
 | 
				
			|||||||
  ElUpload,
 | 
					  ElUpload,
 | 
				
			||||||
  ElWatermark,
 | 
					  ElWatermark,
 | 
				
			||||||
  ElTour,
 | 
					  ElTour,
 | 
				
			||||||
  ElTourStep
 | 
					  ElTourStep,
 | 
				
			||||||
 | 
					  ElSegmented
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const plugins = [
 | 
					const plugins = [
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										26
									
								
								types/directives.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								types/directives.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,26 @@
 | 
				
			|||||||
 | 
					import type { Directive } from "vue";
 | 
				
			||||||
 | 
					import type { CopyEl, OptimizeOptions, RippleOptions } from "@/directives";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					declare module "vue" {
 | 
				
			||||||
 | 
					  export interface ComponentCustomProperties {
 | 
				
			||||||
 | 
					    /** `Loading` 动画加载指令,具体看:https://element-plus.org/zh-CN/component/loading.html#%E6%8C%87%E4%BB%A4 */
 | 
				
			||||||
 | 
					    vLoading: Directive<Element, boolean>;
 | 
				
			||||||
 | 
					    /** 按钮权限指令 */
 | 
				
			||||||
 | 
					    vAuth: Directive<HTMLElement, string | Array<string>>;
 | 
				
			||||||
 | 
					    /** 文本复制指令(默认双击复制) */
 | 
				
			||||||
 | 
					    vCopy: Directive<CopyEl, string>;
 | 
				
			||||||
 | 
					    /** 长按指令 */
 | 
				
			||||||
 | 
					    vLongpress: Directive<HTMLElement, Function>;
 | 
				
			||||||
 | 
					    /** 防抖、节流指令 */
 | 
				
			||||||
 | 
					    vOptimize: Directive<HTMLElement, OptimizeOptions>;
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * `v-ripple`指令,用法如下:
 | 
				
			||||||
 | 
					     * 1. `v-ripple`代表启用基本的`ripple`功能
 | 
				
			||||||
 | 
					     * 2. `v-ripple="{ class: 'text-red' }"`代表自定义`ripple`颜色,支持`tailwindcss`,生效样式是`color`
 | 
				
			||||||
 | 
					     * 3. `v-ripple.center`代表从中心扩散
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    vRipple: Directive<HTMLElement, RippleOptions>;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export {};
 | 
				
			||||||
							
								
								
									
										1
									
								
								types/global-components.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								types/global-components.d.ts
									
									
									
									
										vendored
									
									
								
							@ -115,6 +115,7 @@ declare module "vue" {
 | 
				
			|||||||
    ElWatermark: (typeof import("element-plus"))["ElWatermark"];
 | 
					    ElWatermark: (typeof import("element-plus"))["ElWatermark"];
 | 
				
			||||||
    ElTour: (typeof import("element-plus"))["ElTour"];
 | 
					    ElTour: (typeof import("element-plus"))["ElTour"];
 | 
				
			||||||
    ElTourStep: (typeof import("element-plus"))["ElTourStep"];
 | 
					    ElTourStep: (typeof import("element-plus"))["ElTourStep"];
 | 
				
			||||||
 | 
					    ElSegmented: (typeof import("element-plus"))["ElSegmented"];
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  interface ComponentCustomProperties {
 | 
					  interface ComponentCustomProperties {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user