MtaRateBase.vue 840 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <el-rate
  3. :show-text="showText"
  4. :texts="texts"
  5. @change="changeRateValue"
  6. v-model="value"
  7. >
  8. </el-rate>
  9. </template>
  10. <script>
  11. export default {
  12. name: 'MtaRateBase',
  13. props: {
  14. defaultValue: {
  15. type: Number,
  16. default: 0,
  17. },
  18. },
  19. data() {
  20. return {
  21. texts: ['2分', '4分', '6分', '8分', '10分'],
  22. showText: false,
  23. value: this.defaultValue,
  24. };
  25. },
  26. methods: {
  27. changeRateValue(data) {
  28. this.$emit('change', data);
  29. },
  30. reventData(data) {
  31. this.value = data;
  32. }
  33. },
  34. };
  35. </script>
  36. <style scoped>
  37. </style>