[improvement] Rate: add readonly prop (#1731)

This commit is contained in:
neverland
2018-08-30 21:27:10 +08:00
committed by GitHub
parent ad5ca640e0
commit 3bec1de55d
3 changed files with 7 additions and 7 deletions
+3 -5
View File
@@ -20,14 +20,12 @@ export default create({
name: 'rate',
props: {
readonly: Boolean,
disabled: Boolean,
size: {
type: Number,
default: 20
},
disabled: {
type: Boolean,
default: false
},
color: {
type: String,
default: '#ffd21e'
@@ -64,7 +62,7 @@ export default create({
methods: {
onSelect(index) {
if (!this.disabled) {
if (!this.disabled && !this.readonly) {
this.$emit('input', index + 1);
this.$emit('change', index + 1);
}