mpvue v-html 代替方法 使用 mpvue-wxparse
生活随笔
收集整理的這篇文章主要介紹了
mpvue v-html 代替方法 使用 mpvue-wxparse
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在vue項目中有時候會使用到v-html,而在mpvue中,也有代替品mpvue-wxparse。
1、安裝mpvue-wxparse
2、使用,詳情可見官網 https://github.com/F-loat/mpvue-wxParse
<template><div><wxParse :content="article" @preview="preview" @navigate="navigate" /></div> </template> <script> import wxParse from 'mpvue-wxparse' export default {components: {wxParse},data () {return {article: '<div>我是HTML代碼</div>'}},methods: {preview(src, e) {// do something},navigate(href, e) {// do something}} } </script> <style> @import url("~mpvue-wxparse/src/wxParse.css"); </style>總結
以上是生活随笔為你收集整理的mpvue v-html 代替方法 使用 mpvue-wxparse的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: nginx实现301(加密)跳转和200
- 下一篇: vue jsx 使用 自定义组件