cl-block.vue 723 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <view
  3. class="cl-block"
  4. :style="{
  5. height: parseRpx(height),
  6. width: parseRpx(width),
  7. padding: parseRpx(padding),
  8. margin: parseRpx(margin),
  9. borderRadius: parseRpx(borderRadius),
  10. border,
  11. backgroundColor
  12. }"
  13. >
  14. <slot></slot>
  15. </view>
  16. </template>
  17. <script>
  18. import { parseRpx } from "../../untils/style";
  19. export default {
  20. name: "cl-block",
  21. componentName: "ClBlock",
  22. props: {
  23. backgroundColor: String,
  24. lineHeight: String,
  25. textAlign: String,
  26. border: String,
  27. boxSizing: String,
  28. height: [String, Number],
  29. width: [String, Number],
  30. padding: [String, Number, Array],
  31. margin: [String, Number, Array],
  32. borderRadius: [String, Number]
  33. },
  34. methods: {
  35. parseRpx
  36. }
  37. };
  38. </script>