All Projects → icindy → Wxparse

icindy / Wxparse

Licence: mit
wxParse-微信小程序富文本解析自定义组件,支持HTML及markdown解析

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Wxparse

Wemark
微信小程序Markdown渲染库
Stars: ✭ 1,159 (-84.79%)
Mutual labels:  markdown, weixin, weapp
wxbizdatacrypt
微信小程序加密数据解密算法Go版
Stars: ✭ 132 (-98.27%)
Mutual labels:  weixin, weapp
xing-weapp-editor
开箱即用的微信小程序图文编辑组件
Stars: ✭ 101 (-98.67%)
Mutual labels:  weixin, weapp
Wuss Weapp
🐳wuss-weapp 一款高质量,组件齐全,高自定义的微信小程序UI组件库
Stars: ✭ 338 (-95.56%)
Mutual labels:  weixin, weapp
Weapp Workflow
基于Gulp 的微信小程序前端开发工作流 💯
Stars: ✭ 241 (-96.84%)
Mutual labels:  weixin, weapp
taro-icons
基于 Taro 的小程序图标库
Stars: ✭ 53 (-99.3%)
Mutual labels:  weixin, weapp
Weapp Douban Film
微信小程序-豆瓣电影
Stars: ✭ 303 (-96.02%)
Mutual labels:  weixin, weapp
Wxapp Webpack Plugin
📦 微信小程序 webpack 插件
Stars: ✭ 185 (-97.57%)
Mutual labels:  weixin, weapp
Wux Weapp
🐶 一套组件化、可复用、易扩展的微信小程序 UI 组件库
Stars: ✭ 4,706 (-38.23%)
Mutual labels:  weixin, weapp
Zanui Weapp
本仓库已不再维护,请移步 https://github.com/youzan/vant-weapp
Stars: ✭ 540 (-92.91%)
Mutual labels:  weixin, weapp
Iview Weapp
一套高质量的微信小程序 UI 组件库
Stars: ✭ 6,145 (-19.34%)
Mutual labels:  weixin, weapp
Vant Weapp
轻量、可靠的小程序 UI 组件库
Stars: ✭ 15,428 (+102.52%)
Mutual labels:  weixin, weapp
Wxa Plugin Canvas
小程序海报组件-生成朋友圈分享海报并生成图片
Stars: ✭ 2,692 (-64.66%)
Mutual labels:  weixin, weapp
Chronus
🕐 一款能帮助管理生活目标的微信小程序
Stars: ✭ 195 (-97.44%)
Mutual labels:  weixin, weapp
Weapp Bmscore
a weapp to count badminton game score
Stars: ✭ 17 (-99.78%)
Mutual labels:  weixin, weapp
Weapp Demo Breadtrip
基于面包旅行 API 制作的微信小程序示例
Stars: ✭ 282 (-96.3%)
Mutual labels:  weixin, weapp
Wechat Weapp Movie
🎬电影推荐 - 微信小程序
Stars: ✭ 1,355 (-82.21%)
Mutual labels:  weixin, weapp
Leshare Shop Weapp
基于微信小程序的电商平台,采用原生框架开发
Stars: ✭ 183 (-97.6%)
Mutual labels:  weixin, weapp
Minui
基于规范的小程序 UI 组件库,自定义标签组件,简洁、易用、工具化
Stars: ✭ 3,512 (-53.9%)
Mutual labels:  weixin, weapp
Min Cli
Min 小程序组件化解决方案
Stars: ✭ 807 (-89.41%)
Mutual labels:  weixin, weapp

抱歉各位,本项目已经停止维护,为了不给您使用造成问题,请仅做参考使用,感谢各位支持

wxParse-微信小程序富文本解析组件

支持Html及markdown转wxml可视化

版本号:0.3

来源: [微信小程序开发论坛-weappdev](https://weappdev.com)

作用: 将Html/Markdown转换为微信小程序的可视化方案

特性

支持特性 实验功能 ToDo
- [x] HTML的大部分标签解析 [x] 小表情emjio [x] table标签
- [x] 内联style [x] a标签跳转
- [x] 标签Class [x] 动态添加
- [x] 图片自适应规则
- [x] 图片多图片预览
- [x] 模版层级可扩展性
- [x] 多数据循环方式
- [x] 内联style

相关截图

相关截图

感谢

@stonewen| @Daissmentii | @wuyanwen | @vcxiaohan |

基本使用方法

    1. Copy文件夹wxParse
- wxParse/
  -wxParse.js(必须存在)
  -html2json.js(必须存在)
  -htmlparser.js(必须存在)
  -showdown.js(必须存在)
  -wxDiscode.js(必须存在)
  -wxParse.wxml(必须存在)
  -wxParse.wxss(必须存在)
  -emojis(可选)
    1. 引入必要文件
//在使用的View中引入WxParse模块
var WxParse = require('../../wxParse/wxParse.js');
//在使用的Wxss中引入WxParse.css,可以在app.wxss
@import "/wxParse/wxParse.wxss";
    1. 数据绑定
var article = '<div>我是HTML代码</div>';
/**
* WxParse.wxParse(bindName , type, data, target,imagePadding)
* 1.bindName绑定的数据名(必填)
* 2.type可以为html或者md(必填)
* 3.data为传入的具体数据(必填)
* 4.target为Page对象,一般为this(必填)
* 5.imagePadding为当图片自适应是左右的单一padding(默认为0,可选)
*/
var that = this;
WxParse.wxParse('article', 'html', article, that, 5);
    1. 模版引用
// 引入模板
<import src="你的路径/wxParse/wxParse.wxml"/>
//这里data中article为bindName
<template is="wxParse" data="{{wxParseData:article.nodes}}"/>

高级用法

  • 配置小表情emojis
/**
* WxParse.emojisInit(reg,baseSrc,emojis)
* 1.reg,如格式为[00]=>赋值 reg='[]'
* 2.baseSrc,为存储emojis的图片文件夹
* 3.emojis,定义表情键值对
*/
WxParse.emojisInit('[]', "/wxParse/emojis/", {
      "00": "00.gif",
      "01": "01.gif",
      "02": "02.gif",
      "03": "03.gif",
      "04": "04.gif",
      "05": "05.gif",
      "06": "06.gif",
      "07": "07.gif",
      "08": "08.gif",
      "09": "09.gif",
      "09": "09.gif",
      "10": "10.gif",
      "11": "11.gif",
      "12": "12.gif",
      "13": "13.gif",
      "14": "14.gif",
      "15": "15.gif",
      "16": "16.gif",
      "17": "17.gif",
      "18": "18.gif",
      "19": "19.gif",
    });
  • 多数据格式

FAQ

二次开发

  • 基础数据格式
parsedata:{
    view:{},//样式存储
    nodes:{},//展示需要的存储节点
    images:[],//存放图片对象数组
    imageUrls:[],//存放图片url数组
}

相关文章

捐献

来源

微信小程序开发论坛 垂直微信小程序开发交流社区

可在网站扫描二维码进入我们的微信小程序群,也可以微信搜索"weappmsg"进入"小码消息"公众号 小码消息-weappmsg 其他方式:合作qq群511389428

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].