titles.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view v-if="titleConfig">
  3. <navigator :url="path(linkConfig)" hover-class="none" class='title' :class="[(textPosition==0?'left':textPosition==2?'right':''),(textStyle==1?'italics':textStyle==2?'blod':'')]" :style="'font-size:'+fontSize+'rpx;margin:'+mbConfig+'rpx '+prConfig+'rpx 0;background-color:'+titleColor+';border-radius:'+bgStyle+'rpx;'">
  4. <view :style="'color:'+textColor">{{titleConfig}}</view>
  5. </navigator>
  6. </view>
  7. </template>
  8. <script>
  9. // +----------------------------------------------------------------------
  10. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  11. // +----------------------------------------------------------------------
  12. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  13. // +----------------------------------------------------------------------
  14. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  15. // +----------------------------------------------------------------------
  16. // | Author: CRMEB Team <admin@crmeb.com>
  17. // +----------------------------------------------------------------------
  18. import {merPath} from "@/utils/index"
  19. export default {
  20. name: 'titles',
  21. props: {
  22. dataConfig: {
  23. type: Object,
  24. default: () => {}
  25. },
  26. merId: {
  27. type: String || Number,
  28. default: ''
  29. }
  30. },
  31. data() {
  32. return {
  33. fontSize:this.dataConfig.fontSize.val*2,
  34. linkConfig:this.dataConfig.linkConfig.value,
  35. mbConfig:this.dataConfig.mbConfig.val*2,
  36. prConfig:this.dataConfig.prConfig.val*2,
  37. textPosition:this.dataConfig.textPosition.type,
  38. textStyle:this.dataConfig.textStyle.type,
  39. titleColor:this.dataConfig.titleColor.color[0].item,
  40. titleConfig:this.dataConfig.titleConfig.value,
  41. textColor:this.dataConfig.themeColor.color[0].item,
  42. bgStyle:this.dataConfig.bgStyle.type ? '16' : '0'
  43. };
  44. },
  45. created() {},
  46. methods:{
  47. path(url){
  48. return merPath(url, this.merId)
  49. }
  50. }
  51. }
  52. </script>
  53. <style scoped lang="scss">
  54. .title{
  55. font-size: 40rpx;
  56. color: #282828;
  57. text-align: center;
  58. padding: 10rpx 0;
  59. &.left{
  60. text-align: left;
  61. }
  62. &.right{
  63. text-align: right;
  64. }
  65. &.blod{
  66. font-weight: bold;
  67. }
  68. &.italics{
  69. font-style: italic;
  70. }
  71. }
  72. </style>