vue-color-ui 0.0.15 → 0.0.17
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 +228 -0
- package/lib/temp-color-ui.js +511 -505
- package/lib/temp-color-ui.umd.cjs +2 -2
- package/package.json +1 -1
- package/types/pkg/Base/Tag.vue.d.ts +3 -3
package/README.md
CHANGED
|
@@ -57,6 +57,43 @@ const navItems = [
|
|
|
57
57
|
|
|
58
58
|
[MIT](LICENSE)
|
|
59
59
|
|
|
60
|
+
## 颜色
|
|
61
|
+
|
|
62
|
+
### BgColorName 背景颜色类型
|
|
63
|
+
|
|
64
|
+
`BgColorName` 类型可以是以下颜色名称之一:
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
type ColorName =
|
|
68
|
+
| "red"
|
|
69
|
+
| "orange"
|
|
70
|
+
| "yellow"
|
|
71
|
+
| "olive"
|
|
72
|
+
| "green"
|
|
73
|
+
| "cyan"
|
|
74
|
+
| "blue"
|
|
75
|
+
| "purple"
|
|
76
|
+
| "mauve"
|
|
77
|
+
| "pink"
|
|
78
|
+
| "brown"
|
|
79
|
+
| "grey"
|
|
80
|
+
| "gray"
|
|
81
|
+
| "black"
|
|
82
|
+
| "white";
|
|
83
|
+
|
|
84
|
+
type GradientColorName =
|
|
85
|
+
| "gradual-red"
|
|
86
|
+
| "gradual-orange"
|
|
87
|
+
| "gradual-green"
|
|
88
|
+
| "gradual-purple"
|
|
89
|
+
| "gradual-pink"
|
|
90
|
+
| "gradual-blue";
|
|
91
|
+
|
|
92
|
+
type BgColorName = ColorName | GradientColorName;
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
60
97
|
## TNavBar组件使用文档
|
|
61
98
|
|
|
62
99
|
`TNavBar` 是一个全局注册的组件,用于创建底部或顶部导航栏。该组件支持图标、图片、徽标等多种元素,并允许自定义背景颜色和文本颜色。
|
|
@@ -175,3 +212,194 @@ const handleItemClick = (item, index) => {
|
|
|
175
212
|
| `badge` | `number` | 徽标数字(可选) |
|
|
176
213
|
| `path` | `string` | 导航项对应的路由路径 |
|
|
177
214
|
|
|
215
|
+
## TTag 组件使用文档
|
|
216
|
+
|
|
217
|
+
`TTag` 是一个用于显示标签的 Vue 组件,支持多种样式和自定义内容。
|
|
218
|
+
|
|
219
|
+
### 基本用法
|
|
220
|
+
|
|
221
|
+
```vue
|
|
222
|
+
<template>
|
|
223
|
+
<TTag>标签内容</TTag>
|
|
224
|
+
</template>
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### 属性
|
|
228
|
+
|
|
229
|
+
`TTag` 组件支持以下属性:
|
|
230
|
+
|
|
231
|
+
| 属性名 | 类型 | 默认值 | 描述 |
|
|
232
|
+
| ------- | ------------- | --------- | ------------------------------------------------- |
|
|
233
|
+
| `text` | `string` | `-` | 标签的文本内容 |
|
|
234
|
+
| `bg` | `BgColorName` | `blue` | 标签的背景颜色,支持颜色名称或渐变颜色名称 |
|
|
235
|
+
| `size` | `string` | `default` | 标签的大小,可选值有 `default`, `small`, `large` |
|
|
236
|
+
| `shape` | `string` | `default` | 标签的形状,可选值有 `default`, `radius`, `round` |
|
|
237
|
+
| `light` | `boolean` | `false` | 是否使用浅色背景 |
|
|
238
|
+
| `line` | `boolean` | `false` | 是否使用线条样式 |
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
### 示例
|
|
242
|
+
|
|
243
|
+
#### 基本标签
|
|
244
|
+
|
|
245
|
+
```vue
|
|
246
|
+
<template>
|
|
247
|
+
<TTag text="默认标签" />
|
|
248
|
+
</template>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
#### 不同背景颜色的标签
|
|
252
|
+
|
|
253
|
+
```vue
|
|
254
|
+
<template>
|
|
255
|
+
<TTag text="红色标签" bg="red" />
|
|
256
|
+
<TTag text="渐变橙色标签" bg="gradual-orange" />
|
|
257
|
+
</template>
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
#### 不同大小的标签
|
|
261
|
+
|
|
262
|
+
```vue
|
|
263
|
+
<template>
|
|
264
|
+
<TTag text="默认大小" size="default" />
|
|
265
|
+
<TTag text="小号标签" size="small" />
|
|
266
|
+
<TTag text="大号标签" size="large" />
|
|
267
|
+
</template>
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
#### 不同形状的标签
|
|
271
|
+
|
|
272
|
+
```vue
|
|
273
|
+
<template>
|
|
274
|
+
<TTag text="默认形状" shape="default" />
|
|
275
|
+
<TTag text="圆角标签" shape="radius" />
|
|
276
|
+
<TTag text="圆形标签" shape="round" />
|
|
277
|
+
</template>
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
#### 浅色背景的标签
|
|
281
|
+
|
|
282
|
+
```vue
|
|
283
|
+
<template>
|
|
284
|
+
<TTag text="浅色标签" light />
|
|
285
|
+
</template>
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
#### 线条样式的标签
|
|
289
|
+
|
|
290
|
+
```vue
|
|
291
|
+
<template>
|
|
292
|
+
<TTag text="线条标签" line />
|
|
293
|
+
</template>
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
#### 组合样式的标签
|
|
297
|
+
|
|
298
|
+
```vue
|
|
299
|
+
<template>
|
|
300
|
+
<TTag text="自定义标签" bg="purple" size="large" shape="round" light />
|
|
301
|
+
</template>
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## TTopBar 组件使用文档
|
|
305
|
+
|
|
306
|
+
### 属性
|
|
307
|
+
|
|
308
|
+
#### `title`
|
|
309
|
+
|
|
310
|
+
- 类型:`string`
|
|
311
|
+
- 描述:导航栏的标题文本。
|
|
312
|
+
|
|
313
|
+
#### `leftIcon`
|
|
314
|
+
|
|
315
|
+
- 类型:`IconName` (可选)
|
|
316
|
+
- 描述:左侧图标的名称。
|
|
317
|
+
|
|
318
|
+
#### `leftIconColor`
|
|
319
|
+
|
|
320
|
+
- 类型:`ColorName` (可选)
|
|
321
|
+
- 默认值:`gray`
|
|
322
|
+
- 描述:左侧图标的颜色。
|
|
323
|
+
|
|
324
|
+
#### `leftText`
|
|
325
|
+
|
|
326
|
+
- 类型:`string` (可选)
|
|
327
|
+
- 描述:左侧的文本。
|
|
328
|
+
|
|
329
|
+
#### `rightIcon`
|
|
330
|
+
|
|
331
|
+
- 类型:`IconName` (可选)
|
|
332
|
+
- 描述:右侧图标的名称。
|
|
333
|
+
|
|
334
|
+
#### `rightIconColor`
|
|
335
|
+
|
|
336
|
+
- 类型:`ColorName` (可选)
|
|
337
|
+
- 默认值:`gray`
|
|
338
|
+
- 描述:右侧图标的颜色。
|
|
339
|
+
|
|
340
|
+
#### `bg`
|
|
341
|
+
|
|
342
|
+
- 类型:`ColorName` (可选)
|
|
343
|
+
- 默认值:`white`
|
|
344
|
+
- 描述:导航栏的背景颜色。
|
|
345
|
+
|
|
346
|
+
#### `avatarUrl`
|
|
347
|
+
|
|
348
|
+
- 类型:`string` (可选)
|
|
349
|
+
- 描述:头像的 URL。
|
|
350
|
+
|
|
351
|
+
### 示例
|
|
352
|
+
|
|
353
|
+
#### 示例 1:简单的操作条
|
|
354
|
+
|
|
355
|
+
```vue
|
|
356
|
+
<template>
|
|
357
|
+
<TTopBar
|
|
358
|
+
title="操作条"
|
|
359
|
+
leftIcon="back"
|
|
360
|
+
leftText="返回"
|
|
361
|
+
leftIconColor="gray"
|
|
362
|
+
bg="white"
|
|
363
|
+
/>
|
|
364
|
+
</template>
|
|
365
|
+
|
|
366
|
+
<script setup lang="ts">
|
|
367
|
+
import TTopBar from './components/TTopBar.vue';
|
|
368
|
+
</script>
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
#### 示例 2:海蓝主题
|
|
372
|
+
|
|
373
|
+
```
|
|
374
|
+
<template>
|
|
375
|
+
<TTopBar
|
|
376
|
+
title="海蓝"
|
|
377
|
+
leftIcon="close"
|
|
378
|
+
leftText="关闭"
|
|
379
|
+
leftIconColor="white"
|
|
380
|
+
bg="blue"
|
|
381
|
+
/>
|
|
382
|
+
</template>
|
|
383
|
+
|
|
384
|
+
<script setup lang="ts">
|
|
385
|
+
import TTopBar from './components/TTopBar.vue';
|
|
386
|
+
</script>
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
#### 示例 3:带头像和右侧图标的导航栏
|
|
390
|
+
|
|
391
|
+
```vue
|
|
392
|
+
<template>
|
|
393
|
+
<TTopBar
|
|
394
|
+
title="ColorUI"
|
|
395
|
+
bg="black"
|
|
396
|
+
avatarUrl="https://ossweb-img.qq.com/images/lol/web201310/skin/big91012.jpg"
|
|
397
|
+
rightIcon="more"
|
|
398
|
+
rightIconColor="white"
|
|
399
|
+
/>
|
|
400
|
+
</template>
|
|
401
|
+
|
|
402
|
+
<script setup lang="ts">
|
|
403
|
+
import TTopBar from './components/TTopBar.vue';
|
|
404
|
+
</script>
|
|
405
|
+
```
|