vue-mark-html-text

0.1.13 • Public • Published

markhtmltext

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

examples


------------ main.js ----------------------------------------

import vuemarkhtmltext from 'vue-mark-html-text'

Vue.use(vuemarkhtmltext)


------------ components ----------------------------------------

<template>
    <div class="markBox">
        html或text关键字标红通用插件.......
        <span v-markHtmlText:[{htmlText,wrapChar,keyWord,color}]></span>
    </div>
</template>

<script>
    export default {
        name: 'MarkHtmlText',
        props: {
        },
        data() {
            return {
                wrapChar: "@@", // 文本中包裹关键字的标识字符
                htmlText: "html或text关键字标红通用插件<div>@@a@@bc<span>efagc</span>@@d@@cd</div>", // html文本或纯文本内容(必传)
                keyWord: [], // [] 数组,指定的关键字
                color: "blue",  // 标记的颜色 #ff4d4f / blue
            }
        },
        methods: {
        }
    }
</script>

Customize configuration

See Configuration Reference.

/vue-mark-html-text/

    Package Sidebar

    Install

    npm i vue-mark-html-text

    Weekly Downloads

    4

    Version

    0.1.13

    License

    ISC

    Unpacked Size

    13.4 kB

    Total Files

    11

    Last publish

    Collaborators

    • mancoding