index.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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: 28rpx 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. line-height: $fontSize5;
  57. font-weight: 500;
  58. color: #000000;
  59. &:after{
  60. @include after;
  61. left: 0;
  62. right: 0;
  63. bottom: 0;
  64. width: 34rpx;
  65. height: 0;
  66. border: 3rpx solid $buttonPrimaryColor;
  67. border-radius: 2rpx;
  68. margin: auto;
  69. }
  70. }
  71. .u-panel-link{
  72. font-size: $fontSize2;
  73. color: #7D7D7D;
  74. cursor: pointer;
  75. }
  76. }
  77. </style>