titles.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view v-show="!isSortType">
  3. <view v-if="titleConfig" :style="'margin:0 '+prConfig*2+'rpx;'">
  4. <navigator :url="linkConfig" hover-class="none" class='title' :class="[(textPosition==0?'left':textPosition==2?'right':''),(textStyle==1?'italics':textStyle==2?'blod':''), (bgStyle===0?'':'borderRadius15')]" :style="'font-size:'+fontSize+'rpx;margin-top:'+mbConfig*2+'rpx;background-color:'+titleColor+';color:'+themeColor+';'">
  5. <div>{{titleConfig}}</div>
  6. </navigator>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. name: 'titles',
  13. props: {
  14. dataConfig: {
  15. type: Object,
  16. default: () => {}
  17. },
  18. isSortType:{
  19. type: String | Number,
  20. default:0
  21. }
  22. },
  23. data() {
  24. return {
  25. fontSize:this.dataConfig.fontSize.val*2,
  26. linkConfig:this.dataConfig.linkConfig.value,
  27. mbConfig:this.dataConfig.mbConfig.val,
  28. textPosition:this.dataConfig.textPosition.type,
  29. textStyle:this.dataConfig.textStyle.type,
  30. titleColor:this.dataConfig.titleColor.color[0].item,
  31. titleConfig:this.dataConfig.titleConfig.value,
  32. themeColor:this.dataConfig.themeColor.color[0].item,
  33. prConfig:this.dataConfig.prConfig.val,
  34. bgStyle:this.dataConfig.bgStyle.type
  35. };
  36. },
  37. created() {},
  38. methods: {}
  39. }
  40. </script>
  41. <style lang="scss">
  42. .title{
  43. font-size: 40rpx;
  44. color: #282828;
  45. text-align: center;
  46. width: 100%;
  47. padding: 20rpx;
  48. box-sizing: border-box;
  49. &.left{
  50. text-align: left;
  51. }
  52. &.right{
  53. text-align: right;
  54. }
  55. &.blod{
  56. font-weight: bold;
  57. }
  58. &.italics{
  59. font-style: italic;
  60. }
  61. }
  62. </style>