{"action":"opened","issue":{"url":"https://api.github.com/repos/ElemeFE/element/issues/2080","repository_url":"https://api.github.com/repos/ElemeFE/element","labels_url":"https://api.github.com/repos/ElemeFE/element/issues/2080/labels{/name}","comments_url":"https://api.github.com/repos/ElemeFE/element/issues/2080/comments","events_url":"https://api.github.com/repos/ElemeFE/element/issues/2080/events","html_url":"https://github.com/ElemeFE/element/issues/2080","id":198009199,"number":2080,"title":"form无法正常提交","user":{"login":"sandysong","id":189245,"avatar_url":"https://avatars.githubusercontent.com/u/189245?v=3","gravatar_id":"","url":"https://api.github.com/users/sandysong","html_url":"https://github.com/sandysong","followers_url":"https://api.github.com/users/sandysong/followers","following_url":"https://api.github.com/users/sandysong/following{/other_user}","gists_url":"https://api.github.com/users/sandysong/gists{/gist_id}","starred_url":"https://api.github.com/users/sandysong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandysong/subscriptions","organizations_url":"https://api.github.com/users/sandysong/orgs","repos_url":"https://api.github.com/users/sandysong/repos","events_url":"https://api.github.com/users/sandysong/events{/privacy}","received_events_url":"https://api.github.com/users/sandysong/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-29T13:42:53Z","updated_at":"2016-12-29T13:42:53Z","closed_at":null,"body":"### ElementUI version\r\n1.0.9有此问题，1.0.8没有此问题\r\n\r\n### OS/Browers version\r\nmacOS/Chrome 55\r\n\r\n### Vue version\r\n2.1.7\r\n\r\nsubmit() {\r\n  const v = this\r\n  console.log('能执行到这里')\r\n  this.$refs.form.validate((valid) => {\r\n    console.log('执行不到这里')\r\n    if (!valid) {\r\n      return false;\r\n    }\r\n  }\r\n}\r\n\r\n\r\n以下是我的验证规则：\r\nrules: {\r\n          editor: [{required: true, message: '请输入责任编辑', trigger: 'blur'}],\r\n          platforms: [{type: 'array', required: true, message: '请至少选择一个平台', trigger: 'change'}],\r\n          title: [{required: true, message: '请输入标题', trigger: 'blur'}],\r\n          android_content: [\r\n            {\r\n              validator(rule, value, cb)  {\r\n                v.push.platforms.forEach(e => {\r\n                  if (e == 'Android' && value == '') {\r\n                    cb(['请输入Android平台内容'])\r\n                  } else {\r\n                    return true\r\n                  }\r\n                })\r\n              }, trigger: 'blur', length: {min:5, max:20}\r\n            }\r\n          ],\r\n          iphone_content: [\r\n            {\r\n              validator(rule, value, cb)  {\r\n                v.push.platforms.forEach(e => {\r\n                  if ((e == 'iPhone' || e == 'iPhonePro') && value == '') {\r\n                    cb(['请输入iPhone/iPhonePro平台内容'])\r\n                  } else {\r\n                    return true\r\n                  }\r\n                })\r\n              }, trigger: 'blur', length: {min:5, max:80}\r\n            }],\r\n          url: [\r\n            {required: true, message: '请输入链接地址', trigger: 'blur'},\r\n            {type: \"url\", message: '请输入合法链接地址', trigger: 'blur'},\r\n          ],\r\n          push_at: [\r\n            {type: 'string', required: true, message: '请输入推送时间', trigger: 'change'},\r\n            (rule, value, cb, source, option) => {\r\n              if (moment(value).hours() < 7 || moment(value).hours() >= 23) {\r\n                cb(['推送时间必须在上午7点至下午23点之间'])\r\n              }\r\n            }\r\n          ],\r\n          expire_at: [{type: 'string', required: true, message: '请输入失效时间', trigger: 'change'}]\r\n        },\r\n"}}
{"actor":{"display_login":"sandysong"}}