Skip to content

Commit f9ca2e4

Browse files
fix: 🐛 修复与@uni-helper/uni-typed搭配使用时tsc报类型错误的问题并更新依赖
Closes: #586
1 parent a7fc229 commit f9ca2e4

File tree

21 files changed

+2229
-2601
lines changed

21 files changed

+2229
-2601
lines changed

package.json

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -57,40 +57,42 @@
5757
"upload:mp-dingtalk": "uni build -p mp-dingtalk && minici --platform dd"
5858
},
5959
"dependencies": {
60-
"@dcloudio/uni-app": "3.0.0-3090920231225001",
61-
"@dcloudio/uni-app-plus": "3.0.0-3090920231225001",
62-
"@dcloudio/uni-components": "3.0.0-3090920231225001",
63-
"@dcloudio/uni-h5": "3.0.0-3090920231225001",
64-
"@dcloudio/uni-mp-alipay": "3.0.0-3090920231225001",
65-
"@dcloudio/uni-mp-baidu": "3.0.0-3090920231225001",
66-
"@dcloudio/uni-mp-jd": "3.0.0-3090920231225001",
67-
"@dcloudio/uni-mp-kuaishou": "3.0.0-3090920231225001",
68-
"@dcloudio/uni-mp-lark": "3.0.0-3090920231225001",
69-
"@dcloudio/uni-mp-qq": "3.0.0-3090920231225001",
70-
"@dcloudio/uni-mp-toutiao": "3.0.0-3090920231225001",
71-
"@dcloudio/uni-mp-weixin": "3.0.0-3090920231225001",
72-
"@dcloudio/uni-mp-xhs": "3.0.0-3090920231225001",
73-
"@dcloudio/uni-quickapp-webview": "3.0.0-3090920231225001",
60+
"@dcloudio/uni-app": "3.0.0-4020420240722002",
61+
"@dcloudio/uni-app-harmony": "3.0.0-4020420240722002",
62+
"@dcloudio/uni-app-plus": "3.0.0-4020420240722002",
63+
"@dcloudio/uni-components": "3.0.0-4020420240722002",
64+
"@dcloudio/uni-h5": "3.0.0-4020420240722002",
65+
"@dcloudio/uni-mp-alipay": "3.0.0-4020420240722002",
66+
"@dcloudio/uni-mp-baidu": "3.0.0-4020420240722002",
67+
"@dcloudio/uni-mp-jd": "3.0.0-4020420240722002",
68+
"@dcloudio/uni-mp-kuaishou": "3.0.0-4020420240722002",
69+
"@dcloudio/uni-mp-lark": "3.0.0-4020420240722002",
70+
"@dcloudio/uni-mp-qq": "3.0.0-4020420240722002",
71+
"@dcloudio/uni-mp-toutiao": "3.0.0-4020420240722002",
72+
"@dcloudio/uni-mp-weixin": "3.0.0-4020420240722002",
73+
"@dcloudio/uni-mp-xhs": "3.0.0-4020420240722002",
74+
"@dcloudio/uni-quickapp-webview": "3.0.0-4020420240722002",
7475
"element-plus": "^2.3.9",
7576
"vite-plugin-compression": "^0.5.1",
7677
"vitepress": "^1.0.1",
77-
"vue": "^3.3.4",
78+
"vue": "^3.4.38",
7879
"vue-i18n": "^9.2.2"
7980
},
8081
"devDependencies": {
81-
"@commitlint/cli": "^17.4.4",
82-
"@commitlint/config-conventional": "^17.4.4",
83-
"@dcloudio/types": "^3.3.2",
84-
"@dcloudio/uni-automator": "3.0.0-3090920231225001",
85-
"@dcloudio/uni-cli-shared": "3.0.0-3090920231225001",
86-
"@dcloudio/uni-stacktracey": "3.0.0-3090920231225001",
87-
"@dcloudio/vite-plugin-uni": "3.0.0-3090920231225001",
82+
"@commitlint/cli": "^19.5.0",
83+
"@commitlint/config-conventional": "^19.5.0",
84+
"@dcloudio/types": "^3.4.12",
85+
"@dcloudio/uni-automator": "3.0.0-4020420240722002",
86+
"@dcloudio/uni-cli-shared": "3.0.0-4020420240722002",
87+
"@dcloudio/uni-stacktracey": "3.0.0-4020420240722002",
88+
"@dcloudio/vite-plugin-uni": "3.0.0-4020420240722002",
8889
"@types/node": "^18.14.6",
8990
"@typescript-eslint/eslint-plugin": "^5.55.0",
9091
"@typescript-eslint/parser": "^5.55.0",
92+
"@uni-helper/uni-types": "1.0.0-alpha.4",
9193
"@vant/area-data": "^1.4.1",
9294
"@vant/touch-emulator": "^1.4.0",
93-
"@vue/runtime-core": "^3.2.45",
95+
"@vue/runtime-core": "^3.4.38",
9496
"@vue/tsconfig": "^0.1.3",
9597
"eslint": "^8.36.0",
9698
"eslint-config-prettier": "^8.7.0",
@@ -101,7 +103,7 @@
101103
"inquirer": "8.0.0",
102104
"lint-staged": "^13.2.0",
103105
"mini-types": "^0.1.7",
104-
"miniprogram-api-typings": "^3.9.0",
106+
"miniprogram-api-typings": "^3.12.3",
105107
"npm-run-all": "^4.1.5",
106108
"prettier": "^2.8.4",
107109
"query-string": "^8.1.0",
@@ -113,10 +115,10 @@
113115
"uni-read-pages-vite": "^0.0.6",
114116
"unplugin-auto-import": "^0.17.5",
115117
"unplugin-vue-components": "^0.26.0",
116-
"vite": "4.0.3",
118+
"vite": "5.2.8",
117119
"vitest": "^0.30.1",
118120
"vue-eslint-parser": "^9.1.0",
119-
"vue-tsc": "^2.0.6"
121+
"vue-tsc": "^2.0.29"
120122
},
121123
"config": {
122124
"commitizen": {

pnpm-lock.yaml

Lines changed: 2099 additions & 2518 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/wd-privacy-popup/wd-privacy-popup.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ const privacyHandler = (resolve: any) => {
6969
7070
onBeforeMount(() => {
7171
// 注册监听
72-
if ((wx as any).onNeedPrivacyAuthorization) {
73-
;(wx as any).onNeedPrivacyAuthorization((resolve: any) => {
72+
if (wx.onNeedPrivacyAuthorization) {
73+
wx.onNeedPrivacyAuthorization((resolve: any) => {
7474
if (typeof privacyHandler === 'function') {
7575
privacyHandler(resolve)
7676
}

src/pages/configProvider/Index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
<wd-input
7070
label="活动细则"
7171
label-width="100px"
72-
type="textarea"
7372
v-model="content"
7473
:maxlength="300"
7574
show-word-limit

src/pages/input/Index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const value5 = ref<string>('password')
7373
const value6 = ref<string>('')
7474
const value7 = ref<string>('1234')
7575
const value8 = ref<string>('')
76-
const value9 = ref<number | null>(null)
76+
const value9 = ref<number | ''>('')
7777
const value12 = ref<string>('')
7878
const value13 = ref<string>('该输入框禁用')
7979
const value14 = ref<string>('12345678')

src/uni_modules/wot-design-uni/components/wd-button/types.ts

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,41 @@
77
* @FilePath: \wot-design-uni\src\uni_modules\wot-design-uni\components\wd-button\types.ts
88
* 记得注释
99
*/
10-
import type { ExtractPropTypes } from 'vue'
10+
import type { ExtractPropTypes, PropType } from 'vue'
1111
import { baseProps, makeBooleanProp, makeStringProp } from '../common/props'
1212

1313
export type ButtonType = 'primary' | 'success' | 'info' | 'warning' | 'error' | 'default' | 'text' | 'icon'
1414
export type ButtonSize = 'small' | 'medium' | 'large'
15+
export type ButtonLang = 'zh_CN' | 'zh_TW' | 'en'
16+
17+
export type ButtonOpenType =
18+
| 'feedback'
19+
| 'share'
20+
| 'getUserInfo'
21+
| 'contact'
22+
| 'getPhoneNumber'
23+
| 'launchApp'
24+
| 'openSetting'
25+
| 'chooseAvatar'
26+
| 'getAuthorize'
27+
| 'lifestyle'
28+
| 'contactShare'
29+
| 'openGroupProfile'
30+
| 'openGuildProfile'
31+
| 'openPublicProfile'
32+
| 'shareMessageToFriend'
33+
| 'addFriend'
34+
| 'addColorSign'
35+
| 'addGroupApp'
36+
| 'addToFavorites'
37+
| 'chooseAddress'
38+
| 'chooseInvoiceTitle'
39+
| 'login'
40+
| 'subscribe'
41+
| 'favorite'
42+
| 'watchLater'
43+
| 'openProfile'
44+
| 'agreePrivacyAuthorization'
1545

1646
export const buttonProps = {
1747
...baseProps,
@@ -62,15 +92,15 @@ export const buttonProps = {
6292
/**
6393
* 开放能力
6494
*/
65-
openType: String,
95+
openType: String as PropType<ButtonOpenType>,
6696
/**
6797
* 指定是否阻止本节点的祖先节点出现点击态
6898
*/
6999
hoverStopPropagation: Boolean,
70100
/**
71101
* 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文
72102
*/
73-
lang: String,
103+
lang: String as PropType<ButtonLang>,
74104
/**
75105
* 会话来源,open-type="contact"时有效
76106
*/

src/uni_modules/wot-design-uni/components/wd-button/wd-button.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
]"
1818
:hover-start-time="hoverStartTime"
1919
:hover-stay-time="hoverStayTime"
20-
:open-type="disabled || loading ? '' : openType"
20+
:open-type="disabled || loading ? undefined : openType"
2121
:send-message-title="sendMessageTitle"
2222
:send-message-path="sendMessagePath"
2323
:send-message-img="sendMessageImg"

src/uni_modules/wot-design-uni/components/wd-calendar-view/yearPanel/year-panel.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ function scrollIntoView() {
9595
})
9696
}
9797
98-
const yearScroll = (e: Event) => {
98+
const yearScroll = (event: { detail: { scrollTop: number } }) => {
9999
if (years.value.length <= 1) {
100100
return
101101
}
102-
const scrollTop = Math.max(0, (e.target as Element).scrollTop)
102+
const scrollTop = Math.max(0, event.detail.scrollTop)
103103
doSetSubtitle(scrollTop)
104104
}
105105

src/uni_modules/wot-design-uni/components/wd-cell/wd-cell.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
:class="['wd-cell', isBorder ? 'is-border' : '', size ? 'is-' + size : '', center ? 'is-center' : '', customClass]"
44
:style="customStyle"
55
:hover-class="isLink || clickable ? 'is-hover' : 'none'"
6-
hover-stay-time="70"
6+
:hover-stay-time="70"
77
@click="onClick"
88
>
99
<view :class="['wd-cell__wrapper', vertical ? 'is-vertical' : '']">

src/uni_modules/wot-design-uni/components/wd-img/wd-img.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const rootClass = computed(() => {
5858
5959
const status = ref<'loading' | 'error' | 'success'>('loading')
6060
61-
function handleError(event: Event) {
61+
function handleError(event: any) {
6262
status.value = 'error'
6363
emit('error', event)
6464
}
@@ -70,7 +70,7 @@ function handleClick(event: MouseEvent) {
7070
}
7171
emit('click', event)
7272
}
73-
function handleLoad(event: Event) {
73+
function handleLoad(event: any) {
7474
status.value = 'success'
7575
emit('load', event)
7676
}

0 commit comments

Comments
 (0)