TwSizing.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <script setup>
  2. import useSizing from '../../hooks/useSizing.js'
  3. const { Width, Height, MaxHeight } = useSizing()
  4. </script>
  5. <template>
  6. <view>
  7. <JcDemo v-bind="Width">
  8. <view class="relative rounded-xl overflow-auto">
  9. <view class="flex justify-center">
  10. <view class="space-y-2 font-mono font-bold text-xs text-center text-white">
  11. <view class="px-2 py-2 bg-blue-500 rounded-lg shadow-lg w-80 hidden sm:block">w-80</view>
  12. <view class="px-2 py-2 bg-blue-500 rounded-lg shadow-lg w-64 hidden sm:block">w-64</view>
  13. <view class="px-2 py-2 bg-blue-500 rounded-lg shadow-lg w-48">w-48</view>
  14. <view class="px-2 py-2 bg-blue-500 rounded-lg shadow-lg w-40">w-40</view>
  15. <view class="px-2 py-2 bg-blue-500 rounded-lg shadow-lg w-32">w-32</view>
  16. <view class="px-2 py-2 bg-blue-500 rounded-lg shadow-lg w-24">w-24</view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="relative rounded-xl overflow-auto mt-2">
  21. <view class="space-y-2 font-mono font-bold text-xs text-white">
  22. <view class="flex space-x-2">
  23. <view class="w-1_2 py-2 bg-violet-500 rounded-lg shadow-lg text-center">w-1_2</view>
  24. <view class="w-1_2 py-2 bg-violet-500 rounded-lg shadow-lg text-center">w-1_2</view>
  25. </view>
  26. <view class="flex space-x-2">
  27. <view class="w-2_5 py-2 bg-violet-500 rounded-lg shadow-lg text-center">w-2_5</view>
  28. <view class="w-3_5 py-2 bg-violet-500 rounded-lg shadow-lg text-center">w-3_5</view>
  29. </view>
  30. <view class="flex space-x-2">
  31. <view class="w-1_3 py-2 bg-violet-500 rounded-lg shadow-lg text-center">w-1_3</view>
  32. <view class="w-2_3 py-2 bg-violet-500 rounded-lg shadow-lg text-center">w-2_3</view>
  33. </view>
  34. <view class="space-x-2 hidden sm:flex">
  35. <view class="w-1_4 py-2 bg-violet-500 rounded-lg shadow-lg text-center">w-1_4</view>
  36. <view class="w-3_4 py-2 bg-violet-500 rounded-lg shadow-lg text-center">w-3_4</view>
  37. </view>
  38. <view class="space-x-2 hidden sm:flex">
  39. <view class="w-1_5 py-2 bg-violet-500 rounded-lg shadow-lg text-center">w-1_5</view>
  40. <view class="w-4_5 py-2 bg-violet-500 rounded-lg shadow-lg text-center">w-4_5</view>
  41. </view>
  42. <view class="space-x-2 hidden sm:flex">
  43. <view class="w-1_6 py-2 bg-violet-500 rounded-lg shadow-lg text-center">w-1_6</view>
  44. <view class="w-5_6 py-2 bg-violet-500 rounded-lg shadow-lg text-center">w-5_6</view>
  45. </view>
  46. <view class="w-full py-2 bg-violet-500 rounded-lg shadow-lg text-center text-white font-mono">w-full</view>
  47. </view>
  48. </view>
  49. </JcDemo>
  50. <JcDemo v-bind="Height">
  51. <view class="flex justify-center items-end space-x-4 font-mono font-bold text-xs text-center text-white">
  52. <view class="w-8 bg-blue-500 rounded-lg shadow-lg h-96 relative">
  53. <view class="absolute w-8 bottom-6">
  54. <view class="-rotate-90">h-96</view>
  55. </view>
  56. </view>
  57. <view class="w-8 bg-blue-500 rounded-lg shadow-lg h-80 relative">
  58. <view class="absolute w-8 bottom-6">
  59. <view class="-rotate-90">h-80</view>
  60. </view>
  61. </view>
  62. <view class="w-8 bg-blue-500 rounded-lg shadow-lg h-64 relative">
  63. <view class="absolute w-8 bottom-6">
  64. <view class="-rotate-90">h-64</view>
  65. </view>
  66. </view>
  67. <view class="w-8 bg-blue-500 rounded-lg shadow-lg h-48 relative">
  68. <view class="absolute w-8 bottom-6">
  69. <view class="-rotate-90">h-48</view>
  70. </view>
  71. </view>
  72. <view class="w-8 bg-blue-500 rounded-lg shadow-lg h-40 relative">
  73. <view class="absolute w-8 bottom-6">
  74. <view class="-rotate-90">h-40</view>
  75. </view>
  76. </view>
  77. <view class="w-8 bg-blue-500 rounded-lg shadow-lg h-32 relative">
  78. <view class="absolute w-8 bottom-6">
  79. <view class="-rotate-90">h-32</view>
  80. </view>
  81. </view>
  82. <view class="w-8 bg-blue-500 rounded-lg shadow-lg h-24 relative">
  83. <view class="absolute w-8 bottom-6">
  84. <view class="-rotate-90">h-24</view>
  85. </view>
  86. </view>
  87. </view>
  88. </JcDemo>
  89. <JcDemo v-bind="MaxHeight"></JcDemo>
  90. </view>
  91. </template>
  92. <style>
  93. </style>