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

修改 空指针和语法修改 #17

Merged
merged 1 commit into from
Sep 5, 2021
Merged

修改 空指针和语法修改 #17

merged 1 commit into from
Sep 5, 2021

Conversation

zsdycs
Copy link
Contributor

@zsdycs zsdycs commented Sep 1, 2021

1. 空指针

当仅希望使用默认错误消息时,messages 不设置,如下:

new WeValidator({
       rules: {
          [data._name]: {
            required: data._required,
          },
        },
        // messages: {
        //   [data._name]: {
        //     required: '请输入xxx',
        //   },
        // },
}

这个时候,直接使用 messages.hasOwnProperty,将会空指针报错。

2. 语法修改

errorParam && this._showErrorMessage(errorParam, onMessage);,这个写法挺奇怪的,很好奇这是 JS 那个版本的语法。

@ChanceYu ChanceYu merged commit 00f1369 into ChanceYu:master Sep 5, 2021
@ChanceYu
Copy link
Owner

ChanceYu commented Sep 5, 2021

已在 v2.1.16 版本修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants