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

修改一些问题 #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

修改一些问题 #21

wants to merge 3 commits into from

Conversation

hanyonggang
Copy link

1.在validate的mixin中添加对于组件验证的跳过功能
2.各种输入框在onChange时在之前返回一个val的基础上多返回一个label

Hagan added 3 commits September 11, 2018 16:41

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@change add label parameter
@@ -15,7 +15,8 @@ export default {
validateThrottle: {
type: Number,
default: 0
}
},
skipValidate: Boolean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议遵守“动词+名词”的命名规则。skipvalidate 都是动词。
PS ——

  1. validateThrottle这个属性,“名词+动词”,很拗口,以后尽量避免。
  2. 怎么解决这个问题呢?validateThrottleTime 太长,throttleTime 似乎又不能完全体现其作用。所以,是不是把所有和 validate 这一行为相关的属性,统一到一个 Object 下面更好?

@@ -502,7 +505,9 @@ export default {

emitChange () {
const value = this.multiple ? this.selectedValues : this.selectedValues[0]
this.$emit('change', value)
const label = this.multiple ? this.selectedLabel : this.selectedLabel[0]
console.log(value, label)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console 去掉。。。

@AngusFu
Copy link
Contributor

AngusFu commented Sep 11, 2018

@hanyonggang 另外,对你的 commit message 提出一些建议 ——

  1. “修改一些问题”,这个 PR 标题太不走心了。

  2. .vue .js 这种 file extension 就不要带到 commit message 的 scope 中了吧。

  3. 简短描述和长描述一模一样,没意义。尽量说清楚。

  4. "@change add label parameter" 这种话不通顺。参考: “emit extra label value for change event”,意即“为 change 事件增加一个额外的 label 值(作为参数)”。PS 要知道 @changev-bind:change 的缩写,描述一个事件就不要用 @change 了吧。

image

所以说,写 commit message 也是一个思(tong)考(ku)的过程。commit message 也算是一个项目的脸面之一,�开源项目,脸得好看。另外一方面,清晰的 commit message 能让人看懂你的修改到底干了些什么。其他就不一一说明了。

以上是一些不成熟的思考、意见。

再 PS 下,建议 google 下如何修改 commit message,学会将受用不尽。

@AngusFu AngusFu closed this Sep 11, 2018
@AngusFu AngusFu reopened this Sep 11, 2018
src/entry.js Outdated
@@ -2,7 +2,7 @@ import { Clair } from './scripts'
// import './styles/entry.css'

if (typeof window !== 'undefined' && window.Vue) {
// window.Vue.use(Clair)
window.Vue.use(Clair)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这一行为啥要注释掉?请给出解释。

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.

None yet

2 participants