Comment.vue 924 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <el-dropdown :show-timeout="100" trigger="click">
  3. <el-button plain>
  4. {{ !comment_disabled?'Comment: opened':'Comment: closed' }}
  5. <i class="el-icon-caret-bottom el-icon--right" />
  6. </el-button>
  7. <el-dropdown-menu slot="dropdown" class="no-padding">
  8. <el-dropdown-item>
  9. <el-radio-group v-model="comment_disabled" style="padding: 10px;">
  10. <el-radio :label="true">
  11. Close comment
  12. </el-radio>
  13. <el-radio :label="false">
  14. Open comment
  15. </el-radio>
  16. </el-radio-group>
  17. </el-dropdown-item>
  18. </el-dropdown-menu>
  19. </el-dropdown>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. value: {
  25. type: Boolean,
  26. default: false
  27. }
  28. },
  29. computed: {
  30. comment_disabled: {
  31. get() {
  32. return this.value
  33. },
  34. set(val) {
  35. this.$emit('input', val)
  36. }
  37. }
  38. }
  39. }
  40. </script>