1)新闻详情页后台给我的数据是加密之后的,我问了后台,是用encodeURIComponent()加密的,然后我就用对应的方法decodeURIComponent()解密:

this.$store.state.news.main =decodeURIComponent(data.FormattedBody);

 

2)  然后{{this.$store.state.news.main}}这样填数据,等我看页面的时候,页面上出现了一串字符串,然后我就想起了v-html,   

<div v-html="this.$store.state.news.main">
  {{this.$store.state.news.main}}
</div>

 

注意:v-html的引号里面的内容要和{{}}的内容是一样的,这样,页面就正常显示了

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2021-07-09
  • 2022-12-23
  • 2022-01-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-17
  • 2022-02-05
相关资源
相似解决方案