fuli-info.vue 592 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <view class="fuli-info">
  3. <u-parse :html="content"></u-parse>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data(){
  9. return{
  10. id:'',
  11. content:''
  12. }
  13. },
  14. onLoad(option) {
  15. this.id = option.id
  16. this.getdata()
  17. },
  18. methods:{
  19. getdata(){
  20. this.$u.post("/api/welfare/welfare_detail",{
  21. id:this.id
  22. }).then(res => {
  23. const regex = new RegExp('<img', 'gi')
  24. this.content = res.data.content.replace(regex, `<img style="max-width: 100%; height: auto"`)
  25. })
  26. }
  27. }
  28. }
  29. </script>
  30. <style lang="scss">
  31. .fuli-info{
  32. padding: 24rpx;
  33. }
  34. </style>