<template>
          <el-form label-width="160px" style="margin-top:180px">
          <el-form-item label="评论显示类型：" >
            <el-checkbox-group v-model="type">
              <el-checkbox   v-for="type in types" :label="type.label"  :key="type.value"></el-checkbox>
              </el-checkbox-group>
          </el-form-item>
        </el-form>
</template>
<script>
export default {
  data() {
    return {
      type: [],
      types: []
    }
  },
  methods: {
    getCode() {
      let dtp = ''
      if (this.type.length > 0) {
        dtp = ` type="${this.types
          .filter(val => this.type.includes(val.label))
          .map(val => val.value)
          .join('||')}"`
      }
      return `\n<cms:comment${dtp}></cms:comment>`
    },
    async init() {
      let res = await axios.get('/ui/platform/codes/CommentDisplayType')
      this.types = res.data.data
    }
  },
  async created() {}
}
</script>
