Skip to content

Commit c05c60b

Browse files
18003228289kagol
authored andcommitted
feat(tiny-vue-nuxt): [tiny-vue-nuxt] add tiny-vue-nuxt module and add some components to module (#1761)
1 parent e3a0594 commit c05c60b

File tree

8 files changed

+306
-0
lines changed

8 files changed

+306
-0
lines changed

examples/tiny-vue-nuxt/.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_size = 2
5+
indent_style = space
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

examples/tiny-vue-nuxt/.gitignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Dependencies
2+
node_modules
3+
4+
# Logs
5+
*.log*
6+
7+
# Temp directories
8+
.temp
9+
.tmp
10+
.cache
11+
12+
# Yarn
13+
**/.yarn/cache
14+
**/.yarn/*state*
15+
16+
# Generated dirs
17+
dist
18+
19+
# Nuxt
20+
.nuxt
21+
.output
22+
.data
23+
.vercel_build_output
24+
.build-*
25+
.netlify
26+
27+
# Env
28+
.env
29+
30+
# Testing
31+
reports
32+
coverage
33+
*.lcov
34+
.nyc_output
35+
36+
# VSCode
37+
.vscode/*
38+
!.vscode/settings.json
39+
!.vscode/tasks.json
40+
!.vscode/launch.json
41+
!.vscode/extensions.json
42+
!.vscode/*.code-snippets
43+
44+
# Intellij idea
45+
*.iml
46+
.idea
47+
48+
# OSX
49+
.DS_Store
50+
.AppleDouble
51+
.LSOverride
52+
.AppleDB
53+
.AppleDesktop
54+
Network Trash Folder
55+
Temporary Items
56+
.apdisk

examples/tiny-vue-nuxt/.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false

examples/tiny-vue-nuxt/package.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "@opentiny/nuxt",
3+
"type": "module",
4+
"version": "1.0.0",
5+
"description": "tiny-vue module for Nuxt",
6+
"author": "",
7+
"license": "MIT",
8+
"keywords": [
9+
"opentiny",
10+
"nuxt",
11+
"tiny-vue"
12+
],
13+
"exports": {
14+
".": {
15+
"types": "./dist/module.d.ts",
16+
"require": "./dist/module.cjs",
17+
"import": "./dist/module.mjs"
18+
},
19+
"./*": "./*"
20+
},
21+
"main": "./dist/module.cjs",
22+
"module": "./dist/module.mjs",
23+
"files": [
24+
"dist"
25+
],
26+
"publishConfig": {
27+
"access": "public"
28+
},
29+
"scripts": {
30+
"build": "pnpm run dev:prepare && nuxt-module-build",
31+
"dev": "nuxi dev playground",
32+
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground"
33+
},
34+
"dependencies": {
35+
"@nuxt/kit": "^3.12.3",
36+
"@opentiny/vue": "~3.17.0",
37+
"@opentiny/vue-alert": "~3.17.0"
38+
},
39+
"devDependencies": {
40+
"@nuxt/devtools": "^1.2.0",
41+
"@nuxt/module-builder": "^0.6.0",
42+
"@nuxt/schema": "^3.12.3",
43+
"less": "^4.2.0",
44+
"nuxt": "^3.12.3"
45+
}
46+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<template>
2+
<div>
3+
<div>场景1:显示边框</div>
4+
<br />
5+
<tiny-dropdown border>
6+
<span>下拉菜单</span>
7+
<template #dropdown>
8+
<tiny-dropdown-menu>
9+
<tiny-dropdown-item>黄金糕</tiny-dropdown-item>
10+
<tiny-dropdown-item>狮子头</tiny-dropdown-item>
11+
<tiny-dropdown-item>螺蛳粉</tiny-dropdown-item>
12+
<tiny-dropdown-item disabled>双皮奶</tiny-dropdown-item>
13+
<tiny-dropdown-item divided>蚵仔煎</tiny-dropdown-item>
14+
</tiny-dropdown-menu>
15+
</template>
16+
</tiny-dropdown>
17+
<br />
18+
<br />
19+
<div>场景2:显示边框并圆角</div>
20+
<br />
21+
<tiny-dropdown border round>
22+
<span>下拉菜单</span>
23+
<template #dropdown>
24+
<tiny-dropdown-menu>
25+
<tiny-dropdown-item>黄金糕</tiny-dropdown-item>
26+
<tiny-dropdown-item>狮子头</tiny-dropdown-item>
27+
<tiny-dropdown-item>螺蛳粉</tiny-dropdown-item>
28+
<tiny-dropdown-item disabled>双皮奶</tiny-dropdown-item>
29+
<tiny-dropdown-item divided>蚵仔煎</tiny-dropdown-item>
30+
</tiny-dropdown-menu>
31+
</template>
32+
</tiny-dropdown>
33+
<br />
34+
<br />
35+
<div>场景3:显示边框 + 不显示图标</div>
36+
<br />
37+
<tiny-dropdown border :show-icon="false">
38+
<span>下拉菜单</span>
39+
<template #dropdown>
40+
<tiny-dropdown-menu>
41+
<tiny-dropdown-item>黄金糕</tiny-dropdown-item>
42+
<tiny-dropdown-item>狮子头</tiny-dropdown-item>
43+
<tiny-dropdown-item>螺蛳粉</tiny-dropdown-item>
44+
<tiny-dropdown-item disabled>双皮奶</tiny-dropdown-item>
45+
<tiny-dropdown-item divided>蚵仔煎</tiny-dropdown-item>
46+
</tiny-dropdown-menu>
47+
</template>
48+
</tiny-dropdown>
49+
</div>
50+
</template>
51+
52+
53+
<script setup>
54+
55+
</script>
56+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export default defineNuxtConfig({
2+
modules: ['../src/module'],
3+
devtools: { enabled: true },
4+
5+
build: {
6+
transpile: ['@opentiny/vue']
7+
},
8+
9+
compatibilityDate: '2024-07-18',
10+
})
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"private": true,
3+
"name": "my-module-playground",
4+
"type": "module",
5+
"scripts": {
6+
"dev": "nuxi dev",
7+
"build": "nuxi build",
8+
"generate": "nuxi generate"
9+
},
10+
"dependencies": {
11+
"nuxt": "^3.12.3"
12+
}
13+
}

examples/tiny-vue-nuxt/src/module.ts

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
import { addComponent, defineNuxtModule } from '@nuxt/kit'
2+
import { IconBoat } from '@opentiny/vue-icon'
3+
export default defineNuxtModule({
4+
meta: {
5+
name: '@opentiny/nuxt',
6+
configKey: 'tiny-vue'
7+
},
8+
defaults: {
9+
prefix: '',
10+
components: true
11+
},
12+
hooks: {},
13+
setup(options) {
14+
addComponent({
15+
name: 'Alert',
16+
filePath: '@opentiny/vue-alert',
17+
}),
18+
addComponent({
19+
name: 'iconBoat',
20+
filePath: '@opentiny/vue-icon',
21+
}),
22+
addComponent({
23+
name: 'iconWarningTriangle',
24+
filePath: '@opentiny/vue-icon',
25+
}),
26+
addComponent({
27+
name: 'TinyButton',
28+
filePath: '@opentiny/vue-button',
29+
}),
30+
addComponent({
31+
name: 'Row',
32+
filePath: '@opentiny/vue-row',
33+
}),
34+
addComponent({
35+
name: 'Layout',
36+
filePath: '@opentiny/vue-layout',
37+
}),
38+
addComponent({
39+
name: 'Modal',
40+
filePath: '@opentiny/vue-modal',
41+
}),
42+
addComponent({
43+
name: 'TinySwitch',
44+
filePath: '@opentiny/vue-switch',
45+
}),
46+
addComponent({
47+
name: 'ButtonGroup',
48+
filePath: '@opentiny/vue-button-group',
49+
}),
50+
addComponent({
51+
name: 'TinyCol',
52+
filePath: '@opentiny/vue-col',
53+
}),
54+
addComponent({
55+
name: 'TinyRow',
56+
filePath: '@opentiny/vue-row',
57+
}),
58+
addComponent({
59+
name: 'Container',
60+
filePath: '@opentiny/vue-container',
61+
}),
62+
addComponent({
63+
name: 'Radio',
64+
filePath: '@opentiny/vue-radio',
65+
}),
66+
addComponent({
67+
name: 'RadioGroup',
68+
filePath: '@opentiny/vue-radio-group',
69+
}),
70+
addComponent({
71+
name: 'TinyLink',
72+
filePath: '@opentiny/vue-link',
73+
}),
74+
addComponent({
75+
name: 'TinyDivider',
76+
filePath: '@opentiny/vue-divider',
77+
}),
78+
addComponent({
79+
name: 'TinyActionMenu',
80+
filePath: '@opentiny/vue-action-menu',
81+
}),
82+
addComponent({
83+
name: 'TinyAnchor',
84+
filePath: '@opentiny/vue-anchor',
85+
}),
86+
addComponent({
87+
name: 'TinyBreadcrumb',
88+
filePath: '@opentiny/vue-breadcrumb',
89+
}),
90+
addComponent({
91+
name: 'TinyBreadcrumbItem',
92+
filePath: '@opentiny/vue-breadcrumb-item',
93+
}),
94+
addComponent({
95+
name: 'Notify',
96+
filePath: '@opentiny/vue-notify',
97+
}),
98+
addComponent({
99+
name: 'TinyDropdown',
100+
filePath: '@opentiny/vue-dropdown',
101+
}),
102+
addComponent({
103+
name: 'TinyDropdownItem',
104+
filePath: '@opentiny/vue-dropdown-item',
105+
}),
106+
addComponent({
107+
name: 'TinyDropdownMenu',
108+
filePath: '@opentiny/vue-dropdown-menu',
109+
})
110+
}
111+
})

0 commit comments

Comments
 (0)