index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <script setup lang="ts">
  2. import { ref } from "vue"
  3. import Header from "./layouts/header.vue"
  4. import Footer from "./layouts/footer.vue"
  5. import Draggable from "vuedraggable"
  6. import { data } from "./panel"
  7. const editable = ref(true)
  8. function handleDrop(evt) {
  9. console.log(evt)
  10. }
  11. </script>
  12. <template>
  13. <div class="welcome">
  14. <div :class="`border-1 box-border p-[5px] ${editable ? 'border-[#9fd2ff]' : 'border-transparent'}`">
  15. <!-- <Header v-model="editable" /> -->
  16. <div class="flex w-full">
  17. <!-- left-start -->
  18. <div class="w-[1100px] h-full mr-[10px]">
  19. <Draggable :list="data.left" group="left" @change="handleDrop">
  20. <template #item="{ element }">
  21. <div class="w-full h-[180px] mb-2">
  22. <component :editable="editable" :is="element.key" />
  23. </div>
  24. </template>
  25. </Draggable>
  26. </div>
  27. <!-- left-end -->
  28. <!-- right-start -->
  29. <div class="flex-1 h-full">
  30. <template v-for="item in data.right" :key="item.key">
  31. <div class="w-full h-[180px] mb-2">
  32. <component :editable="editable" :is="item.key" />
  33. </div>
  34. </template>
  35. </div>
  36. <!-- right-end -->
  37. </div>
  38. </div>
  39. <Footer v-model="editable" />
  40. </div>
  41. </template>
  42. <style module scoped>
  43. .size {
  44. height: 335px;
  45. }
  46. </style>
  47. <style lang="scss" scoped>
  48. .welcome {
  49. min-height: calc(100vh - 48px);
  50. width: 100%;
  51. height: calc(100vh - 48px);
  52. display: flex;
  53. padding: 0 0 0 0;
  54. flex-direction: column;
  55. }
  56. </style>