You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

shadow.vue 2.5 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view>
  3. <l-title>边框:</l-title>
  4. <view class="padding bg-white flex flex-wrap">
  5. <view class="margin-sm example solid">四周</view>
  6. <view class="margin-sm example solid-top">上</view>
  7. <view class="margin-sm example solid-bottom">下</view>
  8. <view class="margin-sm example solid-left">左</view>
  9. <view class="margin-sm example solid-right">右</view>
  10. </view>
  11. <l-demo-description>
  12. 给需要添加边框的元素设置 class="solid" 即可添加四周边框;
  13. 如设置 class="solid-*",并把*替换成 top、bottom、left、right,则分别是上、下、左、右边框
  14. </l-demo-description>
  15. <l-title>加粗边框:</l-title>
  16. <view class="padding bg-white flex flex-wrap">
  17. <view class="margin-sm example solids">四周</view>
  18. <view class="margin-sm example solids-top">上</view>
  19. <view class="margin-sm example solids-bottom">下</view>
  20. <view class="margin-sm example solids-left">左</view>
  21. <view class="margin-sm example solids-right">右</view>
  22. </view>
  23. <l-demo-description>
  24. 给需要添加边框的元素设置 class="solids" 即可添加四周粗边框;
  25. 如设置 class="solids-*",并把*替换成 top、bottom、left、right,则分别是上、下、左、右粗边框
  26. </l-demo-description>
  27. <l-title>阴影:</l-title>
  28. <view class="padding bg-gray text-center">
  29. <view class="padding-xl radius shadow bg-white">默认阴影</view>
  30. <view class="padding-xl radius shadow bg-blue margin-top">
  31. 根据背景颜色而改变的阴影
  32. </view>
  33. <view class="padding-xl radius shadow shadow-lg bg-white margin-top">长阴影</view>
  34. <view class="padding-xl radius shadow shadow-lg bg-blue margin-top">长阴影</view>
  35. <view class="padding-xl radius shadow-warp bg-white margin-top">翘边阴影</view>
  36. <view
  37. class="padding-xl radius shadow-blur bg-red margin-top bg-img"
  38. style="background-image:url('https://img.learun.cn/wxcx/pic.jpg');"
  39. >
  40. <view>根据背景图而改变的阴影</view>
  41. </view>
  42. </view>
  43. <l-demo-description>
  44. 给元素添加一个 class ,取值:shadow 是普通阴影,shadow-lg 是长阴影,shadow-warp 是翘边阴影;
  45. 如果容器有背景色,则阴影也会有背景色;如果容器是图片背景,可以使用 shadow-blur
  46. </l-demo-description>
  47. </view>
  48. </template>
  49. <style scoped>
  50. .example {
  51. height: 130rpx;
  52. width: 130rpx;
  53. text-align: center;
  54. line-height: 130rpx;
  55. font-size: 40rpx;
  56. }
  57. </style>