@oiij/naive-ui 0.0.80 → 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/_virtual/_/plugin-vue/export-helper.js +1 -2
- package/dist/components/_utils/cssr-bem.js +1 -3
- package/dist/components/config-providers/ConfigProviders.js +3 -6
- package/dist/components/config-providers/ConfigProviders.vue.d.ts +2 -2
- package/dist/components/config-providers/index.d.ts +0 -1
- package/dist/components/copy-button/CopyButton.js +3 -6
- package/dist/components/copy-button/CopyButton.vue.d.ts +4 -4
- package/dist/components/data-table-plus/DataTablePlus.js +3 -6
- package/dist/components/data-table-plus/DataTablePlus.vue.d.ts +38 -39
- package/dist/components/icons/MageCopyFill.js +1 -3
- package/dist/components/icons/MageMultiplyCircleFill.js +1 -3
- package/dist/components/icons/MageSearch.js +1 -3
- package/dist/components/index.d.ts +0 -1
- package/dist/components/loading-provider/LoadingProvider.js +3 -6
- package/dist/components/loading-provider/LoadingProvider.vue.d.ts +2 -2
- package/dist/components/loading-provider/index.js +2 -4
- package/dist/components/loading-provider/loading-provider.cssr.js +1 -3
- package/dist/components/preset-form/PresetForm.js +7 -9
- package/dist/components/preset-form/PresetForm.vue.d.ts +21 -18
- package/dist/components/preset-form/_utils.js +1 -2
- package/dist/components/preset-input/PresetInput.js +3 -6
- package/dist/components/preset-input/PresetInput.vue.d.ts +3 -3
- package/dist/components/preset-picker/PresetPicker.js +1 -4
- package/dist/components/preset-picker/PresetPicker.vue.d.ts +4 -4
- package/dist/components/preset-select/PresetSelect.js +1 -4
- package/dist/components/preset-select/PresetSelect.vue.d.ts +29 -29
- package/dist/components/remote-request/RemoteRequest.js +1 -4
- package/dist/components/remote-request/RemoteRequest.vue.d.ts +11 -11
- package/dist/components/search-input/SearchInput.js +1 -4
- package/dist/components/search-input/SearchInput.vue.d.ts +4 -4
- package/dist/components/toggle-input/ToggleInput.js +1 -4
- package/dist/components/toggle-input/ToggleInput.vue.d.ts +5 -5
- package/dist/components/tooltip-button/TooltipButton.js +1 -4
- package/dist/components/tooltip-button/TooltipButton.vue.d.ts +4 -4
- package/dist/components/transition/BaseTransition.js +1 -4
- package/dist/components/transition/BaseTransition.vue.d.ts +2 -2
- package/dist/components/transition/transition.cssr.js +1 -3
- package/dist/components.d.ts +0 -1
- package/dist/components.js +14 -15
- package/dist/composables/_helper.js +1 -3
- package/dist/composables/use-data-request.d.ts +7 -7
- package/dist/composables/use-data-request.js +1 -3
- package/dist/composables/use-loading.js +1 -3
- package/dist/composables/use-naive-form.d.ts +7 -6
- package/dist/composables/use-naive-form.js +15 -14
- package/dist/composables/use-naive-menu.d.ts +3 -3
- package/dist/composables/use-naive-menu.js +1 -3
- package/dist/composables/use-naive-theme.js +1 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -2
- package/package.json +20 -20
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)
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _sfc_main$1 from "../loading-provider/LoadingProvider.js";
|
|
2
2
|
import { useLoading } from "../../composables/use-loading.js";
|
|
3
3
|
import { createBlock, createCommentVNode, createVNode, defineComponent, guardReactiveProps, normalizeProps, onMounted, openBlock, renderSlot, unref, withCtx } from "vue";
|
|
4
4
|
import { NConfigProvider, NDialogProvider, NGlobalStyle, NLoadingBarProvider, NMessageProvider, NModalProvider, NNotificationProvider, useDialog, useLoadingBar, useMessage, useModal, useNotification } from "naive-ui";
|
|
5
|
-
|
|
6
5
|
//#region src/components/config-providers/ConfigProviders.vue
|
|
7
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
7
|
__name: "ConfigProviders",
|
|
@@ -41,7 +40,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
40
|
return (_ctx, _cache) => {
|
|
42
41
|
return openBlock(), createBlock(unref(NConfigProvider), normalizeProps(guardReactiveProps(__props.configProviderProps)), {
|
|
43
42
|
default: withCtx(() => [createVNode(unref(NLoadingBarProvider), normalizeProps(guardReactiveProps(__props.loadingBarProviderProps)), {
|
|
44
|
-
default: withCtx(() => [createVNode(unref(
|
|
43
|
+
default: withCtx(() => [createVNode(unref(_sfc_main$1), normalizeProps(guardReactiveProps(__props.loadingProviderProps)), {
|
|
45
44
|
default: withCtx(() => [createVNode(unref(NDialogProvider), normalizeProps(guardReactiveProps(__props.dialogProviderProps)), {
|
|
46
45
|
default: withCtx(() => [createVNode(unref(NModalProvider), normalizeProps(guardReactiveProps(__props.modalProviderProps)), {
|
|
47
46
|
default: withCtx(() => [createVNode(unref(NNotificationProvider), normalizeProps(guardReactiveProps(__props.notificationProviderProps)), {
|
|
@@ -64,7 +63,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
64
63
|
};
|
|
65
64
|
}
|
|
66
65
|
});
|
|
67
|
-
var ConfigProviders_default = _sfc_main;
|
|
68
|
-
|
|
69
66
|
//#endregion
|
|
70
|
-
export {
|
|
67
|
+
export { _sfc_main as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ConfigProvidersProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/config-providers/ConfigProviders.vue.d.ts
|
|
5
5
|
declare var __VLS_44: {};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
7
|
default?: (props: typeof __VLS_44) => any;
|
|
8
8
|
};
|
|
9
|
-
declare const __VLS_base:
|
|
9
|
+
declare const __VLS_base: vue.DefineComponent<ConfigProvidersProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<ConfigProvidersProps> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
11
|
declare const _default: typeof __VLS_export;
|
|
12
12
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ClassStyle } from "../data-table-plus/index.js";
|
|
2
2
|
import { LoadingProviderProps } from "../loading-provider/index.js";
|
|
3
3
|
import { useLoading } from "../../composables/use-loading.js";
|
|
4
|
-
import "../../composables/index.js";
|
|
5
4
|
import { _default } from "./ConfigProviders.vue.js";
|
|
6
5
|
import { ConfigProviderProps, DialogProviderInst, DialogProviderProps, LoadingBarProviderInst, LoadingBarProviderProps, MessageProviderInst, MessageProviderProps, ModalProviderInst, ModalProviderProps, NotificationProviderInst, NotificationProviderProps } from "naive-ui";
|
|
7
6
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import MageCopyFill_default from "../icons/MageCopyFill.js";
|
|
2
|
-
import
|
|
2
|
+
import _sfc_main$1 from "../tooltip-button/TooltipButton.js";
|
|
3
3
|
import { useClipboard } from "@vueuse/core";
|
|
4
4
|
import { createBlock, createVNode, defineComponent, openBlock, renderSlot, unref, watch, withCtx } from "vue";
|
|
5
|
-
|
|
6
5
|
//#region src/components/copy-button/CopyButton.vue
|
|
7
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
7
|
__name: "CopyButton",
|
|
@@ -27,7 +26,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
26
|
copy();
|
|
28
27
|
}
|
|
29
28
|
return (_ctx, _cache) => {
|
|
30
|
-
return openBlock(), createBlock(unref(
|
|
29
|
+
return openBlock(), createBlock(unref(_sfc_main$1), {
|
|
31
30
|
tooltip: unref(copied) ? "复制成功" : "复制",
|
|
32
31
|
"tooltip-props": __props.tooltipProps,
|
|
33
32
|
"button-props": {
|
|
@@ -47,7 +46,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
47
46
|
};
|
|
48
47
|
}
|
|
49
48
|
});
|
|
50
|
-
var CopyButton_default = _sfc_main;
|
|
51
|
-
|
|
52
49
|
//#endregion
|
|
53
|
-
export {
|
|
50
|
+
export { _sfc_main as default };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { CopyButtonProps } from "./index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/copy-button/CopyButton.vue.d.ts
|
|
5
5
|
declare var __VLS_11: {};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
7
|
icon?: (props: typeof __VLS_11) => any;
|
|
8
8
|
};
|
|
9
|
-
declare const __VLS_base:
|
|
9
|
+
declare const __VLS_base: vue.DefineComponent<CopyButtonProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
10
10
|
copied: (v: string | undefined) => any;
|
|
11
|
-
}, string,
|
|
11
|
+
}, string, vue.PublicProps, Readonly<CopyButtonProps> & Readonly<{
|
|
12
12
|
onCopied?: ((v: string | undefined) => any) | undefined;
|
|
13
|
-
}>, {}, {}, {}, {}, string,
|
|
13
|
+
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
15
|
declare const _default: typeof __VLS_export;
|
|
16
16
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useDataRequest } from "../../composables/use-data-request.js";
|
|
2
|
-
import
|
|
2
|
+
import _sfc_main$1 from "../search-input/SearchInput.js";
|
|
3
3
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, reactive, ref, renderSlot, toDisplayString, toRaw, unref, useTemplateRef, watchEffect, withCtx } from "vue";
|
|
4
4
|
import { NDataTable, NFlex, NPagination } from "naive-ui";
|
|
5
|
-
|
|
6
5
|
//#region src/components/data-table-plus/DataTablePlus.vue
|
|
7
6
|
const _hoisted_1 = { style: {
|
|
8
7
|
height: "100%",
|
|
@@ -244,7 +243,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
244
243
|
renderSlot(_ctx.$slots, "header", normalizeProps(guardReactiveProps(templateBind.value)), () => [createVNode(unref(NFlex), null, {
|
|
245
244
|
default: withCtx(() => [
|
|
246
245
|
renderSlot(_ctx.$slots, "title", {}, () => [createElementVNode("div", _hoisted_1, [__props.title ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(__props.title), 1)) : createCommentVNode("v-if", true)])]),
|
|
247
|
-
__props.search ? (openBlock(), createBlock(unref(
|
|
246
|
+
__props.search ? (openBlock(), createBlock(unref(_sfc_main$1), mergeProps({
|
|
248
247
|
key: 0,
|
|
249
248
|
style: {
|
|
250
249
|
marginLeft: "auto",
|
|
@@ -317,7 +316,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
317
316
|
};
|
|
318
317
|
}
|
|
319
318
|
});
|
|
320
|
-
var DataTablePlus_default = _sfc_main;
|
|
321
|
-
|
|
322
319
|
//#endregion
|
|
323
|
-
export {
|
|
320
|
+
export { _sfc_main as default };
|