mpvue 使用wxParse解析html
1.參考git:https://github.com/F-loat/mpvue-wxParse
2.安裝
npm i mpvue-wxparse
3.使用
<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>
?
卸載wxparse
npm uninstall?mpvue-wxparse
原文鏈接:https://blog.csdn.net/webZRH/article/details/81938523
總結
以上是生活随笔為你收集整理的mpvue 使用wxParse解析html的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: win7如何启用计算机的无线功能,win
- 下一篇: cmds在线重定义增加列