@oiij/naive-ui 0.0.81 → 0.0.82
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 +351 -87
- package/dist/components/data-table-plus/DataTablePlus.vue.d.ts +1 -1
- package/dist/components/preset-select/PresetSelect.vue.d.ts +2 -2
- package/dist/components/remote-request/RemoteRequest.vue.d.ts +1 -1
- package/dist/composables/use-data-request.d.ts +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,140 +1,404 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @oiij/naive-ui
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@oiij/naive-ui)
|
|
4
4
|
[](https://github.com/oiij/use/blob/main/packages/naive-ui/LICENSE)
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## 简介
|
|
7
7
|
|
|
8
|
-
Use NaiveUI 是基于 Naive UI 的 Vue 3
|
|
8
|
+
Use NaiveUI 是基于 Naive UI 的 Vue 3 组件库扩展,提供了一系列实用的组合式 API 和组件,帮助开发者更高效地构建应用。
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 特点
|
|
11
11
|
|
|
12
|
-
###
|
|
12
|
+
### 🔌 组合式 API
|
|
13
13
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
14
|
+
- 🛠️ 提供菜单生成、数据请求、表单管理等工具
|
|
15
|
+
- 🔄 支持响应式配置
|
|
16
|
+
- 🔗 与 Naive UI 无缝集成
|
|
17
17
|
|
|
18
|
-
###
|
|
18
|
+
### 🧩 丰富组件
|
|
19
|
+
|
|
20
|
+
- 📊 增强型数据表格
|
|
21
|
+
- 📝 预设表单、输入框、选择器
|
|
22
|
+
- 🌐 远程请求组件
|
|
23
|
+
- ✨ 过渡动画组件
|
|
24
|
+
|
|
25
|
+
### 🔒 类型安全
|
|
19
26
|
|
|
20
27
|
- 📝 完整的 TypeScript 类型定义
|
|
21
28
|
- 💡 提供准确的类型推断和代码提示
|
|
22
|
-
-
|
|
29
|
+
- ⚡ 支持 Vue 3 的 Composition API 类型系统
|
|
23
30
|
|
|
24
|
-
|
|
31
|
+
## 安装
|
|
25
32
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
```bash
|
|
34
|
+
# 使用 pnpm
|
|
35
|
+
pnpm add @oiij/naive-ui
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
# 使用 npm
|
|
38
|
+
npm install @oiij/naive-ui
|
|
31
39
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
# 使用 yarn
|
|
41
|
+
yarn add @oiij/naive-ui
|
|
42
|
+
```
|
|
35
43
|
|
|
36
|
-
##
|
|
44
|
+
## 依赖
|
|
37
45
|
|
|
38
|
-
|
|
46
|
+
- `vue`: ^3.0.0
|
|
47
|
+
- `naive-ui`: ^2.0.0
|
|
48
|
+
- `vue-router`: ^4.0.0
|
|
49
|
+
- `@vueuse/core`: ^10.0.0
|
|
50
|
+
- `vue-hooks-plus`: ^2.0.0
|
|
39
51
|
|
|
40
|
-
|
|
41
|
-
|
|
52
|
+
## 组合式 API
|
|
53
|
+
|
|
54
|
+
### useNaiveMenu
|
|
55
|
+
|
|
56
|
+
将路由配置转换为 Naive UI 菜单配置。
|
|
57
|
+
|
|
58
|
+
```vue
|
|
59
|
+
<script setup>
|
|
60
|
+
import { useNaiveMenu } from '@oiij/naive-ui'
|
|
61
|
+
import { routes } from 'vue-router/auto-routes'
|
|
62
|
+
|
|
63
|
+
const { menuOptions, flattenedMenuOptions } = useNaiveMenu(routes)
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<template>
|
|
67
|
+
<n-menu :options="menuOptions" />
|
|
68
|
+
</template>
|
|
42
69
|
```
|
|
43
70
|
|
|
44
|
-
###
|
|
71
|
+
### useDataRequest
|
|
45
72
|
|
|
46
|
-
|
|
47
|
-
|
|
73
|
+
数据请求管理,支持分页。
|
|
74
|
+
|
|
75
|
+
```vue
|
|
76
|
+
<script setup>
|
|
77
|
+
import { useDataRequest } from '@oiij/naive-ui'
|
|
78
|
+
|
|
79
|
+
const { loading, list, pagination, run } = useDataRequest(fetchApi, {
|
|
80
|
+
defaultParams: { page: 1, pageSize: 10 },
|
|
81
|
+
fields: { page: 'page', pageSize: 'size', list: 'data', count: 'total' }
|
|
82
|
+
})
|
|
83
|
+
</script>
|
|
48
84
|
```
|
|
49
85
|
|
|
50
|
-
###
|
|
86
|
+
### useLoading
|
|
51
87
|
|
|
52
|
-
|
|
53
|
-
|
|
88
|
+
获取全局加载状态。
|
|
89
|
+
|
|
90
|
+
```vue
|
|
91
|
+
<script setup>
|
|
92
|
+
import { useLoading } from '@oiij/naive-ui'
|
|
93
|
+
|
|
94
|
+
const loading = useLoading()
|
|
95
|
+
loading?.start()
|
|
96
|
+
loading?.finish()
|
|
97
|
+
</script>
|
|
54
98
|
```
|
|
55
99
|
|
|
56
|
-
|
|
100
|
+
### useNaiveForm
|
|
57
101
|
|
|
58
|
-
|
|
102
|
+
表单管理。
|
|
59
103
|
|
|
60
104
|
```vue
|
|
61
105
|
<script setup>
|
|
62
|
-
import
|
|
63
|
-
import {
|
|
106
|
+
import { useNaiveForm } from '@oiij/naive-ui'
|
|
107
|
+
import { ref, useTemplateRef } from 'vue'
|
|
108
|
+
|
|
109
|
+
const formValue = ref({ name: '', email: '' })
|
|
110
|
+
const { formRef, formProps, validate, resetForm } = useNaiveForm(
|
|
111
|
+
useTemplateRef('form'),
|
|
112
|
+
formValue
|
|
113
|
+
)
|
|
114
|
+
</script>
|
|
115
|
+
|
|
116
|
+
<template>
|
|
117
|
+
<n-form ref="form" v-bind="formProps">
|
|
118
|
+
<n-form-item label="姓名" path="name">
|
|
119
|
+
<n-input v-model:value="formValue.name" />
|
|
120
|
+
</n-form-item>
|
|
121
|
+
</n-form>
|
|
122
|
+
</template>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### useNaiveTheme
|
|
64
126
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
127
|
+
主题管理。
|
|
128
|
+
|
|
129
|
+
```vue
|
|
130
|
+
<script setup>
|
|
131
|
+
import { useNaiveTheme } from '@oiij/naive-ui'
|
|
132
|
+
|
|
133
|
+
const { theme, darkMode, themeOverrides } = useNaiveTheme()
|
|
134
|
+
</script>
|
|
135
|
+
|
|
136
|
+
<template>
|
|
137
|
+
<n-config-provider :theme="theme" :theme-overrides="themeOverrides">
|
|
138
|
+
<button @click="darkMode = !darkMode">
|
|
139
|
+
切换主题
|
|
140
|
+
</button>
|
|
141
|
+
</n-config-provider>
|
|
142
|
+
</template>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## 组件
|
|
146
|
+
|
|
147
|
+
### ConfigProviders
|
|
148
|
+
|
|
149
|
+
全局配置提供者。
|
|
150
|
+
|
|
151
|
+
```vue
|
|
152
|
+
<template>
|
|
153
|
+
<ConfigProviders>
|
|
154
|
+
<router-view />
|
|
155
|
+
</ConfigProviders>
|
|
156
|
+
</template>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### CopyButton
|
|
160
|
+
|
|
161
|
+
复制按钮。
|
|
162
|
+
|
|
163
|
+
```vue
|
|
164
|
+
<template>
|
|
165
|
+
<CopyButton value="要复制的内容" />
|
|
166
|
+
</template>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### DataTablePlus
|
|
170
|
+
|
|
171
|
+
增强型数据表格。
|
|
172
|
+
|
|
173
|
+
```vue
|
|
174
|
+
<script setup>
|
|
175
|
+
import { DataTablePlus } from '@oiij/naive-ui'
|
|
176
|
+
|
|
177
|
+
const columns = [
|
|
178
|
+
{ title: '姓名', key: 'name' },
|
|
179
|
+
{ title: '年龄', key: 'age' }
|
|
81
180
|
]
|
|
82
181
|
|
|
83
|
-
|
|
182
|
+
async function fetchData(params) {
|
|
183
|
+
return await api.getUsers(params)
|
|
184
|
+
}
|
|
84
185
|
</script>
|
|
85
186
|
|
|
86
187
|
<template>
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
188
|
+
<DataTablePlus
|
|
189
|
+
:api="fetchData"
|
|
190
|
+
:columns="columns"
|
|
191
|
+
:search="true"
|
|
192
|
+
:pagination="true"
|
|
193
|
+
/>
|
|
90
194
|
</template>
|
|
91
195
|
```
|
|
92
196
|
|
|
93
|
-
|
|
197
|
+
### LoadingProvider
|
|
198
|
+
|
|
199
|
+
加载状态提供者。
|
|
200
|
+
|
|
201
|
+
```vue
|
|
202
|
+
<script setup>
|
|
203
|
+
import { LoadingProvider, useLoading } from '@oiij/naive-ui'
|
|
204
|
+
|
|
205
|
+
const loading = useLoading()
|
|
206
|
+
</script>
|
|
207
|
+
|
|
208
|
+
<template>
|
|
209
|
+
<LoadingProvider :show="false" />
|
|
210
|
+
</template>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### PresetForm
|
|
214
|
+
|
|
215
|
+
预设表单。
|
|
216
|
+
|
|
217
|
+
```vue
|
|
218
|
+
<script setup>
|
|
219
|
+
import { PresetForm } from '@oiij/naive-ui'
|
|
220
|
+
import { ref } from 'vue'
|
|
221
|
+
|
|
222
|
+
const values = ref({ name: '', age: null })
|
|
223
|
+
const options = [
|
|
224
|
+
{ key: 'name', label: '姓名', type: 'input' },
|
|
225
|
+
{ key: 'age', label: '年龄', type: 'input-number' }
|
|
226
|
+
]
|
|
227
|
+
</script>
|
|
228
|
+
|
|
229
|
+
<template>
|
|
230
|
+
<PresetForm v-model:values="values" :options="options" />
|
|
231
|
+
</template>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### PresetInput
|
|
235
|
+
|
|
236
|
+
预设输入框。
|
|
237
|
+
|
|
238
|
+
```vue
|
|
239
|
+
<script setup>
|
|
240
|
+
import { PresetInput } from '@oiij/naive-ui'
|
|
241
|
+
import { ref } from 'vue'
|
|
242
|
+
|
|
243
|
+
const value = ref('')
|
|
244
|
+
const options = { type: 'input', props: { placeholder: '请输入' } }
|
|
245
|
+
</script>
|
|
246
|
+
|
|
247
|
+
<template>
|
|
248
|
+
<PresetInput v-model:value="value" :options="options" />
|
|
249
|
+
</template>
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### PresetSelect
|
|
253
|
+
|
|
254
|
+
远程选择器。
|
|
255
|
+
|
|
256
|
+
```vue
|
|
257
|
+
<script setup>
|
|
258
|
+
import { PresetSelect } from '@oiij/naive-ui'
|
|
259
|
+
import { ref } from 'vue'
|
|
260
|
+
|
|
261
|
+
const value = ref('')
|
|
262
|
+
</script>
|
|
263
|
+
|
|
264
|
+
<template>
|
|
265
|
+
<PresetSelect
|
|
266
|
+
v-model:value="value"
|
|
267
|
+
:api="fetchUsers"
|
|
268
|
+
:option-format="(row) => ({ label: row.name, value: row.id })"
|
|
269
|
+
/>
|
|
270
|
+
</template>
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### SearchInput
|
|
274
|
+
|
|
275
|
+
搜索输入框。
|
|
276
|
+
|
|
277
|
+
```vue
|
|
278
|
+
<script setup>
|
|
279
|
+
import { SearchInput } from '@oiij/naive-ui'
|
|
280
|
+
import { ref } from 'vue'
|
|
281
|
+
|
|
282
|
+
const keyword = ref('')
|
|
283
|
+
</script>
|
|
284
|
+
|
|
285
|
+
<template>
|
|
286
|
+
<SearchInput v-model:value="keyword" placeholder="搜索" />
|
|
287
|
+
</template>
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### ToggleInput
|
|
291
|
+
|
|
292
|
+
切换输入框。
|
|
293
|
+
|
|
294
|
+
```vue
|
|
295
|
+
<script setup>
|
|
296
|
+
import { ToggleInput } from '@oiij/naive-ui'
|
|
297
|
+
import { ref } from 'vue'
|
|
298
|
+
|
|
299
|
+
const value = ref('双击编辑')
|
|
300
|
+
</script>
|
|
301
|
+
|
|
302
|
+
<template>
|
|
303
|
+
<ToggleInput v-model:value="value" />
|
|
304
|
+
</template>
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### TooltipButton
|
|
308
|
+
|
|
309
|
+
提示按钮。
|
|
310
|
+
|
|
311
|
+
```vue
|
|
312
|
+
<template>
|
|
313
|
+
<TooltipButton value="点击查看详情" :button-props="{ type: 'primary' }">
|
|
314
|
+
查看
|
|
315
|
+
</TooltipButton>
|
|
316
|
+
</template>
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Transition
|
|
320
|
+
|
|
321
|
+
过渡动画。
|
|
322
|
+
|
|
323
|
+
```vue
|
|
324
|
+
<template>
|
|
325
|
+
<Transition name="fade">
|
|
326
|
+
<div v-if="show">
|
|
327
|
+
内容
|
|
328
|
+
</div>
|
|
329
|
+
</Transition>
|
|
330
|
+
</template>
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
## API
|
|
334
|
+
|
|
335
|
+
### `useNaiveMenu(routes, options?)`
|
|
336
|
+
|
|
337
|
+
将路由配置转换为菜单配置。
|
|
338
|
+
|
|
339
|
+
#### 参数
|
|
340
|
+
|
|
341
|
+
| 参数 | 类型 | 说明 |
|
|
342
|
+
| --------- | ------------------------------------ | ------------ |
|
|
343
|
+
| `routes` | `MaybeRefOrGetter<RouteRecordRaw[]>` | 路由配置数组 |
|
|
344
|
+
| `options` | `UseNaiveMenuOptions` | 配置选项 |
|
|
345
|
+
|
|
346
|
+
#### 返回值
|
|
347
|
+
|
|
348
|
+
| 属性 | 类型 | 说明 |
|
|
349
|
+
| ---------------------- | --------------------------- | -------------- |
|
|
350
|
+
| `menuOptions` | `ComputedRef<MenuOption[]>` | 菜单配置 |
|
|
351
|
+
| `flattenedMenuOptions` | `ComputedRef<MenuOption[]>` | 扁平化菜单配置 |
|
|
352
|
+
|
|
353
|
+
### `useDataRequest(api, options?)`
|
|
354
|
+
|
|
355
|
+
数据请求管理。
|
|
356
|
+
|
|
357
|
+
#### 参数
|
|
94
358
|
|
|
95
|
-
|
|
359
|
+
| 参数 | 类型 | 说明 |
|
|
360
|
+
| --------- | ----------------------- | -------- |
|
|
361
|
+
| `api` | `function` | 请求函数 |
|
|
362
|
+
| `options` | `UseDataRequestOptions` | 配置选项 |
|
|
96
363
|
|
|
97
|
-
|
|
98
|
-
- **use-data-request** 📡: 数据请求管理
|
|
99
|
-
- **use-loading** ⏳: 加载状态管理
|
|
100
|
-
- **use-naive-form** 📝: 表单管理
|
|
101
|
-
- **use-naive-theme** 🎨: 主题管理
|
|
364
|
+
#### 返回值
|
|
102
365
|
|
|
103
|
-
|
|
366
|
+
| 属性 | 类型 | 说明 |
|
|
367
|
+
| ------------ | ------------------ | -------- |
|
|
368
|
+
| `loading` | `Ref<boolean>` | 加载状态 |
|
|
369
|
+
| `data` | `Ref<D>` | 响应数据 |
|
|
370
|
+
| `list` | `ComputedRef<R[]>` | 列表数据 |
|
|
371
|
+
| `pagination` | `Ref<Pagination>` | 分页信息 |
|
|
372
|
+
| `run` | `function` | 执行请求 |
|
|
373
|
+
| `refresh` | `function` | 刷新请求 |
|
|
104
374
|
|
|
105
|
-
|
|
106
|
-
- **copy-button** 📋: 复制按钮
|
|
107
|
-
- **data-table-plus** 📊: 增强数据表格
|
|
108
|
-
- **loading-provider** ⏳: 加载状态提供者
|
|
109
|
-
- **preset-form** 📝: 预设表单
|
|
110
|
-
- **preset-input** 📱: 预设输入框
|
|
111
|
-
- **preset-picker** 📅: 预设选择器
|
|
112
|
-
- **preset-select** 🔽: 预设选择器
|
|
113
|
-
- **remote-request** 📡: 远程请求组件
|
|
114
|
-
- **search-input** 🔍: 搜索输入框
|
|
115
|
-
- **toggle-input** 🔄: 切换输入框
|
|
116
|
-
- **tooltip-button** 💬: 提示按钮
|
|
117
|
-
- **transition** 🔄: 过渡动画
|
|
118
|
-
- **type-writer** ⌨️: 打字机效果
|
|
375
|
+
### `useNaiveForm(formRef, value?, options?)`
|
|
119
376
|
|
|
120
|
-
|
|
377
|
+
表单管理。
|
|
121
378
|
|
|
122
|
-
|
|
379
|
+
#### 返回值
|
|
123
380
|
|
|
124
|
-
|
|
381
|
+
| 属性 | 类型 | 说明 |
|
|
382
|
+
| ----------- | ----------------------- | ---------- |
|
|
383
|
+
| `formRef` | `Ref<FormInst \| null>` | 表单引用 |
|
|
384
|
+
| `formValue` | `Ref<T>` | 表单值 |
|
|
385
|
+
| `formProps` | `object` | 表单 props |
|
|
386
|
+
| `validate` | `function` | 验证表单 |
|
|
387
|
+
| `resetForm` | `function` | 重置表单 |
|
|
125
388
|
|
|
126
|
-
|
|
389
|
+
### `useNaiveTheme(options?)`
|
|
127
390
|
|
|
128
|
-
|
|
129
|
-
2. 创建您的特性分支 (`git checkout -b feature/amazing-feature`) 🌿
|
|
130
|
-
3. 提交您的更改 (`git commit -m 'Add some amazing feature'`) 💾
|
|
131
|
-
4. 推送到分支 (`git push origin feature/amazing-feature`) 🚀
|
|
132
|
-
5. 打开一个 Pull Request 📥
|
|
391
|
+
主题管理。
|
|
133
392
|
|
|
134
|
-
|
|
393
|
+
#### 返回值
|
|
135
394
|
|
|
136
|
-
|
|
395
|
+
| 属性 | 类型 | 说明 |
|
|
396
|
+
| ---------------- | ----------------------------- | ------------ |
|
|
397
|
+
| `theme` | `ComputedRef<Theme>` | 当前主题 |
|
|
398
|
+
| `darkMode` | `Ref<boolean>` | 暗黑模式状态 |
|
|
399
|
+
| `themeOverrides` | `ComputedRef<ThemeOverrides>` | 主题覆盖 |
|
|
400
|
+
| `setColor` | `function` | 设置颜色 |
|
|
137
401
|
|
|
138
|
-
##
|
|
402
|
+
## 在线文档
|
|
139
403
|
|
|
140
|
-
|
|
404
|
+
[在线文档](https://oiij-use.vercel.app/naive-ui/naive-ui)
|
|
@@ -8,8 +8,8 @@ import { RowKey } from "naive-ui/es/data-table/src/interface";
|
|
|
8
8
|
//#region src/components/data-table-plus/DataTablePlus.vue.d.ts
|
|
9
9
|
declare const __VLS_export: <P extends DataObject, D extends DataObject, R extends DataObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
10
10
|
props: vue.PublicProps & __VLS_PrettifyLocal<DataTablePlusProps<P, D, R> & {
|
|
11
|
-
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
12
11
|
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
12
|
+
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
13
13
|
onClickRow?: ((row: R, index: number, event: MouseEvent, currentData: R[]) => any) | undefined;
|
|
14
14
|
onContextMenuRow?: ((row: R, index: number, event: MouseEvent, currentData: R[]) => any) | undefined;
|
|
15
15
|
"onUpdate:checkedRowKeys"?: ((keys: RowKey[], rows: R[], meta: {
|
|
@@ -7,14 +7,14 @@ import { SelectInst, SelectOption } from "naive-ui";
|
|
|
7
7
|
//#region src/components/preset-select/PresetSelect.vue.d.ts
|
|
8
8
|
declare const __VLS_export: <V extends PresetSelectValue, P extends DataObject, D extends DataObject, R extends DataObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
9
9
|
props: vue.PublicProps & __VLS_PrettifyLocal<PresetSelectProps<V, P, D, R> & {
|
|
10
|
-
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
11
10
|
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
11
|
+
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
12
12
|
"onUpdate:value"?: ((val: V | null, option: SelectOption | SelectOption[] | null, raw: R | R[] | null) => any) | undefined;
|
|
13
|
-
onSearch?: ((val: string) => any) | undefined;
|
|
14
13
|
onBefore?: ((params: P[]) => any) | undefined;
|
|
15
14
|
"onUpdate:page"?: ((page: number) => any) | undefined;
|
|
16
15
|
"onUpdate:pageSize"?: ((pageSize: number) => any) | undefined;
|
|
17
16
|
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
17
|
+
onSearch?: ((val: string) => any) | undefined;
|
|
18
18
|
"onUpdate:show"?: ((show: boolean) => any) | undefined;
|
|
19
19
|
}> & (typeof globalThis extends {
|
|
20
20
|
__VLS_PROPS_FALLBACK: infer P_1;
|
|
@@ -6,8 +6,8 @@ import * as vue from "vue";
|
|
|
6
6
|
//#region src/components/remote-request/RemoteRequest.vue.d.ts
|
|
7
7
|
declare const __VLS_export: <P extends DataObject, D extends DataObject, R extends DataObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
8
8
|
props: vue.PublicProps & __VLS_PrettifyLocal<RemoteRequestProps<P, D> & {
|
|
9
|
-
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
10
9
|
onSuccess?: ((data: D, params: P[]) => any) | undefined;
|
|
10
|
+
onError?: ((err: Error, params: P[]) => any) | undefined;
|
|
11
11
|
onBefore?: ((params: P[]) => any) | undefined;
|
|
12
12
|
onFinally?: ((params: P[], data?: D | undefined, err?: Error | undefined) => any) | undefined;
|
|
13
13
|
}> & (typeof globalThis extends {
|
|
@@ -59,7 +59,7 @@ declare function useDataRequest<P extends DataObject = DataObject, D extends Dat
|
|
|
59
59
|
loading: Readonly<vue.Ref<boolean, boolean>>;
|
|
60
60
|
data: Readonly<vue.Ref<D | undefined, D | undefined>>;
|
|
61
61
|
error: Readonly<vue.Ref<Error | undefined, Error | undefined>>;
|
|
62
|
-
params: Readonly<vue.Ref<
|
|
62
|
+
params: Readonly<vue.Ref<[] | P[], [] | P[]>>;
|
|
63
63
|
list: vue.ComputedRef<R[]>;
|
|
64
64
|
pagination: vue.Ref<{
|
|
65
65
|
page: number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oiij/naive-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.82",
|
|
5
5
|
"description": "Some Composable Functions And Components for Vue 3",
|
|
6
6
|
"author": "oiij",
|
|
7
7
|
"license": "MIT",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"vue-component-type-helpers": "^3.2.6",
|
|
47
47
|
"vue-hooks-plus": "^2.4.3",
|
|
48
48
|
"vue-router": "^5.0.3",
|
|
49
|
-
"@oiij/css-render": "0.0.
|
|
50
|
-
"@oiij/use": "0.0.
|
|
49
|
+
"@oiij/css-render": "0.0.13",
|
|
50
|
+
"@oiij/use": "0.0.51"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/prismjs": "^1.26.6",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"vue-component-type-helpers": "^3.2.6",
|
|
62
62
|
"vue-hooks-plus": "^2.4.3",
|
|
63
63
|
"vue-router": "^5.0.3",
|
|
64
|
-
"@oiij/css-render": "0.0.
|
|
65
|
-
"@oiij/use": "0.0.
|
|
64
|
+
"@oiij/css-render": "0.0.13",
|
|
65
|
+
"@oiij/use": "0.0.51"
|
|
66
66
|
},
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|