Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.3.17 showModal:fail parameter error: parameter.cancelText should be String instead of Undefined'} #10957

Closed
Mr-sgreen opened this issue Dec 22, 2021 · 5 comments
Labels
duplicate This issue or pull request already exists F-vue3 Framework - Vue 3 T-h5 Target - 编译到 H5 V-3 Version - 3.x

Comments

@Mr-sgreen
Copy link

Mr-sgreen commented Dec 22, 2021

相关平台

H5

复现仓库

https://github.com/Mr-sgreen/taro-bug
浏览器版本: Chrome 96.0.4664.110
使用框架: Vue 3

复现步骤

Taro.showModal({
title: '温馨提示',
content: '记得按时吃饭',
showCancel: false,
confirmColor: '#276FF5',
confirmText: '知道了',
});

期望结果

正常弹出Modal

实际结果

无法弹出Modal,查看控制台报错: showModal:fail parameter error: parameter.cancelText should be String instead of Undefined

环境信息

  Taro CLI 3.3.17 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 14.15.5 - E:\Program Files\nodejs\node.EXE
      npm: 6.14.11 - E:\Program Files\nodejs\npm.CMD

补充信息

1.猜测要么是ts的定义文件没更新为不允许为undefined
2.要么是内部代码没处理好,要么是我npm版本太低?导致编译出错?

@taro-bot2 taro-bot2 bot added F-vue3 Framework - Vue 3 T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Dec 22, 2021
@Mr-sgreen
Copy link
Author

同样报错的字段还有:
cancelColor
confirmColor
confirmText

@Mr-sgreen
Copy link
Author

之前好像是如果不传cancelText默认是为 ’取消‘ 的

@Mr-sgreen
Copy link
Author

官网的文档目前
cancelText
cancelColor
confirmColor
confirmText
这几个字段也是显示非必填

@bobsam
Copy link

bobsam commented Dec 23, 2021

@ZakaryCode @Chen-jj 目前React也有类似的问题

@ZakaryCode
Copy link
Contributor

重复错误 #10949

@ZakaryCode ZakaryCode added the duplicate This issue or pull request already exists label Dec 23, 2021
@taro-bot2 taro-bot2 bot closed this as completed Dec 23, 2021
@ZakaryCode ZakaryCode moved this to Done in H5 Apr 10, 2023
@ZakaryCode ZakaryCode added this to H5 Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists F-vue3 Framework - Vue 3 T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

3 participants