Skip to content

Commit a661af3

Browse files
committed
chore: update
1 parent d807c05 commit a661af3

File tree

8 files changed

+175
-68
lines changed

8 files changed

+175
-68
lines changed

packages/v2/.vitepress/theme/index.ts

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// https://vitepress.dev/guide/custom-theme
2-
import {h} from 'vue'
3-
import type {Theme} from 'vitepress'
2+
import type { Theme } from 'vitepress'
43
import DefaultTheme from 'vitepress/theme'
54
import './style.css'
65
import Layout from './Layout.vue'
7-
import naive from "naive-ui";
8-
// import "unocss"
6+
import naive from 'naive-ui' // import "unocss"
7+
import { Quasar } from 'quasar' // Import icon libraries
8+
import '@quasar/extras/material-icons/material-icons.css' // Import Quasar css
9+
import 'quasar/src/css/index.sass'
910

1011
export default {
11-
1212
extends: DefaultTheme,
1313

1414
// todo x: https://vitepress.dev/zh/guide/i18n#separate-directory-for-each-locale
@@ -19,8 +19,19 @@ export default {
1919
// // https://vitepress.dev/guide/extending-default-theme#layout-slots
2020
// })
2121
// },
22-
enhanceApp({app, router, siteData}) {
22+
enhanceApp({ app, router, siteData }) {
2323
// ...
2424
app.use(naive)
25-
}
25+
app.use(
26+
Quasar,
27+
{
28+
plugins: {}, // import Quasar plugins and add here
29+
},
30+
{
31+
req: {
32+
headers: {},
33+
},
34+
}
35+
)
36+
},
2637
} satisfies Theme

packages/v2/Taskfile.yml

+8
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ tasks:
4040
- bun add -D autoprefixer
4141
- bun add -D @iconify/vue # icon
4242

43+
fix:quasar:
44+
aliases: [ "fq" ]
45+
cmds:
46+
- bun add quasar @quasar/extras
47+
- bun add --dev @quasar/vite-plugin sass@^1.33.0
48+
- bun add --dev unplugin-vue-components
49+
- bun add --dev unplugin-auto-import
50+
4351
remove:
4452
aliases: [ "rm" ]
4553
cmds:

packages/v2/bun.lockb

9.8 KB
Binary file not shown.

packages/v2/package.json

+8
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,22 @@
1010
"devDependencies": {
1111
"@iconify/vue": "^4.1.2",
1212
"@lunariajs/core": "^0.0.32",
13+
"@quasar/vite-plugin": "^1.7.0",
1314
"autoprefixer": "^10.4.19",
1415
"daisyui": "^4.10.2",
1516
"markdown-it-mathjax3": "^4.3.2",
1617
"naive-ui": "^2.38.1",
1718
"open-cli": "^8.0.0",
1819
"postcss": "^8.4.38",
1920
"prettier": "^3.2.5",
21+
"sass": "^1.33.0",
2022
"tailwindcss": "^3.4.3",
23+
"unplugin-auto-import": "^0.17.5",
24+
"unplugin-vue-components": "^0.27.0",
2125
"vitepress": "^1.1.3"
26+
},
27+
"dependencies": {
28+
"@quasar/extras": "^1.16.11",
29+
"quasar": "^2.16.2"
2230
}
2331
}

packages/v2/readme.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
- ✅ 支持多语言: [i18n](https://vitepress.dev/zh/guide/i18n)
77
- ✅ 支持 [markdown](https://vitepress.dev/zh/guide/markdown)
88
- ✅ 支持 一键发布到 Github Pages
9-
- ✅ 集成了 [naive-ui](https://www.naiveui.com/), 并修复了`主题(明/暗)`切换
9+
- ✅ 集成 [naive-ui](https://www.naiveui.com/), 并修复了`主题(明/暗)`切换
10+
- ✅ 集成 [quasar](https://quasar.dev/), 参考文档: [vite-plugin](https://quasar.dev/start/vite-plugin/)
11+
- ✅ 集成 [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components)
12+
- ✅ 集成 [unplugin-auto-import](https://github.com/antfu/unplugin-auto-import)
1013

1114
## FAQ
1215

packages/v2/src/components/WDownload.vue

+89-56
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,61 @@
11
<template>
2-
<!-- todo x: style="justify-content: center"-->
3-
<div style="">
4-
<n-space justify="space-between">
5-
<n-card v-for="d in dw" :key="d" :title="d.title" style="min-width: 300px; align-items: center">
6-
<n-flex vertical>
7-
<n-button secondary size="large" strong type="success" @click="download(d.url)"
8-
>{{ d.dl }}
2+
<!-- todo x: style="justify-content: center"-->
3+
<div style="">
4+
<n-space justify="space-between">
5+
<n-card
6+
v-for="d in dw"
7+
:key="d"
8+
:title="d.title"
9+
style="min-width: 300px; align-items: center"
10+
>
11+
<n-flex vertical>
12+
<n-button
13+
secondary
14+
size="large"
15+
strong
16+
type="success"
17+
@click="download(d.url)"
18+
>{{ d.dl }}
919

10-
<template #icon>
11-
<n-icon :color="d.color" size="30px">
12-
<Icon :icon="d.icon" />
13-
</n-icon>
14-
</template>
15-
</n-button>
20+
<template #icon>
21+
<n-icon :color="d.color" size="30px">
22+
<Icon :icon="d.icon" />
23+
</n-icon>
24+
</template>
25+
</n-button>
1626

17-
<!-- version -->
18-
<n-gradient-text type="success">
19-
Latest Version:
20-
<n-gradient-text type="info">{{ d.version }}</n-gradient-text>
21-
</n-gradient-text>
22-
</n-flex>
23-
</n-card>
24-
</n-space>
25-
</div>
27+
<!-- version -->
28+
<n-gradient-text type="success">
29+
Latest Version:
30+
<n-gradient-text type="info">{{ d.version }}</n-gradient-text>
31+
</n-gradient-text>
32+
</n-flex>
33+
</n-card>
34+
</n-space>
35+
</div>
36+
37+
<div>
38+
<q-card>
39+
<q-btn color="primary" outline>Hello Quasar</q-btn>
40+
41+
<br />
42+
43+
<q-btn color="red" type="success">test</q-btn>
44+
45+
<div class="q-pa-md q-gutter-sm">
46+
<q-btn color="white" label="Standard" text-color="black" />
47+
<q-btn color="primary" label="Primary" />
48+
<q-btn color="secondary" label="Secondary" />
49+
<q-btn color="amber" glossy label="Amber" />
50+
<q-btn color="brown-5" label="Brown 5" />
51+
<q-btn color="deep-orange" glossy label="Deep Orange" />
52+
<q-btn color="purple" label="Purple" />
53+
<q-btn color="black" label="Black" />
54+
</div>
55+
56+
<q-tree></q-tree>
57+
</q-card>
58+
</div>
2659
</template>
2760

2861
<script lang="ts" setup>
@@ -34,53 +67,53 @@ import { Icon } from '@iconify/vue'
3467
const message = useMessage()
3568
3669
const props = defineProps({
37-
downloads: {
38-
type: Array,
39-
},
70+
downloads: {
71+
type: Array,
72+
},
4073
})
4174
4275
//
4376
// ref: https://icon-sets.iconify.design/?category=General
4477
//
4578
const dw = [
46-
{
47-
title: 'Windows',
48-
icon: 'iconoir:windows', // <Icon icon="iconoir:windows" />
49-
color: 'blue',
50-
dl: 'Download for Windows',
51-
url: 'https://github.com/naive-ui/naive-ui/releases',
52-
version: '1.0.0',
53-
},
54-
{
55-
title: 'macOS',
56-
icon: 'iconoir:apple-mac', // <Icon icon="iconoir:apple-mac" />
57-
color: 'white',
58-
dl: 'Download for macOS',
59-
url: 'https://github.com/naive-ui/naive-ui/releases',
60-
version: '1.0.0',
61-
},
62-
{
63-
title: 'Linux',
64-
icon: 'uil:linux', // <Icon icon="uil:linux" />
65-
color: 'orange',
66-
dl: 'Download for Linux',
67-
url: 'https://github.com/naive-ui/naive-ui/releases',
68-
version: '1.0.0',
69-
},
79+
{
80+
title: 'Windows',
81+
icon: 'iconoir:windows', // <Icon icon="iconoir:windows" />
82+
color: 'blue',
83+
dl: 'Download for Windows',
84+
url: 'https://github.com/naive-ui/naive-ui/releases',
85+
version: '1.0.0',
86+
},
87+
{
88+
title: 'macOS',
89+
icon: 'iconoir:apple-mac', // <Icon icon="iconoir:apple-mac" />
90+
color: 'white',
91+
dl: 'Download for macOS',
92+
url: 'https://github.com/naive-ui/naive-ui/releases',
93+
version: '1.0.0',
94+
},
95+
{
96+
title: 'Linux',
97+
icon: 'uil:linux', // <Icon icon="uil:linux" />
98+
color: 'orange',
99+
dl: 'Download for Linux',
100+
url: 'https://github.com/naive-ui/naive-ui/releases',
101+
version: '1.0.0',
102+
},
70103
]
71104
72105
function download(url: string) {
73-
const msg = 'downloading... ' + url
106+
const msg = 'downloading... ' + url
74107
75-
message.success(msg, {
76-
duration: 3000,
77-
})
108+
message.success(msg, {
109+
duration: 3000,
110+
})
78111
}
79112
80113
function info() {
81-
message.info("I don't know why nobody told you how to unfold your love", {
82-
keepAliveOnHover: true,
83-
})
114+
message.info("I don't know why nobody told you how to unfold your love", {
115+
keepAliveOnHover: true,
116+
})
84117
}
85118
</script>
86119

packages/v2/src/quasar-variables.sass

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// FILE (create it): src/quasar-variables.sass
2+
3+
$primary: #1976D2
4+
$secondary: #26A69A
5+
$accent: #9C27B0
6+
7+
$dark: #1D1D1D
8+
9+
$positive: #21BA45
10+
$negative: #C10015
11+
$info: #31CCEC
12+
$warning: #F2C037

packages/v2/vite.config.ts

+36-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,43 @@
11
// vite.config.ts
22
// import UnoCSS from 'unocss/vite'
3-
import { defineConfig } from 'vite';
4-
import vue from '@vitejs/plugin-vue';
3+
import {defineConfig} from 'vite'
4+
import vue from '@vitejs/plugin-vue'
5+
import {quasar, transformAssetUrls} from '@quasar/vite-plugin'
6+
import Components from 'unplugin-vue-components/vite'
7+
import AutoImport from 'unplugin-auto-import/vite'
8+
import {NaiveUiResolver, QuasarResolver,} from 'unplugin-vue-components/resolvers'
59

610
export default defineConfig({
711
plugins: [
8-
vue(),
12+
vue({
13+
template: { transformAssetUrls },
14+
}),
15+
16+
//
17+
// TODO X: UI Framework Support
18+
//
19+
Components({
20+
/* options */
21+
resolvers: [QuasarResolver(), NaiveUiResolver()],
22+
}),
23+
24+
AutoImport({
25+
/* options */
26+
// targets to transform
27+
include: [
28+
/\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
29+
/\.vue$/,
30+
/\.vue\?vue/, // .vue
31+
/\.md$/, // .md
32+
],
33+
}),
34+
35+
// @quasar/plugin-vite options list:
36+
// https://github.com/quasarframework/quasar/blob/dev/vite-plugin/index.d.ts
37+
quasar({
38+
sassVariables: 'src/quasar-variables.sass',
39+
}),
40+
941
// UnoCSS(),
1042
],
11-
});
43+
})

0 commit comments

Comments
 (0)