diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..77f8df7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 paco + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100755 index 0000000..3b6c24d --- /dev/null +++ b/README.md @@ -0,0 +1,77 @@ +### 步骤 + +--- + +1. 把 `wxParser` 目录放到小程序项目的根目录下 +2. 在需要富文本解析的的 `WXML` 内引入 `wxParser/index.wxml` +3. 在页面 `JS` 文件内使用 `wxParser.parse(options)` 方法解析 `HTML` 内容 +4. 在小程序项目根目录的 `app.wxss` 内引入 `wxParser` 的默认样式库 + +--- + +**`wxParser.parse(options)` 方法的 `options` 参数说明** + +| 参数名 | 类型 | 必填 |描述 | +| :---: | :----: | :----: |:----: | +| bind | String | 是 | 要绑定的数据名称 | +| html | String | 是 | HTML 内容 | +| target | Object | 是 | 绑定数据的模块对象 | +| enablePreviewImage | Boolean | 否 | 是否启用富文本内的图片预览功能,默认是 | +| tapLink | Function | 否 | 点击超链接时的回调函数 | + +### 示例 + +--- + +**WXML** + +``` + + +