Skip to content

Commit 569d3cc

Browse files
committed
update(docs)
1 parent 5209631 commit 569d3cc

File tree

5 files changed

+47
-21
lines changed

5 files changed

+47
-21
lines changed

crates/rs-tauri-vue/components.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ declare module '@vue/runtime-core' {
1818
Layout: typeof import('./src/components/Layout.vue')['default']
1919
NButton: typeof import('naive-ui')['NButton']
2020
NCard: typeof import('naive-ui')['NCard']
21+
NCol: typeof import('naive-ui')['NCol']
2122
NDrawer: typeof import('naive-ui')['NDrawer']
2223
NDrawerContent: typeof import('naive-ui')['NDrawerContent']
24+
NEmpty: typeof import('naive-ui')['NEmpty']
2325
NGradientText: typeof import('naive-ui')['NGradientText']
2426
NGrid: typeof import('naive-ui')['NGrid']
2527
NGridItem: typeof import('naive-ui')['NGridItem']
@@ -36,6 +38,7 @@ declare module '@vue/runtime-core' {
3638
NSpace: typeof import('naive-ui')['NSpace']
3739
NSpin: typeof import('naive-ui')['NSpin']
3840
NTable: typeof import('naive-ui')['NTable']
41+
NTableColumn: typeof import('naive-ui')['NTableColumn']
3942
NTabPane: typeof import('naive-ui')['NTabPane']
4043
NTabs: typeof import('naive-ui')['NTabs']
4144
NTag: typeof import('naive-ui')['NTag']
33 KB
Loading

crates/rs-tauri-vue/src/App.vue

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
// This starter template is using Vue 3 <script setup> SFCs
33
// Check out https://vuejs.org/api/sfc-script-setup.html#script-setup
44
import {defineComponent} from 'vue'
5-
import {dateZhCN, zhCN} from 'naive-ui';
6-
import {NConfigProvider} from 'naive-ui'
5+
import {dateZhCN, NConfigProvider, zhCN} from 'naive-ui';
76
87
export default defineComponent({
98
components: {
@@ -24,19 +23,11 @@ import Tab from './components/Tab.vue'
2423

2524

2625
<template>
27-
<n-config-provider :locale="zhCN" :date-locale="dateZhCN">
26+
<n-config-provider :date-locale="dateZhCN" :locale="zhCN">
2827

2928
<div class="flex-col p-5">
30-
31-
<div class="flex flex-row items-center justify-center">
32-
<img src="/tauri.svg" class="w-5 h-5 logo tauri" alt="Tauri logo"/>
33-
<img src="/vue.svg" class="w-5 h-5 logo vue" alt="Vue logo"/>
34-
</div>
35-
36-
3729
<!-- todo x: tab-->
3830
<Tab></Tab>
39-
4031
</div>
4132

4233
</n-config-provider>

crates/rs-tauri-vue/src/components/demo/Hello.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async function addTodo() {
2222

2323
<template>
2424

25-
<n-card style="background:gainsboro; margin-bottom:5px" title="rust command 测试:">
25+
<n-card style="background:blanchedalmond; margin-bottom:5px" title="js/ts call rust 示例:">
2626
<n-space vertical>
2727
<n-list align="center">
2828
<n-list-item>

crates/rs-tauri-vue/src/components/demo/WebsiteNav.vue

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
11
<template>
2-
<n-card item-responsive="true" style="background:gainsboro; margin-bottom:5px" title="网址导航">
2+
<n-card item-responsive="true" style="background:lightcoral; margin-bottom:5px" title="网址导航">
33
<n-grid :x-gap="12" :y-gap="8" cols="4">
44
<!-- 分组 -->
5-
<n-grid-item v-for="item in websites">
6-
<n-button size="small" style="background:cadetblue;" type="success"
5+
<n-grid-item v-for="item in webJp">
6+
<n-button size="small" style="background:lightblue;"
77
@click="open_webview(item.url)">
88
{{ item.title }}
99
</n-button>
1010
</n-grid-item>
1111
</n-grid>
12+
<br>
13+
<n-grid :x-gap="12" :y-gap="8" cols="4">
14+
<!-- 分组 -->
15+
<n-grid-item v-for="item in webDocs">
16+
<n-button size="small" style="background:greenyellow;"
17+
@click="open_webview(item.url)">
18+
{{ item.title }}
19+
</n-button>
20+
</n-grid-item>
21+
</n-grid>
22+
<br>
23+
<n-grid :x-gap="12" :y-gap="8" cols="4">
24+
<!-- 分组 -->
25+
<n-grid-item v-for="item in webSearch">
26+
<n-button size="small" style="background:yellow;"
27+
@click="open_webview(item.url)">
28+
{{ item.title }}
29+
</n-button>
30+
</n-grid-item>
31+
</n-grid>
32+
33+
1234
</n-card>
1335
</template>
1436

@@ -19,15 +41,23 @@ import {defineComponent, getCurrentInstance, ref} from 'vue'
1941
import {WebviewWindow} from '@tauri-apps/api/window';
2042
2143
// 数据: 需要注册到下面
22-
const websites = ref([
44+
const webDocs = ref([
45+
{title: 'Tauri 官网', url: "https://tauri.app/zh-cn/"},
46+
{title: 'Tauri Docs', url: "https://tauri.app/v1/api/js/"},
47+
{title: 'NaiveUI Docs', url: "https://www.naiveui.com/zh-CN/light/components/button"},
48+
{title: 'Vue Docs', url: "https://cn.vuejs.org/guide/essentials/list.html#v-for"},
49+
]);
50+
const webSearch = ref([
2351
{title: 'Google', url: "https://google.com"},
2452
{title: 'Bing', url: "https://bing.com"},
2553
{title: 'Github', url: "https://github.com"},
2654
27-
//
28-
{title: 'NaiveUI Docs', url: "https://www.naiveui.com/zh-CN/light/components/button"},
29-
{title: 'Tauri Docs', url: "https://tauri.app/v1/api/js/"},
30-
{title: 'Vue Docs', url: "https://cn.vuejs.org/guide/essentials/list.html#v-for"},
55+
]);
56+
const webJp = ref([
57+
{title: 'NHK 日语教程', url: "https://www.nhk.or.jp/lesson/zh/letters/hiragana.html"},
58+
{title: '日语五十音', url: "https://inihongo.github.io/Japanese_syllabary_learning/index.html"},
59+
{title: '新华字典', url: "https://zd.hwxnet.com/"},
60+
3161
])
3262
3363
@@ -37,7 +67,9 @@ export default defineComponent({
3767
props: ['waited'],
3868
3969
data: () => ({
40-
websites,
70+
webDocs,
71+
webJp,
72+
webSearch,
4173
toggle: false,
4274
counter: 0,
4375
}),

0 commit comments

Comments
 (0)