Package Exports
- vue-text-filters
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-text-filters) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
getting started
vue-text-filters 以Vue(1.0)插件的形式提供一系列处理html文本的filter
安装
npm install --save vue-text-filters使用
import VueTextFilters from 'vue-text-filters'
Vue.use(VueTextFilters)
// 解析段落
{{{ text | emojiSoftbankToUnified | safeAllEntityEncode | sbEmotions | transLinebreak }}}如果需要使用emojiUnifiedToHtml,需要单独引入css样式
import 'emoji/lib/emoji.css'features
目前支持 'emoji', 'sbEmotions', 'htmlEntity', 'linebreak'
emoji https://www.npmjs.com/package/emoji
sbEmotions 是指square-bracket,类似[微笑] https://www.npmjs.com/package/wechat-square-bracket-emotions
htmlEntity 是指htmlEntity编解码
linebreak 是指将文本换行转换为html支持的
params
options
needs一个Array,包含需要的filter(见features)名称