Skip to content

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

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

Conversation

IWSR
Copy link
Contributor

@IWSR IWSR commented May 7, 2018

Resubmit component

@@ -0,0 +1,181 @@
<template>
<div
class="cd-rate"
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

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: {
Copy link
Contributor

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 {
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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"
Copy link
Contributor

Choose a reason for hiding this comment

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

使用我们的icon组件

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