Code Monkey home page Code Monkey logo

html-to-wxml's Introduction

官网博客地址:http://kevenfeng.com/wordpress/2016/11/10/htmltowxml.html images:所有图片 pages:所有页面 templates:所有模板文件 util:所有公共js文件

使用方法: 1.引用插件 var R_htmlToWxml = require('../../util/htmlToWxml.js');//引入公共方法 2.将html内容转成json数据 R_htmlToWxml.html2json("html内容"); 转换后的json格式类型大概如下:

3.吐到页面中显示 {{item.text}} {{item.text}} 通过判断不同节点类型,显示不同的小程序结构

由于小程序图片的高度没法自适应,需要给图片设置高度,所以需要在图片加载完以后,获取图片高度,等比算出显示图片高度,赋值给对应图片

通常我们抓取的内容是html页面,特别是像资讯这一类的,如果在小程序里面显示文章内容,此插件提供了一种解决方案,希望对大家有用。

在客户端中用native显示html页面体验上面没有native的好,htmlToWxml插件给客户端中用native的方式显示html内容提供了一种解决方案

html-to-wxml's People

Contributors

kevenfeng avatar

Watchers

rong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.