hc-form-checkbox-group.vue 783 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <div>
  3. <el-checkbox-group v-model="isVal" size="large">
  4. <template v-for="item in datas">
  5. <el-checkbox :label="item" />
  6. </template>
  7. <template v-for="item in objs">
  8. <el-checkbox :label="item.key">{{item.name}}</el-checkbox>
  9. </template>
  10. </el-checkbox-group>
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. name: "HcFormCheckboxGroup",
  16. props: {
  17. datas: {
  18. type: Array,
  19. default: () => {
  20. return []
  21. }
  22. },
  23. objs: {
  24. type: Array,
  25. default: () => {
  26. return []
  27. }
  28. },
  29. val: {
  30. type: [Number,String],
  31. default: ''
  32. },
  33. keyname: {
  34. type: [Number,String],
  35. default: ''
  36. },
  37. },
  38. data() {
  39. return {
  40. isVal: []
  41. }
  42. },
  43. };
  44. </script>