text.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div class="text warp" :class="['text-'+componentContent.textPos,{'show-more':componentContent.showMore},'terminal' + terminal]" :style="{backgroundColor:componentContent.bgColor}">
  3. <div class="line-warp" :class="{'borderBot':componentContent.showLine}">
  4. <h3 class="h3" :style="{fontSize:componentContent.fontSizeNum+'px',fontWeight:componentContent.textFontW,color:componentContent.titColor}">{{componentContent.title}}</h3>
  5. <p class="p" :style="{fontSize:componentContent.describeSizeNum+'px',fontWeight:componentContent.describeFontW,color:componentContent.describeColor}">{{componentContent.describe}}</p>
  6. <div class="btn-more" v-show="componentContent.showMore" :class="'style'+componentContent.styleValue" @click="jumpLink(item.linkObj)"><span>查看更多</span><i class="iconfont icon-arrow-right"></i></div>
  7. </div>
  8. </div>
  9. </template>
  10. <script>
  11. export default {
  12. name: 'textComponent',
  13. data () {
  14. return {
  15. }
  16. },
  17. props: {
  18. terminal: {
  19. type: Number,
  20. default: 4
  21. },
  22. componentContent: {
  23. type: Object
  24. }
  25. }
  26. }
  27. </script>
  28. <style lang="scss" scoped>
  29. .text{
  30. padding: 0 20upx;
  31. position: relative;
  32. .line-warp{
  33. padding: 10upx 0;
  34. }
  35. .borderBot{
  36. border-bottom: 1upx solid #cccc;
  37. }
  38. .h3{
  39. line-height: 1.5;
  40. }
  41. .p{
  42. line-height: 1.5;
  43. margin-top: 5upx;
  44. }
  45. .style1{
  46. }
  47. .style2{
  48. .iconfont{
  49. display: none;
  50. }
  51. }
  52. .style3{
  53. span{
  54. display: none;
  55. }
  56. }
  57. &.text-left{
  58. text-align: left;
  59. &.show-more{
  60. position: relative;
  61. padding-right: 20upx;
  62. .btn-more{
  63. position: absolute;
  64. right: 0;
  65. top: 10upx;
  66. }
  67. }
  68. }
  69. &.text-center{
  70. text-align: center;
  71. }
  72. &.text-right{
  73. text-align: right;
  74. }
  75. }
  76. </style>