index.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view class="u-panel">
  3. <view class="u-panel-head">
  4. <view class="u-panel-title">{{ title }}</view>
  5. <view v-if="link" class="u-panel-link" @tap="onClickLink">
  6. {{ linkText || '查看更多' }} <van-icon class="van-icon" name="arrow" />
  7. </view>
  8. </view>
  9. <view class="u-panel-body">
  10. <slot></slot>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. options: {
  17. styleIsolation: 'shared'
  18. },
  19. props: {
  20. title: String,
  21. link: String,
  22. linkText: String
  23. },
  24. computed: {
  25. style() {
  26. }
  27. },
  28. watch: {
  29. },
  30. data() {
  31. return {
  32. }
  33. },
  34. created() {
  35. },
  36. mounted() {
  37. },
  38. methods: {
  39. onClickLink() {
  40. this.navigateTo(this.link)
  41. }
  42. }
  43. }
  44. </script>
  45. <style lang="scss">
  46. .u-panel{
  47. padding: 24rpx 28rpx;
  48. }
  49. .u-panel-head{
  50. @include display-flex-between;
  51. margin-bottom: 26rpx;
  52. .u-panel-title{
  53. position: relative;
  54. padding-bottom: 20rpx;
  55. font-size: $fontSize5;
  56. font-weight: 500;
  57. color: #000000;
  58. &:after{
  59. @include after;
  60. left: 0;
  61. right: 0;
  62. bottom: 0;
  63. width: 34rpx;
  64. height: 0;
  65. border: 3rpx solid $buttonPrimaryColor;
  66. border-radius: 2rpx;
  67. margin: auto;
  68. }
  69. }
  70. .u-panel-link{
  71. font-size: $fontSize2;
  72. color: #7D7D7D;
  73. cursor: pointer;
  74. }
  75. }
  76. </style>