MessageBox.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div :style="styleMap?.mainStyle" class="overflow-hidden box-broder">
  3. <div :style="styleMap?.titleStyle" class="flex items-center justify-between box-broder p-10px">
  4. <span>{{ title }}</span>
  5. <span
  6. class="bg-#2195f6 shadow-[0_4px_0_#cccccc] text-white w-40px h-30px rounded-10px grid place-items-center"
  7. >
  8. <LuX size="14px" />
  9. </span>
  10. </div>
  11. <div :style="styleMap?.contentStyle" class="box-broder p-10px">{{ content }}</div>
  12. <div class="flex items-center justify-around">
  13. <div
  14. :style="{ ...styleMap?.btnsStyle, width: btnWidth + 'px', height: btnHeight + 'px' }"
  15. v-for="(btn, index) in btns"
  16. :key="index"
  17. class="grid place-items-center shadow-[0_4px_0_#cccccc]"
  18. >
  19. {{ btn.text }}
  20. </div>
  21. </div>
  22. </div>
  23. </template>
  24. <script setup lang="ts">
  25. import { useWidgetStyle } from '../hooks/useWidgetStyle'
  26. import { LuX } from 'vue-icons-plus/lu'
  27. const props = defineProps<{
  28. width: number
  29. height: number
  30. styles: any
  31. state: string
  32. part: string
  33. title: string
  34. content: string
  35. closeBtn: boolean
  36. btnWidth: number
  37. btnHeight: number
  38. btns: { text: string }[]
  39. }>()
  40. const styleMap = useWidgetStyle({
  41. widget: 'lv_msgbox',
  42. props
  43. })
  44. </script>
  45. <style scoped></style>