-
Notifications
You must be signed in to change notification settings - Fork 5
Feature/rate component #5
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
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,181 @@ | |||
<template> | |||
<div | |||
class="cd-rate" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要写死cd这个前缀
export default { | ||
data () { | ||
return { | ||
ifIconHalf: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成isIconHalf
export default { | ||
data () { | ||
return { | ||
ifIconHalf: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成isIconHalf
data () { | ||
return { | ||
ifIconHalf: false, | ||
ifHoverChange: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
this.iconStates = this.updateItemStates(this.currentValue); | ||
}, | ||
|
||
props: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
放到最上面,让大家一眼就看到需要传哪些props
@@ -0,0 +1,8 @@ | |||
.cd-icon { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同样不要写死cd这个前缀
.cd-icon { | ||
display: inline-block; | ||
font-size: 18px; | ||
transition: 0.3s; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个有统一的方法的
@@ -0,0 +1,8 @@ | |||
.cd-icon { | |||
display: inline-block; | |||
font-size: 18px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要写死,放到variables.less里
|
||
setHoverIndex(item, e) { | ||
if (this.allowHalf && this.judgeHalf(e)) { | ||
item = item - 0.5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.5 应该是一个常量
@click="setCurrentValue(item, $event)" | ||
:style="{ cursor: rateDisabled ? 'auto' : 'pointer' }" | ||
> | ||
<i class="cd-icon" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用我们的icon组件
Resubmit component