index.vue 548 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <view class="jnpf-text" :style="getTextstyle">{{content}}</view>
  3. </template>
  4. <script>
  5. export default {
  6. name: 'jnpf-text',
  7. props: {
  8. textStyle: {
  9. type: Object,
  10. default: () => ({})
  11. },
  12. content: {
  13. default: ''
  14. }
  15. },
  16. computed: {
  17. getTextstyle() {
  18. return {
  19. ...this.textStyle,
  20. 'line-height': this.textStyle['line-height'] * 2 + 'rpx',
  21. 'font-size': this.textStyle['font-size'] * 2 + 'rpx'
  22. }
  23. }
  24. }
  25. }
  26. </script>
  27. <style lang="scss" scoped>
  28. .jnpf-text {
  29. padding: 20rpx 32rpx;
  30. }
  31. </style>