Skip to content

Commit dc366cc

Browse files
committed
剔除Vuetify
1 parent 9340a97 commit dc366cc

7 files changed

Lines changed: 146 additions & 45 deletions

File tree

docs/.vitepress/config.mts

Lines changed: 107 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,112 @@ export default defineConfig({
105105
{
106106
text: '控制元素',
107107
link: '/documentation/section_controls',
108-
items: []
108+
items: [
109+
{
110+
text: '按钮 Button',
111+
link: '/documentation/elements/button',
112+
},
113+
{
114+
text: '按钮组 Button Group',
115+
link: '/documentation/elements/button_group',
116+
},
117+
{
118+
text: '下拉按钮 Dropdown Button',
119+
link: '/documentation/elements/button_dropdown',
120+
},
121+
{
122+
text: '浮动按钮 FAB',
123+
link: '/documentation/elements/fab',
124+
},
125+
{
126+
text: '标签 Badge',
127+
link: '/documentation/elements/badge',
128+
},
129+
{
130+
text: '小标签 Chip',
131+
link: '/documentation/elements/chip',
132+
},
133+
{
134+
text: '切换器 Toggle',
135+
link: '/documentation/elements/toggle',
136+
},
137+
{
138+
text: '单项选择器 Radio Selection',
139+
link: '/documentation/elements/radio',
140+
},
141+
{
142+
text: '下拉选择器 Dropdown Selection',
143+
link: '/documentation/elements/select',
144+
},
145+
{
146+
text: '芯片输入器 Input Chips',
147+
link: '/documentation/elements/input_chips',
148+
},
149+
{
150+
text: '复选框 Checkbox',
151+
link: '/documentation/elements/checkbox',
152+
},
153+
{
154+
text: '开关 Switch',
155+
link: '/documentation/elements/switch',
156+
},
157+
{
158+
text: '滑块 Slider',
159+
link: '/documentation/elements/slider',
160+
},
161+
{
162+
text: '范围选择器 Range',
163+
link: '/documentation/elements/range',
164+
},
165+
{
166+
text: '评分 Rating',
167+
link: '/documentation/elements/rating',
168+
},
169+
{
170+
text: '虚拟摇杆 Joystick',
171+
link: '/documentation/elements/joystick',
172+
},
173+
{
174+
text: '文本输入框 Text Input',
175+
link: '/documentation/elements/input',
176+
},
177+
{
178+
text: '多行文本输入框 Textarea',
179+
link: '/documentation/elements/textarea',
180+
},
181+
{
182+
text: '代码编辑器 CodeMirror',
183+
link: '/documentation/elements/codemirror',
184+
},
185+
{
186+
text: '数字输入器 Number Input',
187+
link: '/documentation/elements/number',
188+
},
189+
{
190+
text: '旋钮 Knob',
191+
link: '/documentation/elements/knob',
192+
},
193+
{
194+
text: '颜色输入器 Color Input',
195+
link: '/documentation/elements/color_input',
196+
},
197+
{
198+
text: '颜色选择器 Color Picker',
199+
link: '/documentation/section_controls#颜色选择器-color-picker',
200+
},
201+
{
202+
text: '日期选择器 Date Input',
203+
link: '/documentation/section_controls#日期选择器-date-input',
204+
},
205+
{
206+
text: '时间选择器 Time Input',
207+
link: '/documentation/section_controls#时间选择器-time-input',
208+
},
209+
{
210+
text: '文件上传器 File Upload',
211+
link: '/documentation/section_controls#文件上传-file-upload',
212+
},
213+
]
109214
},
110215
{
111216
text: '视听元素',
@@ -168,7 +273,7 @@ export default defineConfig({
168273
// 页脚
169274
footer: {
170275
copyright: `Copyright © 2018-${new Date().getFullYear()} <a href="https://www.yxqi.cn">于小丘Yuerchu</a> and <a href="https://www.zauberzeug.com/">Zauberzeug</a>. All Right Reserved.`,
171-
message: '更新日期: 2025 年 9 月 6 日', // 每次提交都记得在这里改一下时间和日期
276+
message: '更新日期: 2025 年 9 月 14 日', // 每次提交都记得在这里改一下时间和日期
172277
},
173278

174279
// 编辑链接

docs/.vitepress/theme/index.ts

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,42 @@
1+
// .vitepress/theme/index.ts
12
import DefaultTheme from 'vitepress/theme'
3+
import { Underline, BoxCube, Card, Links, Pill } from '@theojs/lumen'
4+
import '@theojs/lumen/style'
25
import "@fontsource/maple-mono";
3-
import 'vuetify/styles'
46
import './style/custom.css'
5-
import * as components from 'vuetify/components'
6-
import * as directives from 'vuetify/directives'
7-
import { createVuetify } from 'vuetify'
8-
import '@mdi/font/css/materialdesignicons.css'
7+
import { h } from 'vue'
8+
import { Notice } from '@theojs/lumen'
99

10-
const vuetify = createVuetify({
11-
components, directives,
12-
icons: {
13-
defaultSet: 'mdi',
14-
},
15-
})
10+
import mediumZoom from 'medium-zoom';
11+
import { onMounted, watch, nextTick } from 'vue';
12+
import { useRoute } from 'vitepress';
1613

1714
export default {
18-
...DefaultTheme,
19-
enhanceApp({ app }) {
20-
app.use(vuetify)
21-
},
15+
extends: DefaultTheme,
16+
enhanceApp: ({ app }) => {
17+
app.component('Home', Underline)
18+
app.component('Pill', Pill)
19+
app.component('Links', Links)
20+
app.component('Card', Card)
21+
app.component('BoxCube', BoxCube)
22+
},
23+
setup() {
24+
const route = useRoute();
25+
const initZoom = () => {
26+
// mediumZoom('[data-zoomable]', { background: 'var(--vp-c-bg)' }); // 默认
27+
mediumZoom(".main img", { background: "var(--vp-c-bg)" }); // 不显式添加{data-zoomable}的情况下为所有图像启用此功能
28+
};
29+
onMounted(() => {
30+
initZoom();
31+
});
32+
watch(
33+
() => route.path,
34+
() => nextTick(() => initZoom())
35+
);
36+
},
37+
Layout() {
38+
return h(DefaultTheme.Layout, null, {
39+
'home-hero-info-before': () => h(Notice)
40+
})
41+
},
2242
}

docs/documentation/elements/button.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ ui.button('点我', on_click=lambda: ui.notify('您点了我'))
2424
ui.run()
2525
```
2626

27-
<v-btn @click="ClickMe = true">
28-
点我
29-
</v-btn>
30-
3127
### 图标
3228

3329
您也可以给按钮添加一个图标。
@@ -46,13 +42,6 @@ with ui.row():
4642
ui.run()
4743
```
4844

49-
<v-row>
50-
<v-btn class="mr-2" prepend-icon="mdi-history">
51-
demo
52-
</v-btn>
53-
<v-btn class="ml-2" prepend-icon="mdi-thumb-up"></v-btn>
54-
</v-row>
55-
5645
### 等待按钮点击
5746

5847
有时,在继续执行之前等待按钮点击会非常方便。

docs/documentation/elements/button_group.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@ with ui.button_group():
1717
ui.run()
1818
```
1919

20-
<v-btn-group
21-
divided
22-
>
23-
<v-btn>一</v-btn>
24-
<v-btn>二</v-btn>
25-
<v-btn>三</v-btn>
26-
</v-btn-group>
27-
2820
### 带下拉按钮的按钮组
2921

3022
您也可以在按钮组中添加一个下拉按钮。

docs/documentation/index.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ next:
66

77
# NiceGUI 文档
88

9-
::: warning ⚠️ 重要提示
10-
目前文档还尚未完成,部分内容可能还没来得及添加或者已被 NiceGUI 官方更改/废弃,请以 NiceGUI 官方为准
11-
12-
更新日期请前往页面底部查看
13-
14-
我们正在引入一些新的东西,诸如Vuetify,以方便在本站模拟英文官方网站的演示功能。这可能导致布局出现严重的问题,敬请谅解。
15-
:::
16-
179
::: tip 赞助我们
1810
- 如果你喜欢 NiceGUI ,欢迎前往 **[赞助者](https://github.com/sponsors/zauberzeug)** 页面捐赠 NiceGUI ,或者提交议题/拉取请求来成为 **贡献者**
1911
- 如果你喜欢 NiceGUI 中文网,你也可以通过 [爱发电](https://afdian.com/a/yuerchu) 来维持本站的无偿运营,或者前往 [NiceGUI 中文网 - Github 仓库](https://github.com/Yuerchu/NiceGUI-docs) 来提交/改进翻译。

docs/documentation/section_controls.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 按钮 `Button`
44

5-
<!--@include: ./elements/button.md{3,29}-->
5+
<!--@include: ./elements/button.md{3,26}-->
66

77
[查看更多...](./elements/button)
88

docs/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
layout: home
44

55
hero:
6+
Notice:
7+
title: 'NiceGUI 3.0 即将发布'
8+
link: 'https://www.reddit.com/r/nicegui/comments/1n970xn/nicegui_30_release_candidate_1_with_script_mode/'
69
name: "NiceGUI"
710
text: 高性能
811
textsuffix: "的 Python WebUI 框架"

0 commit comments

Comments
 (0)