search
HomeWeChat AppletMini Program DevelopmentAnalysis of pages compatible with h5 tags in mini programs

The content of this article is about the analysis of page compatibility with h5 tags in mini programs. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

Sometimes when the mini program retrieves data from the background, it is an article with html tags. When you put it into the mini program, you will find that many tags are incompatible. It is very troublesome to change them one by one. Is there any way? Can it be quickly compatible with html tags?
There is a tool that can do it: wxParse
Analysis of pages compatible with h5 tags in mini programs
Download the compressed package and unzip it, copy the wxParse folder and put it in the mini program pages page:
Analysis of pages compatible with h5 tags in mini programs
Introduced in wxml, the path here is for reference only:

<import src="../../../../wxParse/wxParse.wxml" />//在需要放置html文本的地方使用wxParse组件 <view class=&#39;article_bd&#39;>
    <template is="wxParse" data="{{wxParseData:content.nodes}}" />
  </view>

Introduced in js:

let wxparse = require("../../../../wxParse/wxParse.js");
Page({  /**
   * 页面的初始数据
   */
  data: {
      content: &#39;&#39;
  },
   onLoad: function(options) {     var that = this;
     .....     //在后台拿到content数据后, result.data.content就是拿到的数据
      wxparse.wxParse(&#39;content&#39;, &#39;html&#39;, result.data.content, that);
   }

Introduced in wxss:

@import "../../../../wxParse/wxParse.wxss";

Related recommendations:

Code analysis of app.json configuration in WeChat mini program

Page layout, absolute positioning and button code in mini program

The above is the detailed content of Analysis of pages compatible with h5 tags in mini programs. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.