@weapp-core/init 4.1.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/dist/index.cjs +110 -201
  2. package/dist/index.d.cts +1 -12
  3. package/dist/index.d.ts +1 -12
  4. package/dist/index.js +110 -193
  5. package/package.json +3 -10
  6. package/templates/default/.editorconfig +0 -9
  7. package/templates/default/.vscode/settings.json +0 -5
  8. package/templates/default/README.md +0 -28
  9. package/templates/default/auto-import-components.json +0 -3
  10. package/templates/default/gitignore +0 -35
  11. package/templates/default/package.json +0 -31
  12. package/templates/default/project.config.json +0 -42
  13. package/templates/default/project.private.config.json +0 -8
  14. package/templates/default/public/logo.png +0 -0
  15. package/templates/default/src/app.json +0 -10
  16. package/templates/default/src/app.scss +0 -0
  17. package/templates/default/src/app.ts +0 -6
  18. package/templates/default/src/components/HelloWorld/HelloWorld.json +0 -6
  19. package/templates/default/src/components/HelloWorld/HelloWorld.scss +0 -47
  20. package/templates/default/src/components/HelloWorld/HelloWorld.ts +0 -61
  21. package/templates/default/src/components/HelloWorld/HelloWorld.wxml +0 -16
  22. package/templates/default/src/pages/index/index.json +0 -7
  23. package/templates/default/src/pages/index/index.scss +0 -0
  24. package/templates/default/src/pages/index/index.ts +0 -24
  25. package/templates/default/src/pages/index/index.wxml +0 -14
  26. package/templates/default/src/sitemap.json +0 -10
  27. package/templates/default/src/theme.json +0 -5
  28. package/templates/default/src/utils/util.ts +0 -3
  29. package/templates/default/src/vite-env.d.ts +0 -1
  30. package/templates/default/tsconfig.app.json +0 -60
  31. package/templates/default/tsconfig.json +0 -11
  32. package/templates/default/tsconfig.node.json +0 -33
  33. package/templates/default/vite.config.ts +0 -39
  34. package/templates/tailwindcss/.editorconfig +0 -9
  35. package/templates/tailwindcss/.vscode/settings.json +0 -5
  36. package/templates/tailwindcss/README.md +0 -28
  37. package/templates/tailwindcss/auto-import-components.json +0 -3
  38. package/templates/tailwindcss/gitignore +0 -35
  39. package/templates/tailwindcss/package.json +0 -38
  40. package/templates/tailwindcss/postcss.config.js +0 -6
  41. package/templates/tailwindcss/project.config.json +0 -43
  42. package/templates/tailwindcss/project.private.config.json +0 -8
  43. package/templates/tailwindcss/public/icon0.png +0 -0
  44. package/templates/tailwindcss/public/icon0s.png +0 -0
  45. package/templates/tailwindcss/public/icon1.png +0 -0
  46. package/templates/tailwindcss/public/icon1s.png +0 -0
  47. package/templates/tailwindcss/public/logo.png +0 -0
  48. package/templates/tailwindcss/src/app.json +0 -31
  49. package/templates/tailwindcss/src/app.scss +0 -3
  50. package/templates/tailwindcss/src/app.ts +0 -6
  51. package/templates/tailwindcss/src/components/HelloWorld/HelloWorld.json +0 -7
  52. package/templates/tailwindcss/src/components/HelloWorld/HelloWorld.scss +0 -1
  53. package/templates/tailwindcss/src/components/HelloWorld/HelloWorld.ts +0 -61
  54. package/templates/tailwindcss/src/components/HelloWorld/HelloWorld.wxml +0 -16
  55. package/templates/tailwindcss/src/pages/index/index.json +0 -7
  56. package/templates/tailwindcss/src/pages/index/index.scss +0 -0
  57. package/templates/tailwindcss/src/pages/index/index.ts +0 -48
  58. package/templates/tailwindcss/src/pages/index/index.wxml +0 -24
  59. package/templates/tailwindcss/src/pages/profile/index.json +0 -7
  60. package/templates/tailwindcss/src/pages/profile/index.scss +0 -0
  61. package/templates/tailwindcss/src/pages/profile/index.ts +0 -19
  62. package/templates/tailwindcss/src/pages/profile/index.wxml +0 -11
  63. package/templates/tailwindcss/src/sitemap.json +0 -10
  64. package/templates/tailwindcss/src/theme.json +0 -5
  65. package/templates/tailwindcss/src/utils/util.ts +0 -3
  66. package/templates/tailwindcss/src/vite-env.d.ts +0 -1
  67. package/templates/tailwindcss/tailwind.config.ts +0 -22
  68. package/templates/tailwindcss/tsconfig.app.json +0 -60
  69. package/templates/tailwindcss/tsconfig.json +0 -11
  70. package/templates/tailwindcss/tsconfig.node.json +0 -33
  71. package/templates/tailwindcss/vite.config.ts +0 -37
  72. package/templates/tdesign/.editorconfig +0 -9
  73. package/templates/tdesign/.vscode/settings.json +0 -5
  74. package/templates/tdesign/README.md +0 -28
  75. package/templates/tdesign/gitignore +0 -35
  76. package/templates/tdesign/package.json +0 -41
  77. package/templates/tdesign/postcss.config.js +0 -6
  78. package/templates/tdesign/project.config.json +0 -45
  79. package/templates/tdesign/project.private.config.json +0 -8
  80. package/templates/tdesign/public/logo.png +0 -0
  81. package/templates/tdesign/src/app.json +0 -10
  82. package/templates/tdesign/src/app.scss +0 -3
  83. package/templates/tdesign/src/app.ts +0 -6
  84. package/templates/tdesign/src/components/HelloWorld/HelloWorld.json +0 -8
  85. package/templates/tdesign/src/components/HelloWorld/HelloWorld.scss +0 -1
  86. package/templates/tdesign/src/components/HelloWorld/HelloWorld.ts +0 -64
  87. package/templates/tdesign/src/components/HelloWorld/HelloWorld.wxml +0 -17
  88. package/templates/tdesign/src/pages/index/index.json +0 -7
  89. package/templates/tdesign/src/pages/index/index.scss +0 -0
  90. package/templates/tdesign/src/pages/index/index.ts +0 -97
  91. package/templates/tdesign/src/pages/index/index.wxml +0 -24
  92. package/templates/tdesign/src/sitemap.json +0 -10
  93. package/templates/tdesign/src/theme.json +0 -5
  94. package/templates/tdesign/src/utils/util.ts +0 -3
  95. package/templates/tdesign/src/vite-env.d.ts +0 -1
  96. package/templates/tdesign/tailwind.config.ts +0 -22
  97. package/templates/tdesign/tsconfig.app.json +0 -63
  98. package/templates/tdesign/tsconfig.json +0 -11
  99. package/templates/tdesign/tsconfig.node.json +0 -33
  100. package/templates/tdesign/vite.config.ts +0 -41
  101. package/templates/vant/.editorconfig +0 -9
  102. package/templates/vant/.vscode/settings.json +0 -5
  103. package/templates/vant/README.md +0 -28
  104. package/templates/vant/gitignore +0 -35
  105. package/templates/vant/package.json +0 -41
  106. package/templates/vant/postcss.config.js +0 -6
  107. package/templates/vant/project.config.json +0 -42
  108. package/templates/vant/project.private.config.json +0 -8
  109. package/templates/vant/public/logo.png +0 -0
  110. package/templates/vant/src/app.json +0 -10
  111. package/templates/vant/src/app.scss +0 -3
  112. package/templates/vant/src/app.ts +0 -6
  113. package/templates/vant/src/components/HelloWorld/HelloWorld.json +0 -9
  114. package/templates/vant/src/components/HelloWorld/HelloWorld.scss +0 -1
  115. package/templates/vant/src/components/HelloWorld/HelloWorld.ts +0 -61
  116. package/templates/vant/src/components/HelloWorld/HelloWorld.wxml +0 -19
  117. package/templates/vant/src/pages/index/index.json +0 -7
  118. package/templates/vant/src/pages/index/index.scss +0 -0
  119. package/templates/vant/src/pages/index/index.ts +0 -57
  120. package/templates/vant/src/pages/index/index.wxml +0 -28
  121. package/templates/vant/src/sitemap.json +0 -10
  122. package/templates/vant/src/theme.json +0 -5
  123. package/templates/vant/src/utils/util.ts +0 -3
  124. package/templates/vant/src/vite-env.d.ts +0 -1
  125. package/templates/vant/tailwind.config.ts +0 -22
  126. package/templates/vant/tsconfig.app.json +0 -63
  127. package/templates/vant/tsconfig.json +0 -11
  128. package/templates/vant/tsconfig.node.json +0 -33
  129. package/templates/vant/vite.config.ts +0 -41
  130. package/templates/wevu/.editorconfig +0 -9
  131. package/templates/wevu/.vscode/settings.json +0 -5
  132. package/templates/wevu/README.md +0 -29
  133. package/templates/wevu/auto-import-components.json +0 -1
  134. package/templates/wevu/gitignore +0 -35
  135. package/templates/wevu/package.json +0 -30
  136. package/templates/wevu/project.config.json +0 -43
  137. package/templates/wevu/project.private.config.json +0 -8
  138. package/templates/wevu/public/logo.png +0 -0
  139. package/templates/wevu/src/app.vue +0 -36
  140. package/templates/wevu/src/components/HelloWorld/index.vue +0 -45
  141. package/templates/wevu/src/pages/index/index.vue +0 -138
  142. package/templates/wevu/src/sitemap.json +0 -10
  143. package/templates/wevu/src/theme.json +0 -5
  144. package/templates/wevu/src/vite-env.d.ts +0 -1
  145. package/templates/wevu/tsconfig.app.json +0 -60
  146. package/templates/wevu/tsconfig.json +0 -11
  147. package/templates/wevu/tsconfig.node.json +0 -33
  148. package/templates/wevu/vite.config.ts +0 -8
  149. package/templates/wevu-tdesign/.editorconfig +0 -9
  150. package/templates/wevu-tdesign/.vscode/settings.json +0 -5
  151. package/templates/wevu-tdesign/README.md +0 -29
  152. package/templates/wevu-tdesign/auto-import-components.json +0 -83
  153. package/templates/wevu-tdesign/components.d.ts +0 -183
  154. package/templates/wevu-tdesign/gitignore +0 -35
  155. package/templates/wevu-tdesign/package.json +0 -40
  156. package/templates/wevu-tdesign/postcss.config.js +0 -6
  157. package/templates/wevu-tdesign/project.config.json +0 -43
  158. package/templates/wevu-tdesign/project.private.config.json +0 -8
  159. package/templates/wevu-tdesign/public/logo.png +0 -0
  160. package/templates/wevu-tdesign/src/app.vue +0 -40
  161. package/templates/wevu-tdesign/src/components/HelloWorld/index.vue +0 -45
  162. package/templates/wevu-tdesign/src/pages/index/index.vue +0 -138
  163. package/templates/wevu-tdesign/src/sitemap.json +0 -10
  164. package/templates/wevu-tdesign/src/theme.json +0 -5
  165. package/templates/wevu-tdesign/src/vite-env.d.ts +0 -1
  166. package/templates/wevu-tdesign/tailwind.config.ts +0 -22
  167. package/templates/wevu-tdesign/tsconfig.app.json +0 -60
  168. package/templates/wevu-tdesign/tsconfig.json +0 -11
  169. package/templates/wevu-tdesign/tsconfig.node.json +0 -33
  170. package/templates/wevu-tdesign/typed-components.d.ts +0 -943
  171. package/templates/wevu-tdesign/vite.config.ts +0 -43
@@ -1,97 +0,0 @@
1
- import ActionSheet, { ActionSheetTheme } from 'tdesign-miniprogram/action-sheet/index'
2
- import { hello } from '@/utils/util'
3
-
4
- const firstGrid = [
5
- {
6
- label: '微信',
7
- image: 'https://tdesign.gtimg.com/mobile/demos/wechat.png',
8
- },
9
- {
10
- label: '朋友圈',
11
- image: 'https://tdesign.gtimg.com/mobile/demos/times.png',
12
- },
13
- {
14
- label: 'QQ',
15
- image: 'https://tdesign.gtimg.com/mobile/demos/qq.png',
16
- },
17
- {
18
- label: '企业微信',
19
- image: 'https://tdesign.gtimg.com/mobile/demos/wecom.png',
20
- },
21
- {
22
- label: '收藏',
23
- icon: 'star',
24
- },
25
- {
26
- label: '刷新',
27
- icon: 'refresh',
28
- },
29
- {
30
- label: '下载',
31
- icon: 'download',
32
- },
33
- {
34
- label: '复制',
35
- icon: 'queue',
36
- },
37
- ]
38
- Page({
39
- data: {
40
- mode: 'light',
41
- hello: {
42
- title: 'Hello weapp-vite + TDesign',
43
- description: '集成 TDesign Miniprogram 与 Tailwind CSS,帮助你快速搭建企业级交互界面。',
44
- docs: 'https://vite.icebreaker.top',
45
- links: [
46
- {
47
- text: '复制文档链接',
48
- url: 'https://vite.icebreaker.top',
49
- },
50
- {
51
- text: 'TDesign 小程序组件',
52
- url: 'https://tdesign.tencent.com/miniprogram/overview',
53
- variant: 'ghost',
54
- },
55
- ],
56
- },
57
- },
58
- switchMode() {
59
- if (this.data.mode === 'light') {
60
- this.setData({
61
- mode: 'dark',
62
- })
63
- }
64
- else {
65
- this.setData({
66
- mode: 'light',
67
- })
68
- }
69
- },
70
- async copy(e: WechatMiniprogram.BaseEvent) {
71
- if (e.mark?.url) {
72
- await wx.setClipboardData({
73
- data: e.mark.url,
74
- })
75
- // eslint-disable-next-line no-console
76
- console.log(`复制成功: ${e.mark.url}`)
77
- }
78
- },
79
- handleSelected(e: WechatMiniprogram.CustomEvent) {
80
- // eslint-disable-next-line no-console
81
- console.log(e.detail)
82
- },
83
- onLoad() {
84
- // eslint-disable-next-line no-console
85
- console.log(hello())
86
- },
87
- handleAction() {
88
- ActionSheet.show({
89
- theme: ActionSheetTheme.Grid,
90
- selector: '#t-action-sheet',
91
- context: this,
92
- items: firstGrid,
93
- align: 'center',
94
- description: '',
95
- })
96
- },
97
- })
@@ -1,24 +0,0 @@
1
- <view class="min-h-screen {{ mode === 'light'?'bg-gray-100 text-slate-800':'bg-gray-900 text-slate-200' }} transition-colors duration-500">
2
- <view class="flex flex-col items-center pt-20 space-y-10">
3
- <HelloWorld
4
- title="{{hello.title}}"
5
- description="{{hello.description}}"
6
- docs="{{hello.docs}}"
7
- links="{{hello.links}}"
8
- />
9
- <view bind:tap="switchMode" class="flex items-center">
10
- 当前模式 {{mode}} 切换模式
11
- <view class="{{ mode === 'light' ? 'i-mdi-moon-waxing-crescent':'i-mdi-weather-sunny text-white' }} text-2xl"></view>
12
- </view>
13
- <view class="underline" mark:url="https://vite.icebreaker.top" bind:tap="copy">
14
- https://vite.icebreaker.top
15
- </view>
16
- <view class="underline" mark:url="https://tw.icebreaker.top" bind:tap="copy">
17
- https://tw.icebreaker.top
18
- </view>
19
- <view>
20
- <t-button theme="primary" ghost bind:tap="handleAction">TDesign Button</t-button>
21
- </view>
22
- </view>
23
- <t-action-sheet id="t-action-sheet" bind:selected="handleSelected" />
24
- </view>
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "https://vite.icebreaker.top/sitemap.json",
3
- "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
4
- "rules": [
5
- {
6
- "action": "allow",
7
- "page": "*"
8
- }
9
- ]
10
- }
@@ -1,5 +0,0 @@
1
- {
2
- "$schema": "https://vite.icebreaker.top/theme.json",
3
- "light": {},
4
- "dark": {}
5
- }
@@ -1,3 +0,0 @@
1
- export function hello() {
2
- return 'world'
3
- }
@@ -1 +0,0 @@
1
- /// <reference types="weapp-vite/client" />
@@ -1,22 +0,0 @@
1
- import type { Config } from 'tailwindcss'
2
- import { getIconCollections, iconsPlugin } from '@egoist/tailwindcss-icons'
3
-
4
- export default <Config>{
5
- content: [
6
- // 添加你需要提取的文件目录
7
- 'src/**/*.{wxml,js,ts}',
8
- ],
9
- theme: {
10
- extend: {},
11
- },
12
- plugins: [
13
- iconsPlugin({
14
- collections: getIconCollections(['mdi']),
15
- }),
16
- ],
17
- corePlugins: {
18
- // 小程序不需要 preflight 和 container,因为这主要是给 h5 的,如果你要同时开发小程序和 h5 端,你应该使用环境变量来控制它
19
- preflight: false,
20
- container: false,
21
- },
22
- }
@@ -1,63 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
- "target": "ES2023",
5
- "jsx": "preserve",
6
- "lib": [
7
- "ES2023",
8
- "DOM",
9
- "DOM.Iterable"
10
- ],
11
- "moduleDetection": "force",
12
- "baseUrl": ".",
13
- "module": "ESNext",
14
- "moduleResolution": "bundler",
15
- "paths": {
16
- "@/*": [
17
- "./src/*"
18
- ],
19
- "tdesign-miniprogram/*": [
20
- "./node_modules/tdesign-miniprogram/miniprogram_dist/*"
21
- ],
22
- "take:@/*": [
23
- "./src/*"
24
- ]
25
- },
26
- "resolveJsonModule": true,
27
- "types": [
28
- "miniprogram-api-typings"
29
- ],
30
- "allowImportingTsExtensions": true,
31
- "allowJs": true,
32
- "strict": true,
33
- "noFallthroughCasesInSwitch": true,
34
- "noUnusedLocals": true,
35
- "noUnusedParameters": true,
36
- "noEmit": true,
37
- "allowSyntheticDefaultImports": true,
38
- "esModuleInterop": true,
39
- "isolatedModules": true,
40
- "verbatimModuleSyntax": true,
41
- "noUncheckedSideEffectImports": true,
42
- "erasableSyntaxOnly": true,
43
- "skipLibCheck": true
44
- },
45
- "vueCompilerOptions": {
46
- "plugins": [
47
- "weapp-vite/volar"
48
- ]
49
- },
50
- "include": [
51
- "src/**/*.ts",
52
- "src/**/*.tsx",
53
- "src/**/*.js",
54
- "src/**/*.jsx",
55
- "src/**/*.mts",
56
- "src/**/*.cts",
57
- "src/**/*.vue",
58
- "src/**/*.json",
59
- "src/**/*.d.ts",
60
- "types/**/*.d.ts",
61
- "env.d.ts"
62
- ]
63
- }
@@ -1,11 +0,0 @@
1
- {
2
- "references": [
3
- {
4
- "path": "./tsconfig.app.json"
5
- },
6
- {
7
- "path": "./tsconfig.node.json"
8
- }
9
- ],
10
- "files": []
11
- }
@@ -1,33 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
- "target": "ES2023",
5
- "lib": [
6
- "ES2023"
7
- ],
8
- "moduleDetection": "force",
9
- "module": "ESNext",
10
- "moduleResolution": "bundler",
11
- "resolveJsonModule": true,
12
- "types": [
13
- "node"
14
- ],
15
- "allowImportingTsExtensions": true,
16
- "strict": true,
17
- "noFallthroughCasesInSwitch": true,
18
- "noUnusedLocals": true,
19
- "noUnusedParameters": true,
20
- "noEmit": true,
21
- "verbatimModuleSyntax": true,
22
- "noUncheckedSideEffectImports": true,
23
- "erasableSyntaxOnly": true,
24
- "skipLibCheck": true
25
- },
26
- "include": [
27
- "vite.config.ts",
28
- "vite.config.*.ts",
29
- "*.config.ts",
30
- "config/**/*.ts",
31
- "scripts/**/*.ts"
32
- ]
33
- }
@@ -1,41 +0,0 @@
1
- import { UnifiedViteWeappTailwindcssPlugin } from 'weapp-tailwindcss/vite'
2
- import { TDesignResolver } from 'weapp-vite/auto-import-components/resolvers'
3
- import { defineConfig } from 'weapp-vite/config'
4
-
5
- export default defineConfig({
6
- weapp: {
7
- srcRoot: 'src',
8
- autoImportComponents: {
9
- resolvers: [TDesignResolver()],
10
- },
11
- // pnpm g 生成的格式
12
- // https://vite.icebreaker.top/guide/generate.html
13
- generate: {
14
- extensions: {
15
- js: 'ts',
16
- wxss: 'scss',
17
- },
18
- dirs: {
19
- component: 'src/components',
20
- page: 'src/pages',
21
- },
22
- // 假如你想让默认生成的组件命名为 HelloWorld/index 而不是 HelloWorld/HelloWorld 可以下列选项
23
- // filenames: {
24
- // component: 'index',
25
- // page: 'index',
26
- // },
27
- },
28
- },
29
- css: {
30
- preprocessorOptions: {
31
- scss: {
32
- silenceDeprecations: ['legacy-js-api', 'import'],
33
- },
34
- },
35
- },
36
- plugins: [
37
- UnifiedViteWeappTailwindcssPlugin({
38
- rem2rpx: true,
39
- }),
40
- ],
41
- })
@@ -1,9 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- charset = utf-8
5
- indent_style = space
6
- indent_size = 2
7
- end_of_line = lf
8
- insert_final_newline = true
9
- trim_trailing_whitespace = true
@@ -1,5 +0,0 @@
1
- {
2
- "tailwindCSS.includeLanguages": {
3
- "wxml": "html"
4
- }
5
- }
@@ -1,28 +0,0 @@
1
- # weapp-vite-tailwindcss-vant-template
2
-
3
- `weapp-vite` 集成 `tailwindcss`, `@vant/weapp` 的模板
4
-
5
- ## 使用方式
6
-
7
- ### 开发
8
-
9
- - `pnpm dev`
10
-
11
- - `pnpm dev --open` 可以打包并直接启动微信开发者工具
12
-
13
- ### 构建
14
-
15
- `pnpm build`
16
-
17
- ### 打开微信开发者工具
18
-
19
- `pnpm open`
20
-
21
- ### 生成组件/页面
22
-
23
- `pnpm g path/to/your/component`
24
-
25
- ## 文档地址
26
-
27
- 0. `weapp-vite`: https://vite.icebreaker.top/
28
- 1. `weapp-tailwindcss`: https://tw.icebreaker.top/
@@ -1,35 +0,0 @@
1
- # dependencies
2
- node_modules
3
- .pnp
4
- .pnp.js
5
-
6
- # testing
7
- coverage
8
-
9
- # next.js
10
- .next/
11
- out/
12
- build
13
-
14
- # misc
15
- .DS_Store
16
- *.pem
17
-
18
- # debug
19
- npm-debug.log*
20
- yarn-debug.log*
21
- yarn-error.log*
22
- .pnpm-debug.log*
23
-
24
- # local env files
25
- .env.local
26
- .env.development.local
27
- .env.test.local
28
- .env.production.local
29
-
30
- # turbo
31
- .turbo
32
-
33
- dist
34
- vite.config.ts.timestamp-*.mjs
35
- dist-web
@@ -1,41 +0,0 @@
1
- {
2
- "name": "weapp-vite-tailwindcss-vant-template",
3
- "type": "module",
4
- "version": "1.0.3",
5
- "private": true,
6
- "description": "原生微信小程序 weapp-vite + tailwindcss 模板",
7
- "author": "ice breaker <1324318532@qq.com>",
8
- "license": "MIT",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/weapp-vite/weapp-vite.git",
12
- "directory": "templates/weapp-vite-tailwindcss-vant-template"
13
- },
14
- "bugs": {
15
- "url": "https://github.com/weapp-vite/weapp-vite/issues"
16
- },
17
- "keywords": [],
18
- "scripts": {
19
- "dev": "weapp-vite dev",
20
- "dev:open": "weapp-vite dev -o",
21
- "build": "weapp-vite build",
22
- "open": "weapp-vite open",
23
- "g": "weapp-vite generate",
24
- "postinstall": "weapp-tw patch"
25
- },
26
- "dependencies": {
27
- "@vant/weapp": "^1.11.7"
28
- },
29
- "devDependencies": {
30
- "@egoist/tailwindcss-icons": "^1.9.0",
31
- "@iconify-json/mdi": "^1.2.3",
32
- "autoprefixer": "^10.4.23",
33
- "miniprogram-api-typings": "^4.1.2",
34
- "postcss": "^8.5.6",
35
- "sass": "^1.97.1",
36
- "tailwindcss": "^3.4.19",
37
- "typescript": "^5.9.3",
38
- "weapp-tailwindcss": "^4.9.2",
39
- "weapp-vite": "workspace:*"
40
- }
41
- }
@@ -1,6 +0,0 @@
1
- export default {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {},
5
- },
6
- }
@@ -1,42 +0,0 @@
1
- {
2
- "description": "项目配置文件",
3
- "miniprogramRoot": "dist/",
4
- "compileType": "miniprogram",
5
- "setting": {
6
- "babelSetting": {
7
- "ignore": [],
8
- "disablePlugins": [],
9
- "outputPath": ""
10
- },
11
- "coverView": false,
12
- "postcss": false,
13
- "minified": false,
14
- "enhance": true,
15
- "showShadowRootInWxmlPanel": false,
16
- "packNpmRelationList": [
17
- {
18
- "packageJsonPath": "./package.json",
19
- "miniprogramNpmDistDir": "./dist"
20
- }
21
- ],
22
- "ignoreUploadUnusedFiles": true,
23
- "compileHotReLoad": false,
24
- "skylineRenderEnable": true,
25
- "packNpmManually": true,
26
- "es6": true
27
- },
28
- "simulatorType": "wechat",
29
- "simulatorPluginLibVersion": {},
30
- "condition": {},
31
- "srcMiniprogramRoot": "dist/",
32
- "editorSetting": {
33
- "tabIndent": "insertSpaces",
34
- "tabSize": 2
35
- },
36
- "libVersion": "2.32.3",
37
- "packOptions": {
38
- "ignore": [],
39
- "include": []
40
- },
41
- "appid": "wx6ffee4673b257014"
42
- }
@@ -1,8 +0,0 @@
1
- {
2
- "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
3
- "projectname": "weapp-vite-tailwindcss-vant-template",
4
- "setting": {
5
- "compileHotReLoad": true
6
- },
7
- "libVersion": "development"
8
- }
Binary file
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "https://vite.icebreaker.top/app.json",
3
- "pages": [
4
- "pages/index/index"
5
- ],
6
- "window": {},
7
- "componentFramework": "glass-easel",
8
- "sitemapLocation": "sitemap.json",
9
- "lazyCodeLoading": "requiredComponents"
10
- }
@@ -1,3 +0,0 @@
1
- @use 'tailwindcss/base';
2
- @use 'tailwindcss/components';
3
- @use 'tailwindcss/utilities';
@@ -1,6 +0,0 @@
1
- App({
2
- globalData: {},
3
- onLaunch() {
4
-
5
- },
6
- })
@@ -1,9 +0,0 @@
1
- {
2
- "$schema": "https://vite.icebreaker.top/component.json",
3
- "component": true,
4
- // 组件需要设置成 "apply-shared" 才能使用 app.wxss 里的全局样式
5
- "styleIsolation": "apply-shared",
6
- "usingComponents": {
7
- "van-button": "@vant/weapp/button/index"
8
- }
9
- }
@@ -1 +0,0 @@
1
- /* Tailwind CSS utilities are applied directly in the template. */
@@ -1,61 +0,0 @@
1
- interface HelloWorldLink {
2
- text: string
3
- url: string
4
- variant?: 'ghost'
5
- }
6
-
7
- Component({
8
- properties: {
9
- title: {
10
- type: String,
11
- value: 'Hello weapp-vite',
12
- },
13
- description: {
14
- type: String,
15
- value: '欢迎使用 weapp-vite 模板,这里演示了如何在组件内快速放置介绍信息。',
16
- },
17
- docs: {
18
- type: String,
19
- value: '',
20
- },
21
- links: {
22
- type: Array,
23
- value: [] as HelloWorldLink[],
24
- },
25
- },
26
- lifetimes: {
27
- attached() {
28
- if (!this.data.links?.length && this.data.docs) {
29
- this.setData({
30
- links: [
31
- {
32
- text: '复制文档链接',
33
- url: this.data.docs,
34
- },
35
- ],
36
- })
37
- }
38
- },
39
- },
40
- methods: {
41
- async copyLink(event: WechatMiniprogram.TouchEvent) {
42
- const url = event.currentTarget.dataset?.url as string | undefined
43
- if (!url) {
44
- return
45
- }
46
-
47
- try {
48
- await wx.setClipboardData({ data: url })
49
- wx.showToast({
50
- title: '链接已复制',
51
- icon: 'success',
52
- duration: 1500,
53
- })
54
- }
55
- catch (error) {
56
- // eslint-disable-next-line no-console
57
- console.error('复制链接失败', error)
58
- }
59
- },
60
- },
61
- })
@@ -1,19 +0,0 @@
1
- <view class="w-full max-w-[640rpx] mx-auto rounded-3xl p-8 bg-white/95 shadow-xl shadow-sky-200/40 flex flex-col gap-6">
2
- <view class="text-3xl font-semibold text-sky-500">{{title}}</view>
3
- <view class="text-lg leading-relaxed text-slate-700">{{description}}</view>
4
- <view wx:if="{{links.length}}" class="flex flex-wrap gap-4">
5
- <van-button
6
- wx:for="{{links}}"
7
- wx:key="url"
8
- size="small"
9
- type="{{item.variant === 'ghost' ? 'default' : 'primary'}}"
10
- plain="{{item.variant === 'ghost'}}"
11
- data-url="{{item.url}}"
12
- bindtap="copyLink"
13
- custom-class="px-5 py-2 rounded-full text-sm font-medium transition active:scale-95"
14
- >
15
- {{item.text}}
16
- </van-button>
17
- </view>
18
- <view wx:if="{{links.length}}" class="text-xs text-slate-400">复制后可直接粘贴到浏览器访问</view>
19
- </view>
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "https://vite.icebreaker.top/page.json",
3
- "usingComponents": {
4
- "HelloWorld": "/components/HelloWorld/HelloWorld"
5
- },
6
- "navigationBarTitleText": "初始模板"
7
- }
File without changes