create-young-proj 1.2.1 → 1.3.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.
@@ -72,4 +72,4 @@
72
72
  "enable": false
73
73
  },
74
74
  "vueVersion": "3"
75
- }
75
+ }
@@ -1,17 +1,14 @@
1
1
  <!--
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-07-18 11:23:36
4
- * @LastEditTime: 2023-08-25 16:39:24
4
+ * @LastEditTime: 2023-11-15 11:04:49
5
5
  * @Description:
6
6
  -->
7
- <route lang="json">
8
- {
9
- "needLogin": true,
10
- "layout": "tabbar",
11
- "navbar": {
12
- "isback": false
13
- }
14
- }
7
+ <route lang="yaml">
8
+ needLogin: true
9
+ layout: tabbar
10
+ navbar:
11
+ isback: false
15
12
  </route>
16
13
 
17
14
  <script lang="ts" setup>
@@ -27,6 +24,8 @@ async function testPost() {
27
24
  const { fullscreenLoading } = storeToRefs(useHttpLoading())
28
25
  fullscreenLoading.value = true
29
26
 
27
+ const netWorkStatus = useNetwork()
28
+
30
29
  setTimeout(() => {
31
30
  fullscreenLoading.value = false
32
31
  }, 3e3)
@@ -56,6 +55,10 @@ setTimeout(() => {
56
55
  点我测试 Post 请求
57
56
  </button>
58
57
 
58
+ {{
59
+ netWorkStatus
60
+ }}
61
+
59
62
  <uni-card
60
63
  title="基础卡片" sub-title="副标题" extra="额外信息"
61
64
  thumbnail="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png" @click="to(Pages.测试子页面)"
@@ -1,17 +1,14 @@
1
1
  <!--
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-07-18 17:53:43
4
- * @LastEditTime: 2023-08-25 16:39:28
4
+ * @LastEditTime: 2023-11-13 12:13:47
5
5
  * @Description:
6
6
  -->
7
- <route lang="json">
8
- {
9
- "needLogin": true,
10
- "layout": "tabbar",
11
- "navbar": {
12
- "isback": false
13
- }
14
- }
7
+ <route lang="yaml">
8
+ needLogin: true
9
+ layout: tabbar
10
+ navbar:
11
+ isback: false
15
12
  </route>
16
13
 
17
14
  <script lang="ts" setup>
@@ -71,4 +71,4 @@
71
71
  }
72
72
  },
73
73
  "subPackages": []
74
- }
74
+ }
@@ -0,0 +1,24 @@
1
+ /* eslint-disable */
2
+ /* prettier-ignore */
3
+ // @ts-nocheck
4
+ // Generated by vite-plugin-uni-pages
5
+
6
+ interface NavigateToOptions {
7
+ url: "pages/index" |
8
+ "pages/my" |
9
+ "pages/demo/index";
10
+ }
11
+ interface RedirectToOptions extends NavigateToOptions {}
12
+
13
+ interface SwitchTabOptions {
14
+ url: "pages/index" | "pages/my"
15
+ }
16
+
17
+ type ReLaunchOptions = NavigateToOptions | SwitchTabOptions;
18
+
19
+ declare interface Uni {
20
+ navigateTo(options: UniNamespace.NavigateToOptions & NavigateToOptions): void;
21
+ redirectTo(options: UniNamespace.RedirectToOptions & RedirectToOptions): void;
22
+ switchTab(options: UniNamespace.SwitchTabOptions & SwitchTabOptions): void;
23
+ reLaunch(options: UniNamespace.ReLaunchOptions & ReLaunchOptions): void;
24
+ }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-07-18 11:03:01
4
- * @LastEditTime: 2023-09-19 10:18:06
4
+ * @LastEditTime: 2023-11-15 11:08:28
5
5
  * @Description:
6
6
  */
7
7
  import { resolve } from 'node:path'
@@ -15,6 +15,7 @@ import UniManifest from '@uni-helper/vite-plugin-uni-manifest'
15
15
  import Unocss from 'unocss/vite'
16
16
  import AutoImport from 'unplugin-auto-import/vite'
17
17
  import AutoComponents from 'unplugin-vue-components/vite'
18
+ import { UniUseAutoImports } from '@uni-helper/uni-use'
18
19
  import { multiConf } from './custom-plugins'
19
20
 
20
21
  // https://vitejs.dev/config/
@@ -40,13 +41,15 @@ export default ({ command, mode }: ConfigEnv) => {
40
41
  UniLayouts(),
41
42
  // https://uni-helper.js.org/vite-plugin-uni-manifest
42
43
  UniManifest(),
43
- Uni(),
44
+ // hack
45
+ // @ts-expect-error packages.json 中 type: "module" 会造成这里解析的不同
46
+ Uni.default(),
44
47
  // https://github.com/antfu/unocss
45
48
  Unocss(),
46
49
 
47
50
  // https://github.com/antfu/unplugin-auto-import
48
51
  AutoImport({
49
- imports: ['vue', 'uni-app', 'pinia'],
52
+ imports: ['vue', 'uni-app', 'pinia', '@vueuse/core', UniUseAutoImports],
50
53
  dts: true,
51
54
  vueTemplate: true,
52
55
  dirs: [
@@ -1 +0,0 @@
1
- src/uni_modules
@@ -1,16 +0,0 @@
1
- {
2
- "root": true,
3
- "extends": "@antfu",
4
- "rules": {
5
- "@typescript-eslint/no-use-before-define": "off",
6
- "no-console": "off",
7
- "n/prefer-global/process": "off",
8
- "unused-imports/no-unused-vars": "off",
9
- "@typescript-eslint/ban-types": "off",
10
- "vue/valid-v-model": "off",
11
- "@typescript-eslint/ban-ts-comment": "off",
12
- "no-throw-literal": "off",
13
- "prefer-promise-reject-errors": "off",
14
- "no-async-promise-executor": "off"
15
- }
16
- }