html-str-replace
v3.0.2
Published
replace string for html
Downloads
6
Readme
HtmlStrRep for html string repalce with keywords
HtmlStrRep install
npm install html-str-replace --save
HtmlStrRep for ES6
// 使用
<template>
<div class="home">
<h3>Html rep Test</h3>
<h4 v-html="keyName(tHtml, tkey, '#407CFE')"></h4>
</div>
</template>
import HtmlStrRep from 'html-str-replace'
export default {
name: 'home',
data () {
return {
tHtml: '<div>this is hansin; this is Hansin; this is hanSin <span class="hansin">hansintest</span></div>',
tkey: 'hansin'
}
},
methods: {
keyName (html, keywords) {
const strRep = new HtmlStrRep()
return strRep.startRep(html, keywords, '#407CFE')
}
}
}
update:
npm login
// 用户名:hansin
// 密码:****
// 邮箱:[email protected]
npm version patch
npm publish