Home WeChat Applet Mini Program Development Analysis of pages compatible with h5 tags in mini programs

Analysis of pages compatible with h5 tags in mini programs

Aug 10, 2018 pm 04:49 PM

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>
Copy after login

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);
   }
Copy after login

Introduced in wxss:

@import "../../../../wxParse/wxParse.wxss";
Copy after login

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 of this Website
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

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1266
29
C# Tutorial
1239
24