四零语境前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
844 B

  1. <template>
  2. <web-view :src="'/uni_modules/yingbing-ReadPage/hybrid/html/content.html?content=' + encodeURIComponent(contentSync)"></web-view>
  3. </template>
  4. <script>
  5. export default {
  6. inject: ['color', 'fontSize', 'fontFamily', 'lineHeight', 'selectable'],
  7. props: {
  8. item: {
  9. type: Object,
  10. default () {
  11. return new Object
  12. }
  13. }
  14. },
  15. computed: {
  16. contentSync () {
  17. let content = this.item.content || ''
  18. content = content.replace('<whole-render', '<div').replace('<\/whole-render>', '<\/div>')
  19. return `<div class="yingbing-reader-content-html ${this.selectable ? 'user-selectable' : 'user-selectclose'}" style="box-sizing: border-box;color:${this.color};font-family:${this.fontFamily};font-size:${this.fontSize}px;line-height:${this.lineHeight}px;">` + content + '</div>'
  20. }
  21. }
  22. }
  23. </script>
  24. <style>
  25. </style>