pull/9/head
tangjinzhou 7 years ago
commit a8c4f7662a

@ -100,24 +100,29 @@ export default {
Icon,
},
render (createElement) {
const {
classes, onMouseLeave, onClick, countList, onHover,
disabled, prefixCls, allowHalf, hoverValue,
stateValue, character, hasDefaultSlot,
} = this
return (
<ul
class={this.classes}
onMouseleave={this.onMouseLeave}>
class={classes}
onMouseleave={onMouseLeave}>
{
this.countList.map((item, i) => {
countList.map((item, i) => {
return (
<Star
ref={'stars' + i}
index={i}
disabled={this.disabled}
prefixCls={`${this.prefixCls}-star`}
allowHalf={this.allowHalf}
value={this.hoverValue === undefined ? this.stateValue : this.hoverValue}
onClick={this.onClick}
onHover={this.onHover}
disabled={disabled}
prefixCls={`${prefixCls}-star`}
allowHalf={allowHalf}
value={hoverValue === undefined ? stateValue : hoverValue}
onClick={onClick}
onHover={onHover}
key={i}>
{(this.hasDefaultSlot) ? (cloneVNodes(this.$slots.default, true)) : this.character}
{(hasDefaultSlot) ? (cloneVNodes(this.$slots.default, true)) : character}
</Star>
)
})

@ -31,16 +31,17 @@ export default {
},
},
render (createElement) {
const { getClassName, onClick, onHover, prefixCls } = this
return (
<li
class={this.getClassName}
onClick={this.onClick}
onMousemove={this.onHover}
class={getClassName}
onClick={onClick}
onMousemove={onHover}
>
<div class={`${this.prefixCls}-first`}>
<div class={`${prefixCls}-first`}>
{this.$slots.default}
</div>
<div class={`${this.prefixCls}-second`}>
<div class={`${prefixCls}-second`}>
{cloneVNodes(this.$slots.default, true)}
</div>
</li>

Loading…
Cancel
Save