disabled.vue 906 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <el-tree :data="data" :props="defaultProps" show-checkbox />
  3. </template>
  4. <script lang="ts" setup>
  5. const defaultProps = {
  6. children: 'children',
  7. label: 'label',
  8. disabled: 'disabled',
  9. }
  10. const data = [
  11. {
  12. id: 1,
  13. label: 'Level one 1',
  14. children: [
  15. {
  16. id: 3,
  17. label: 'Level two 2-1',
  18. children: [
  19. {
  20. id: 4,
  21. label: 'Level three 3-1-1',
  22. },
  23. {
  24. id: 5,
  25. label: 'Level three 3-1-2',
  26. disabled: true,
  27. },
  28. ],
  29. },
  30. {
  31. id: 2,
  32. label: 'Level two 2-2',
  33. disabled: true,
  34. children: [
  35. {
  36. id: 6,
  37. label: 'Level three 3-2-1',
  38. },
  39. {
  40. id: 7,
  41. label: 'Level three 3-2-2',
  42. disabled: true,
  43. },
  44. ],
  45. },
  46. ],
  47. },
  48. ]
  49. </script>