Blame view

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