Skip to content

Commit 1245f07

Browse files
author
Tenny
committed
Squashed commit of the following:
commit 8b07d66 Author: Tenny <tenny.shu@foxmail.com> Date: Mon Oct 21 11:49:52 2024 +0800 fix(SelectOri): 修复选择框 ts 类型错误 commit 2009296 Author: Tenny <tenny.shu@foxmail.com> Date: Mon Oct 21 11:48:17 2024 +0800 fix(Image): 修复无法传递自定义样式、支持自定义fallback commit 9f67504 Author: Tenny <joel.shu@qq.com> Date: Mon Oct 21 01:04:16 2024 +0800 fix(Card): 修复暗黑模式下样式显示异常 Signed-off-by: Tenny <joel.shu@qq.com> commit 011a02e Author: Tenny <joel.shu@qq.com> Date: Sun Oct 20 21:38:40 2024 +0800 fix(Button): 修复暗黑模式下样式显示异常 Signed-off-by: Tenny <joel.shu@qq.com> commit 8a9ad64 Author: Tenny <joel.shu@qq.com> Date: Sun Oct 20 18:54:39 2024 +0800 refactor(Popover): 优化代码 Signed-off-by: Tenny <joel.shu@qq.com> commit 5058450 Author: Tenny <joel.shu@qq.com> Date: Thu Oct 17 23:01:51 2024 +0800 docs: 修复文档错误 Signed-off-by: Tenny <joel.shu@qq.com>
1 parent d8a4ad3 commit 1245f07

File tree

19 files changed

+500
-289
lines changed

19 files changed

+500
-289
lines changed

docs/.vitepress/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ export default defineConfig({
5858
text: '工具样式',
5959
link: '/css-util',
6060
},
61+
{
62+
text: '暗黑模式',
63+
link: '/dark',
64+
},
6165
],
6266
},
6367
{

docs/components/card.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { Card, Button } from '../../src'
1818
<div>卡片内容</div>
1919
</template>
2020
<template v-slot:header-extra>
21-
<nt-button type="text">按钮</nt-button>
21+
<nt-button text>按钮</nt-button>
2222
</template>
2323
</nt-card>
2424
</textarea>
@@ -28,7 +28,7 @@ import { Card, Button } from '../../src'
2828
<div>卡片内容</div>
2929
</template>
3030
<template v-slot:header-extra>
31-
<Button type="text">按钮</Button>
31+
<Button text>按钮</Button>
3232
</template>
3333
</Card>
3434
</template>
@@ -68,7 +68,7 @@ import { Card, Button } from '../../src'
6868
<div>卡片内容</div>
6969
</template>
7070
<template v-slot:header-extra>
71-
<nt-button type="text">按钮</nt-button>
71+
<nt-button text>按钮</nt-button>
7272
</template>
7373
</nt-card>
7474
</textarea>
@@ -78,7 +78,7 @@ import { Card, Button } from '../../src'
7878
<div>卡片内容</div>
7979
</template>
8080
<template v-slot:header-extra>
81-
<Button type="text">按钮</Button>
81+
<Button text type="primary">按钮</Button>
8282
</template>
8383
</Card>
8484
</template>
@@ -99,7 +99,7 @@ import { Card, Button } from '../../src'
9999
<div>卡片内容</div>
100100
</template>
101101
<template v-slot:header-extra>
102-
<nt-button type="text">按钮</nt-button>
102+
<nt-button text>按钮</nt-button>
103103
</template>
104104
<template v-slot:footer>
105105
<span style="color: orange">卡片标题</span>
@@ -115,7 +115,7 @@ import { Card, Button } from '../../src'
115115
<div>卡片内容</div>
116116
</template>
117117
<template v-slot:header-extra>
118-
<Button type="text">按钮</Button>
118+
<Button text>按钮</Button>
119119
</template>
120120
<template v-slot:footer>
121121
<span style="color: orange">卡片标题</span>
@@ -139,23 +139,23 @@ import { Card, Button } from '../../src'
139139
<div>卡片内容1</div>
140140
</template>
141141
<template v-slot:header-extra>
142-
<nt-button type="text">按钮</nt-button>
142+
<nt-button text>按钮</nt-button>
143143
</template>
144144
</nt-card>
145145
<nt-card header-text="卡片标题2">
146146
<template v-slot:default>
147147
<div>卡片内容2</div>
148148
</template>
149149
<template v-slot:header-extra>
150-
<nt-button type="text">按钮</nt-button>
150+
<nt-button text>按钮</nt-button>
151151
</template>
152152
</nt-card>
153153
<nt-card header-text="卡片标题3">
154154
<template v-slot:default>
155155
<div>卡片内容3</div>
156156
</template>
157157
<template v-slot:header-extra>
158-
<nt-button type="text">按钮</nt-button>
158+
<nt-button text>按钮</nt-button>
159159
</template>
160160
</nt-card>
161161
</div>
@@ -167,23 +167,23 @@ import { Card, Button } from '../../src'
167167
<div>卡片内容1</div>
168168
</template>
169169
<template v-slot:header-extra>
170-
<Button type="text">按钮</Button>
170+
<Button text>按钮</Button>
171171
</template>
172172
</Card>
173173
<Card header-text="卡片标题2">
174174
<template v-slot:default>
175175
<div>卡片内容2</div>
176176
</template>
177177
<template v-slot:header-extra>
178-
<Button type="text">按钮</Button>
178+
<Button text>按钮</Button>
179179
</template>
180180
</Card>
181181
<Card header-text="卡片标题3">
182182
<template v-slot:default>
183183
<div>卡片内容3</div>
184184
</template>
185185
<template v-slot:header-extra>
186-
<Button type="text">按钮</Button>
186+
<Button text>按钮</Button>
187187
</template>
188188
</Card>
189189
</div>

docs/components/icon.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,4 @@ import IconList from '../../src/app_components/IconList.vue'
7272
- 推荐图标库:[iconify](https://iconify.design/) 它提供了超过 200000 个开源图标。
7373
- 两种方式可以使用 `iconify`: [@iconify/vue](https://www.npmjs.com/package/@iconify/vue)[unplugin-icons](https://github.com/unplugin/unplugin-icons)
7474
- 推荐使用 [unplugin-icons](https://github.com/unplugin/unplugin-icons) 既能离线加载,也能自定义图标
75+
- 其它图标库: [Lucide](https://lucide.dev/)

docs/components/image.md

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const imgs = [
2222
<ClientOnly>
2323
<CodePreview class="mt-15">
2424
<textarea lang="vue-html">
25-
<nt-image src="https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg" width="100"></nt-image>
25+
<nt-image src="https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg" width="100px"></nt-image>
2626
</textarea>
2727
</CodePreview>
2828
</ClientOnly>
@@ -34,41 +34,41 @@ const imgs = [
3434
<ClientOnly>
3535
<CodePreview>
3636
<textarea lang="vue-html">
37-
<nt-image src="/neatui-vue/img1.svg" width="100" height="100" fit="fill"></nt-image>
38-
<nt-image src="/neatui-vue/img1.svg" width="100" height="100" fit="contain"></nt-image>
39-
<nt-image src="/neatui-vue/img1.svg" width="100" height="100" fit="cover"></nt-image>
40-
<nt-image src="/neatui-vue/img1.svg" width="100" height="100" fit="none"></nt-image>
41-
<nt-image src="/neatui-vue/img1.svg" width="100" height="100" fit="scale-down"></nt-image>
37+
<nt-image src="/neatui-vue/img1.svg" width="100px" height="100px" fit="fill"></nt-image>
38+
<nt-image src="/neatui-vue/img1.svg" width="100px" height="100px" fit="contain"></nt-image>
39+
<nt-image src="/neatui-vue/img1.svg" width="100px" height="100px" fit="cover"></nt-image>
40+
<nt-image src="/neatui-vue/img1.svg" width="100px" height="100px" fit="none"></nt-image>
41+
<nt-image src="/neatui-vue/img1.svg" width="100px" height="100px" fit="scale-down"></nt-image>
4242
</textarea>
4343
<template #preview>
4444
<div class="grid grid-cols-5">
4545
<Tooltip content="被替换的内容正好填充元素的内容框。整个对象将完全填充此框。如果对象的宽高比与内容框不相匹配,那么该对象将被拉伸以适应内容框">
4646
<div class="demo-img-item">
47-
<Image src="/neatui-vue/img1.svg" width="100" height="100" fit="fill"></Image>
47+
<Image src="/neatui-vue/img1.svg" width="100px" height="100px" fit="fill"></Image>
4848
<span class="mt-15">fill</span>
4949
</div>
5050
</Tooltip>
5151
<Tooltip content="被替换的内容将被缩放,以在填充元素的内容框时保持其宽高比。整个对象在填充盒子的同时保留其长宽比">
5252
<div class="demo-img-item">
53-
<Image src="/neatui-vue/img1.svg" width="100" height="100" fit="contain"></Image>
53+
<Image src="/neatui-vue/img1.svg" width="100px" height="100px" fit="contain"></Image>
5454
<span class="mt-15">contain</span>
5555
</div>
5656
</Tooltip>
5757
<Tooltip content="被替换的内容在保持其宽高比的同时填充元素的整个内容框。如果对象的宽高比与内容框不相匹配,该对象将被剪裁以适应内容框">
5858
<div class="demo-img-item">
59-
<Image src="/neatui-vue/img1.svg" width="100" height="100" fit="cover"></Image>
59+
<Image src="/neatui-vue/img1.svg" width="100px" height="100px" fit="cover"></Image>
6060
<span class="mt-15">cover</span>
6161
</div>
6262
</Tooltip>
6363
<Tooltip content="被替换的内容将保持其原有的尺寸">
6464
<div class="demo-img-item">
65-
<Image src="/neatui-vue/img1.svg" width="100" height="100" fit="none"></Image>
65+
<Image src="/neatui-vue/img1.svg" width="100px" height="100px" fit="none"></Image>
6666
<span class="mt-15">none</span>
6767
</div>
6868
</Tooltip>
6969
<Tooltip content="内容的尺寸与 none 或 contain 中的一个相同,取决于它们两个之间谁得到的对象尺寸会更小一些">
7070
<div class="demo-img-item">
71-
<Image src="/neatui-vue/img1.svg" width="100" height="100" fit="scale-down"></Image>
71+
<Image src="/neatui-vue/img1.svg" width="100px" height="100px" fit="scale-down"></Image>
7272
<span class="mt-15">scale-down</span>
7373
</div>
7474
</Tooltip>
@@ -84,25 +84,47 @@ const imgs = [
8484
<ClientOnly>
8585
<CodePreview>
8686
<textarea lang="vue-html">
87-
<nt-image src="/neatui-vue/img2.svg" width="100" height="100" placeholder="/neatui-vue/img_loading.png"></nt-image>
87+
<nt-image src="/neatui-vue/img2.svg" width="100px" height="100px" placeholder="/neatui-vue/img_loading.png"></nt-image>
8888
</textarea>
8989
<template #preview>
90-
<Image src="/neatui-vue/img2.svg" width="100" height="100" placeholder="/neatui-vue/img_loading.png"></Image>
90+
<Image src="/neatui-vue/img2.svg" width="100px" height="100px" placeholder="/neatui-vue/img_loading.png"></Image>
9191
</template>
9292
</CodePreview>
9393
</ClientOnly>
9494

9595
### 加载失败
9696

97-
加载失败显示图像占位符
97+
通过配置 `fallback` 配置加载失败显示图像占位符; 也可以传递 `custom-fallback` 启用自定义加载失败占位符, 然后配置 `slot-fallback` 来自定义加载失败显示.
9898

9999
<ClientOnly>
100100
<CodePreview>
101101
<textarea lang="vue-html">
102-
<nt-image src="/neatui-vue/img3.svg" width="100" height="100" placeholder="/neatui-vue/loading_error.png"></nt-image>
102+
<nt-image src="/neatui-vue/img3.svg" width="100px" height="100px" fallback="/neatui-vue/loading_error.png"></nt-image>
103+
<nt-image
104+
src="/neatui-vue/img3.svg"
105+
width="100px"
106+
height="100px"
107+
custom-fallback
108+
class="ml-10"
109+
>
110+
<template #fallback>
111+
<div style="height: 100%;background-color: gray;display:flex;justify-content:center;align-items:center;color:#fff;">Error</div>
112+
</template>
113+
</nt-image>
103114
</textarea>
104115
<template #preview>
105-
<Image src="/neatui-vue/img3.svg" width="100" height="100" placeholder="/neatui-vue/loading_error.png"></Image>
116+
<Image src="/neatui-vue/img3.svg" width="100px" height="100px" fallback="/neatui-vue/loading_error.png"></Image>
117+
<Image
118+
src="/neatui-vue/img3.svg"
119+
width="100px"
120+
height="100px"
121+
custom-fallback
122+
class="ml-10"
123+
>
124+
<template #fallback>
125+
<div style="height: 100%;background-color: gray;display:flex;justify-content:center;align-items:center;color:#fff;">Error</div>
126+
</template>
127+
</Image>
106128
</template>
107129
</CodePreview>
108130
</ClientOnly>
@@ -114,10 +136,10 @@ const imgs = [
114136
<ClientOnly>
115137
<CodePreview>
116138
<textarea lang="vue-html">
117-
<nt-image src="/neatui-vue/img2.svg" width="100" height="100" preview-disable></nt-image>
139+
<nt-image src="/neatui-vue/img2.svg" width="100px" height="100px" preview-disable></nt-image>
118140
</textarea>
119141
<template #preview>
120-
<Image src="/neatui-vue/img2.svg" width="100" height="100" preview-disable></Image>
142+
<Image src="/neatui-vue/img2.svg" width="100px" height="100px" preview-disable></Image>
121143
</template>
122144
</CodePreview>
123145
</ClientOnly>
@@ -138,11 +160,11 @@ const imgs = [
138160
</script>
139161
140162
<template>
141-
<nt-image v-for="src,index in imgs" :key="index" :src="src" :preview-src-list="imgs" :initial-index="index" width="100"></nt-image>
163+
<nt-image v-for="src,index in imgs" :key="index" :src="src" :preview-src-list="imgs" :initial-index="index" width="100px"></nt-image>
142164
</template>
143165
</textarea>
144166
<template #preview>
145-
<Image v-for="src,index in imgs" :key="index" :src="src" :preview-src-list="imgs" :initial-index="index" width="100"></Image>
167+
<Image v-for="src,index in imgs" :key="index" :src="src" :preview-src-list="imgs" :initial-index="index" width="100px"></Image>
146168
</template>
147169
</CodePreview>
148170
</ClientOnly>
@@ -154,10 +176,10 @@ const imgs = [
154176
<ClientOnly>
155177
<CodePreview>
156178
<textarea lang="vue-html">
157-
<nt-image src="/neatui-vue/img2.svg" width="100" height="100" loading="lazy"></nt-image>
179+
<nt-image src="/neatui-vue/img2.svg" width="100px" height="100px" loading="lazy"></nt-image>
158180
</textarea>
159181
<template #preview>
160-
<Image src="/neatui-vue/img2.svg" width="100" height="100" loading="lazy"></Image>
182+
<Image src="/neatui-vue/img2.svg" width="100px" height="100px" loading="lazy"></Image>
161183
</template>
162184
</CodePreview>
163185
</ClientOnly>

0 commit comments

Comments
 (0)