zj-page-container.vue 746 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <view
  3. :class="{
  4. 'zj-page-container': true,
  5. 'zj-page-container-row': direction === 'row',
  6. 'zj-page-container-column': direction === 'column'
  7. }"
  8. :style="{
  9. width: width,
  10. height: height
  11. }"
  12. >
  13. <slot></slot>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. name: 'ZjPageContainer',
  19. props: {
  20. width: {
  21. type: String,
  22. default: '100%'
  23. },
  24. height: {
  25. type: String,
  26. default: '100%'
  27. },
  28. direction: {
  29. type: String,
  30. default: 'column'
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="scss" scoped>
  36. .zj-page-container {
  37. display: flex;
  38. }
  39. .zj-page-container-row {
  40. flex-direction: row;
  41. }
  42. .zj-page-container-column {
  43. flex-direction: column;
  44. }
  45. </style>