[improvement] Rate: add readonly prop (#1731)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user