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

AtModal模态框属性isOpened boolean无效 string有效小程序报错 #844

Closed
liuyaochen04 opened this issue Nov 1, 2019 · 3 comments
Assignees
Labels
fixed but not released 已修复但未发布

Comments

@liuyaochen04
Copy link

liuyaochen04 commented Nov 1, 2019

版本:
"dependencies": {
"@tarojs/async-await": "^1.3.20",
"@tarojs/components": "1.3.22",
"@tarojs/redux": "^1.3.20",
"@tarojs/redux-h5": "^1.3.20",
"@tarojs/router": "1.3.22",
"@tarojs/taro": "1.3.22",
"@tarojs/taro-alipay": "1.3.22",
"@tarojs/taro-h5": "1.3.22",
"@tarojs/taro-qq": "1.3.22",
"@tarojs/taro-quickapp": "1.3.22",
"@tarojs/taro-swan": "1.3.22",
"@tarojs/taro-tt": "1.3.22",
"@tarojs/taro-weapp": "1.3.22",
"dva-core": "^2.0.0",
"dva-loading": "^3.0.14",
"lodash": "^4.17.15",
"nerv-devtools": "^1.4.0",
"nervjs": "^1.4.0",
"redux": "^4.0.4",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"taro-ui": "^2.2.4"
},

代码:

<AtModal isOpened={modelFlag} loseOnClickOverlay={false} className='verifyModal'
>


您需要谨进行身份验证
<AtButton className='verifyBtn' type='primary' onClick={() => goToVerify()}>微信授权


`

isOpened boolean 无效,
isOpened string 可以 但是小程序有错误
Warning: Failed prop type: Invalid prop isOpened of type string supplied to AtModal, expected boolean

ts类型是boolean 文档是string?请修复

@taro-ui-bot
Copy link

taro-ui-bot bot commented Nov 1, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@liuyaochen04
Copy link
Author

这个bug 没有人解决吗?

@AwesomeDevin AwesomeDevin self-assigned this Dec 10, 2019
@AwesomeDevin AwesomeDevin added the fixed but not released 已修复但未发布 label Dec 10, 2019
@lawushanshan
Copy link

这个问题我也遇到了,Taroui版本号 2.2.1。
目前我找到的解决方案如下:
经测试发现 ,isOnpend的属性通过从props中获取值,可以实现窗口的关闭与否,所以就讲TaroModal组件简单的封装成一个组件,然后通过属性传值,就可以控制窗口的关闭,封装程度自己调整;
实例组件代码:
import Taro, { Component } from "@tarojs/taro";
import { View, Button } from "@tarojs/components";
import { AtModal, AtModalHeader, AtModalContent, AtModalAction } from "taro-ui";
import "./index.less";
import PropTypes from "prop-types";

// 基于TaroUi的弹出框组件
class Login extends Component {
static propTypes = {
closeModel: PropTypes.func,
confirmModel: PropTypes.func,
isShow: PropTypes.bool
};
static defaultProps = {
isShow: false,
closeModel: () => {},
confirmModel: () => {}
};
render() {
const { isShow, closeModel, confirmModel } = this.props;
return (

<AtModal
isOpened={isShow}
onClose={() => {
closeModel();
}}
>
{this.props.children}

<Button
style={{ color: "#4A4A4A" }}
onClick={() => {
confirmModel();
}}
>
确定
{" "}

           

);
}
}
export default Login;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed but not released 已修复但未发布
Projects
None yet
Development

No branches or pull requests

3 participants