pull/9/head
tangjinzhou 7 years ago
commit a8c4f7662a

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

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

Loading…
Cancel
Save