Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhuping/megalo-rich-text
基于 rich-text 的跨平台富文本渲染,支持 微信/百度/支付宝/头条 小程序
https://github.com/zhuping/megalo-rich-text
Last synced: about 1 month ago
JSON representation
基于 rich-text 的跨平台富文本渲染,支持 微信/百度/支付宝/头条 小程序
- Host: GitHub
- URL: https://github.com/zhuping/megalo-rich-text
- Owner: zhuping
- License: mit
- Created: 2019-04-28T07:38:14.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-04-30T07:30:20.000Z (over 5 years ago)
- Last Synced: 2024-10-30T09:35:56.335Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# megalo-rich-text
基于 rich-text 的跨平台富文本解析,支持 微信/百度/支付宝/头条 小程序
## 如何使用
```js
// ./build/createBaseConfig.jstarget: createMegaloTarget( {
compiler: Object.assign( compiler, { } ),
platform,
htmlParse: {
templateName: 'rich-text',
src: _.resolve(`./node_modules/megalo-rich-text/dist/platform/${platform}`)
}
} ),
```````js
// ./src/index.jsimport Vue from 'vue';
import VHtmlPlugin from 'megalo-rich-text';Vue.use(VHtmlPlugin);
```
```html
// ./pages/index/index.vue
export default {
data() {
return {
html: `
<img src="https://pop.nosdn.127.net/e2170dcf-efd0-4906-9da9-3a9900e52b39"/><br/>
<img src="https://pop.nosdn.127.net/929408c3-7a72-44d2-9b11-8d5c6ea98dbb"/><br/>
<span>
<span>test</span><br/><span>test2</span>
</span>
`,
}
},
created() {
},
}```