TwReadme.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <script setup>
  2. import useVars from '../../hooks/useVars.js'
  3. import useColor from '../../hooks/useColor.js'
  4. const { pxs, percents, border_radius, xls, opacitys } = useVars()
  5. const { colors, color } = useColor()
  6. function copy(data) {
  7. uni.setClipboardData({ data: `${data}` })
  8. }
  9. </script>
  10. <template>
  11. <JcDemo :hasShowClass="false" title="透明度">
  12. <template v-for="d, i in opacitys" :key="i">
  13. <view class="px-2 py-1 border-b border-slate-100" @tap="copy(d.opacity)">
  14. {{d.value}}
  15. <text class="text-slate-300 text-xs font-mono ml-2">// {{d.calc}} = {{d.opacity}}</text>
  16. </view>
  17. </template>
  18. </JcDemo>
  19. <JcDemo :hasShowClass="false" title="尺寸">
  20. <template v-for="d, i in pxs" :key="i">
  21. <view class="px-2 py-1 border-b border-slate-100" @tap="copy(d.rpx)">
  22. {{d.value}}
  23. <text class="text-slate-300 text-xs font-mono ml-2">// {{d.rpx}}rpx</text>
  24. </view>
  25. </template>
  26. </JcDemo>
  27. <JcDemo :hasShowClass="false" title="百分比">
  28. <template v-for="d, i in percents" :key="i">
  29. <view class="px-2 py-1 border-b border-slate-100" @tap="copy(d.percent)">
  30. {{d.value}}
  31. <text class="text-slate-300 text-xs font-mono ml-2">// {{d.percent}}</text>
  32. </view>
  33. </template>
  34. </JcDemo>
  35. <JcDemo :hasShowClass="false" title="圆角">
  36. <template v-for="d, i in border_radius" :key="i">
  37. <view class="px-2 py-1 border-b border-slate-100" @tap="copy(d.rpx)">
  38. {{d.value}}
  39. <text class="text-slate-300 text-xs font-mono ml-2">// {{d.rpx}}rpx</text>
  40. </view>
  41. </template>
  42. </JcDemo>
  43. <JcDemo :hasShowClass="false" title="文字">
  44. <template v-for="d, i in xls" :key="i">
  45. <view class="px-2 py-1 border-b border-slate-100" @tap="copy(d.rpx)">
  46. {{d.value}}
  47. <text class="text-slate-300 text-xs font-mono ml-2">// {{d.rpx}}</text>
  48. </view>
  49. </template>
  50. </JcDemo>
  51. <JcDemo :hasShowClass="false" title="颜色">
  52. <template v-for="d, i in color" :key="i">
  53. <view class="px-2 py-1 border-b border-slate-100 flex items-center" @tap="copy(d.color)">
  54. {{d.value}}
  55. <text class="text-slate-300 text-xs font-mono ml-2">// {{d.color}}</text>
  56. <text class="w-6 h-6 ml-4 border border-slate-200" :style="{background: d.color}"></text>
  57. </view>
  58. </template>
  59. </JcDemo>
  60. </template>
  61. <style>
  62. </style>