vue-amazing-ui 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -35
- package/README.zh-CN.md +65 -20
- package/dist/index.iife.js +14 -14
- package/dist/index.js +584 -584
- package/dist/index.umd.cjs +15 -15
- package/dist/style.css +1 -1
- package/es/avatar/Avatar.d.ts +1 -1
- package/es/avatar/index.d.ts +3 -3
- package/es/button/Button.d.ts +1 -1
- package/es/button/index.d.ts +3 -3
- package/es/cascader/Cascader.d.ts +1 -1
- package/es/cascader/index.d.ts +3 -3
- package/es/components.d.ts +3 -3
- package/es/ellipsis/Ellipsis.d.ts +120 -1
- package/es/floatbutton/FloatButton.d.ts +1 -1
- package/es/floatbutton/index.d.ts +3 -3
- package/es/popconfirm/Popconfirm.d.ts +120 -1
- package/es/steps/Steps.css +1 -1
- package/es/steps/Steps.d.ts +3 -3
- package/es/steps/Steps.vue.js +1 -1
- package/es/steps/Steps.vue2.js +6 -6
- package/es/steps/index.d.ts +4 -4
- package/es/table/Table.d.ts +300 -4
- package/es/tabs/Tabs.css +1 -1
- package/es/tabs/Tabs.d.ts +7 -5
- package/es/tabs/Tabs.vue.js +3 -3
- package/es/tabs/Tabs.vue2.js +24 -24
- package/es/tabs/index.d.ts +8 -6
- package/es/tag/Tag.css +1 -1
- package/es/tag/Tag.d.ts +7 -4
- package/es/tag/Tag.vue.js +2 -2
- package/es/tag/Tag.vue2.js +5 -5
- package/es/tag/index.d.ts +8 -5
- package/es/timeline/Timeline.css +1 -1
- package/es/timeline/Timeline.d.ts +3 -1
- package/es/timeline/Timeline.vue.js +2 -2
- package/es/timeline/Timeline.vue2.js +5 -5
- package/es/timeline/index.d.ts +2 -0
- package/es/upload/Upload.d.ts +134 -2
- package/lib/avatar/Avatar.d.ts +1 -1
- package/lib/avatar/index.d.ts +3 -3
- package/lib/button/Button.d.ts +1 -1
- package/lib/button/index.d.ts +3 -3
- package/lib/cascader/Cascader.d.ts +1 -1
- package/lib/cascader/index.d.ts +3 -3
- package/lib/components.d.ts +3 -3
- package/lib/ellipsis/Ellipsis.d.ts +120 -1
- package/lib/floatbutton/FloatButton.d.ts +1 -1
- package/lib/floatbutton/index.d.ts +3 -3
- package/lib/popconfirm/Popconfirm.d.ts +120 -1
- package/lib/steps/Steps.css +1 -1
- package/lib/steps/Steps.d.ts +3 -3
- package/lib/steps/Steps.vue.cjs +1 -1
- package/lib/steps/Steps.vue2.cjs +1 -1
- package/lib/steps/index.d.ts +4 -4
- package/lib/table/Table.d.ts +300 -4
- package/lib/tabs/Tabs.css +1 -1
- package/lib/tabs/Tabs.d.ts +7 -5
- package/lib/tabs/Tabs.vue.cjs +1 -1
- package/lib/tabs/Tabs.vue2.cjs +1 -1
- package/lib/tabs/index.d.ts +8 -6
- package/lib/tag/Tag.css +1 -1
- package/lib/tag/Tag.d.ts +7 -4
- package/lib/tag/Tag.vue.cjs +1 -1
- package/lib/tag/Tag.vue2.cjs +1 -1
- package/lib/tag/index.d.ts +8 -5
- package/lib/timeline/Timeline.css +1 -1
- package/lib/timeline/Timeline.d.ts +3 -1
- package/lib/timeline/Timeline.vue.cjs +1 -1
- package/lib/timeline/Timeline.vue2.cjs +1 -1
- package/lib/timeline/index.d.ts +2 -0
- package/lib/upload/Upload.d.ts +134 -2
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<h1 align="center">Vue Amazing UI</h1>
|
|
8
8
|
<p align="center">A Vue 3 Component Library</p>
|
|
9
|
-
<p align="center">Uses TypeScript,
|
|
9
|
+
<p align="center">Uses TypeScript, All components are single-file components (SFC), Supports tree shaking.</p>
|
|
10
10
|
<p align="center">Kinda Interesting</p>
|
|
11
11
|
<p align="center">English | <a href="README.zh-CN.md">中文</a></p>
|
|
12
12
|
|
|
@@ -54,7 +54,7 @@ app.mount('#app')
|
|
|
54
54
|
|
|
55
55
|
**Global Registration Some Components**
|
|
56
56
|
|
|
57
|
-
*
|
|
57
|
+
*In this form, only components imported will be bundled.*
|
|
58
58
|
|
|
59
59
|
```ts
|
|
60
60
|
import { createApp } from 'vue'
|
|
@@ -82,6 +82,68 @@ import 'vue-amazing-ui/es/button/Button.css'
|
|
|
82
82
|
</template>
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
**Automatic On-Demand Import (Strongly Recommended)**
|
|
86
|
+
|
|
87
|
+
Use the [`unplugin-vue-components`](https://github.com/unplugin/unplugin-vue-components) plugin to automatically import components on demand. The plugin will automatically parse the components used in the template and import the components and styles.
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
pnpm add unplugin-vue-components -D
|
|
91
|
+
# or
|
|
92
|
+
npm install unplugin-vue-components -D
|
|
93
|
+
# or
|
|
94
|
+
yarn add unplugin-vue-components -D
|
|
95
|
+
# or
|
|
96
|
+
bun add unplugin-vue-components -D
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
// vite.config.ts
|
|
101
|
+
import { defineConfig } from 'vite'
|
|
102
|
+
import vue from '@vitejs/plugin-vue'
|
|
103
|
+
import Components from 'unplugin-vue-components/vite'
|
|
104
|
+
// vue-amazing-ui on-demand import
|
|
105
|
+
import { VueAmazingUIResolver } from 'vue-amazing-ui'
|
|
106
|
+
|
|
107
|
+
// https://vitejs.dev/config/
|
|
108
|
+
export default defineConfig({
|
|
109
|
+
plugins: [
|
|
110
|
+
vue(),
|
|
111
|
+
Components({
|
|
112
|
+
resolvers: [
|
|
113
|
+
// auto import components from VueAmazingUI
|
|
114
|
+
VueAmazingUIResolver()
|
|
115
|
+
]
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
})
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Then, you can directly use all components from `vue-amazing-ui` in your code.
|
|
122
|
+
|
|
123
|
+
```vue
|
|
124
|
+
<template>
|
|
125
|
+
<Button>button</Button>
|
|
126
|
+
<Tag>tag</Tag>
|
|
127
|
+
</template>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Use Types
|
|
131
|
+
|
|
132
|
+
*All types can be directly imported and used from `vue-amazing-ui` without any additional installation.*
|
|
133
|
+
|
|
134
|
+
```vue
|
|
135
|
+
<script setup lang="ts">
|
|
136
|
+
import { Button } from 'vue-amazing-ui'
|
|
137
|
+
import type { ButtonProps } from 'vue-amazing-ui'
|
|
138
|
+
import 'vue-amazing-ui/es/button/Button.css'
|
|
139
|
+
|
|
140
|
+
const shape = ref<ButtonProps['shape']>('default')
|
|
141
|
+
</script>
|
|
142
|
+
<template>
|
|
143
|
+
<Button :shape="shape">button</Button>
|
|
144
|
+
</template>
|
|
145
|
+
```
|
|
146
|
+
|
|
85
147
|
## Use Functions
|
|
86
148
|
|
|
87
149
|
```vue
|
|
@@ -107,23 +169,6 @@ import {
|
|
|
107
169
|
</script>
|
|
108
170
|
```
|
|
109
171
|
|
|
110
|
-
## Use Types
|
|
111
|
-
|
|
112
|
-
*All types can be directly imported from vue-amazing-ui without the need for additional installation.*
|
|
113
|
-
|
|
114
|
-
```vue
|
|
115
|
-
<script setup lang="ts">
|
|
116
|
-
import { Button } from 'vue-amazing-ui'
|
|
117
|
-
import type { ButtonProps } from 'vue-amazing-ui'
|
|
118
|
-
import 'vue-amazing-ui/es/button/Button.css'
|
|
119
|
-
|
|
120
|
-
const shape = ref<ButtonProps['shape']>('default')
|
|
121
|
-
</script>
|
|
122
|
-
<template>
|
|
123
|
-
<Button :shape="shape">button</Button>
|
|
124
|
-
</template>
|
|
125
|
-
```
|
|
126
|
-
|
|
127
172
|
## Project
|
|
128
173
|
|
|
129
174
|
- Get the project code
|
|
@@ -191,19 +236,19 @@ Watermark | 水印
|
|
|
191
236
|
|
|
192
237
|
Name | Description | Type
|
|
193
238
|
:--- | :--- | :---
|
|
194
|
-
dateFormat |
|
|
195
|
-
formatNumber |
|
|
196
|
-
rafTimeout |
|
|
197
|
-
cancelRaf |
|
|
198
|
-
throttle |
|
|
199
|
-
debounce |
|
|
200
|
-
add |
|
|
201
|
-
downloadFile |
|
|
202
|
-
toggleDark |
|
|
203
|
-
useEventListener |
|
|
204
|
-
useMutationObserver |
|
|
205
|
-
useScroll |
|
|
206
|
-
useFps |
|
|
207
|
-
useMediaQuery |
|
|
208
|
-
useResizeObserver |
|
|
209
|
-
useSlotsExist |
|
|
239
|
+
dateFormat | Format date-time string function | (value: number | string | Date = Date.now(), format: string = 'YYYY-MM-DD HH:mm:ss') => string
|
|
240
|
+
formatNumber | Number formatting function | (value: number | string, precision: number = 2, separator: string = ',', decimal: string = '.', prefix?: string, suffix?: string) => string
|
|
241
|
+
rafTimeout | Function to implement `setTimeout` or `setInterval` using `requestAnimationFrame` | (fn: Function, delay: number = 0, interval: boolean = false) => object
|
|
242
|
+
cancelRaf | Function to cancel the `rafTimeout` function | (raf: { id: number }) => void
|
|
243
|
+
throttle | Throttle function | (fn: Function, delay: number = 300) => any
|
|
244
|
+
debounce | Debounce function | (fn: Function, delay: number = 300) => any
|
|
245
|
+
add | Addition function that eliminates precision issues in JavaScript arithmetic | (num1: number, num2: number) => number
|
|
246
|
+
downloadFile | Function to download a file with a custom filename; if no name is provided, it extracts the filename from the URL | (url: string, fileName?: string) => void
|
|
247
|
+
toggleDark | Function to toggle dark mode | () => void
|
|
248
|
+
useEventListener | Function to add and remove event listeners using Vue lifecycle hooks | (target: HTMLElement | Window | Document, event: string, callback: Function) => void
|
|
249
|
+
useMutationObserver | Function to observe changes in DOM elements using `MutationObserver` | (target: Ref | Ref[] | HTMLElement | HTMLElement[], callback: MutationCallback, options = {}) => object
|
|
250
|
+
useScroll | Function to monitor the scroll position and state of a target element in real time | (target: Ref | HTMLElement | Window | Document = window, throttleDelay: number = 0, onScroll?: (e: Event) => void, onStop?: (e: Event) => void) => object
|
|
251
|
+
useFps | Function to monitor the browser's refresh rate (FPS) in real time | () => object
|
|
252
|
+
useMediaQuery | Function to determine if the current environment matches a specified media query condition | (mediaQuery: string) => object
|
|
253
|
+
useResizeObserver | Function to observe changes in the dimensions of DOM elements using `ResizeObserver` | (target: Ref | Ref[] | HTMLElement | HTMLElement[], callback: ResizeObserverCallback, options = {}) => object
|
|
254
|
+
useSlotsExist | Function to watch for the existence of slots with given names, supporting single slots or an array of slots | (slotsName: string | string[] = 'default') => Reactive | Ref\<boolean>
|
package/README.zh-CN.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<h1 align="center">Vue Amazing UI</h1>
|
|
8
8
|
<p align="center">一个 Vue 3 组件库</p>
|
|
9
|
-
<p align="center">使用 TypeScript
|
|
9
|
+
<p align="center">使用 TypeScript,都是单文件组件 (SFC),支持 tree shaking</p>
|
|
10
10
|
<p align="center">有点意思</p>
|
|
11
11
|
<p align="center"><a href="README.md">English</a> | 中文</p>
|
|
12
12
|
|
|
@@ -54,7 +54,7 @@ app.mount('#app')
|
|
|
54
54
|
|
|
55
55
|
**全局部分注册**
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
*这种情况下,只有导入的组件才会被打包*
|
|
58
58
|
|
|
59
59
|
```ts
|
|
60
60
|
import { createApp } from 'vue'
|
|
@@ -82,6 +82,68 @@ import 'vue-amazing-ui/es/button/Button.css'
|
|
|
82
82
|
</template>
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
**自动按需引入(强烈推荐)**
|
|
86
|
+
|
|
87
|
+
使用 [`unplugin-vue-components`](https://github.com/unplugin/unplugin-vue-components) 插件来按需自动加载组件,插件会自动解析模板中的使用到的组件,并导入组件和样式
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
pnpm add unplugin-vue-components -D
|
|
91
|
+
# or
|
|
92
|
+
npm install unplugin-vue-components -D
|
|
93
|
+
# or
|
|
94
|
+
yarn add unplugin-vue-components -D
|
|
95
|
+
# or
|
|
96
|
+
bun add unplugin-vue-components -D
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
// vite.config.ts
|
|
101
|
+
import { defineConfig } from 'vite'
|
|
102
|
+
import vue from '@vitejs/plugin-vue'
|
|
103
|
+
import Components from 'unplugin-vue-components/vite'
|
|
104
|
+
// vue-amazing-ui 按需引入
|
|
105
|
+
import { VueAmazingUIResolver } from 'vue-amazing-ui'
|
|
106
|
+
|
|
107
|
+
// https://vitejs.dev/config/
|
|
108
|
+
export default defineConfig({
|
|
109
|
+
plugins: [
|
|
110
|
+
vue(),
|
|
111
|
+
Components({
|
|
112
|
+
resolvers: [
|
|
113
|
+
// auto import components from VueAmazingUI
|
|
114
|
+
VueAmazingUIResolver()
|
|
115
|
+
]
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
})
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
然后,你可以在代码中直接使用 `vue-amazing-ui` 的所有组件
|
|
122
|
+
|
|
123
|
+
```vue
|
|
124
|
+
<template>
|
|
125
|
+
<Button>button</Button>
|
|
126
|
+
<Tag>tag</Tag>
|
|
127
|
+
</template>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## 使用类型
|
|
131
|
+
|
|
132
|
+
*所有类型均可直接从 `vue-amazing-ui` 中引入使用,无需任何额外安装*
|
|
133
|
+
|
|
134
|
+
```vue
|
|
135
|
+
<script setup lang="ts">
|
|
136
|
+
import { Button } from 'vue-amazing-ui'
|
|
137
|
+
import type { ButtonProps } from 'vue-amazing-ui'
|
|
138
|
+
import 'vue-amazing-ui/es/button/Button.css'
|
|
139
|
+
|
|
140
|
+
const shape = ref<ButtonProps['shape']>('default')
|
|
141
|
+
</script>
|
|
142
|
+
<template>
|
|
143
|
+
<Button :shape="shape">button</Button>
|
|
144
|
+
</template>
|
|
145
|
+
```
|
|
146
|
+
|
|
85
147
|
## 使用工具函数
|
|
86
148
|
|
|
87
149
|
```vue
|
|
@@ -107,23 +169,6 @@ import {
|
|
|
107
169
|
</script>
|
|
108
170
|
```
|
|
109
171
|
|
|
110
|
-
## 使用类型
|
|
111
|
-
|
|
112
|
-
*所有类型均可直接从 `vue-amazing-ui` 中引入使用,无需额外安装*
|
|
113
|
-
|
|
114
|
-
```vue
|
|
115
|
-
<script setup lang="ts">
|
|
116
|
-
import { Button } from 'vue-amazing-ui'
|
|
117
|
-
import type { ButtonProps } from 'vue-amazing-ui'
|
|
118
|
-
import 'vue-amazing-ui/es/button/Button.css'
|
|
119
|
-
|
|
120
|
-
const shape = ref<ButtonProps['shape']>('default')
|
|
121
|
-
</script>
|
|
122
|
-
<template>
|
|
123
|
-
<Button :shape="shape">button</Button>
|
|
124
|
-
</template>
|
|
125
|
-
```
|
|
126
|
-
|
|
127
172
|
## 项目
|
|
128
173
|
|
|
129
174
|
- 获取项目代码
|
|
@@ -193,7 +238,7 @@ Watermark | 水印
|
|
|
193
238
|
:--- | :--- | :---
|
|
194
239
|
dateFormat | 格式化日期时间字符串函数 | (value: number | string | Date = Date.now(), format: string = 'YYYY-MM-DD HH:mm:ss') => string
|
|
195
240
|
formatNumber | 数字格式化函数 | (value: number | string, precision: number = 2, separator: string = ',', decimal: string = '.', prefix?: string, suffix?: string) => string
|
|
196
|
-
rafTimeout | 使用 `requestAnimationFrame`
|
|
241
|
+
rafTimeout | 使用 `requestAnimationFrame` 实现的 `setTimeout` 或 `setInterval` 调用函数 | (fn: Function, delay: number = 0, interval: boolean = false) => object
|
|
197
242
|
cancelRaf | 用于取消 `rafTimeout` 函数 | (raf: { id: number }) => void
|
|
198
243
|
throttle | 节流函数 | (fn: Function, delay: number = 300) => any
|
|
199
244
|
debounce | 防抖函数 | (fn: Function, delay: number = 300) => any
|