Giter Club home page Giter Club logo

mina-keyword-highlight's Introduction

mina-keyword-highlight

mina-keyword-highlight,一个方便、轻量的 小程序 关键词高亮组件
零依赖,小而精。

change log:

  1. 2021.01.26 init package

组件参数

  • text: String, 需要处理的字符串
  • keyword: String, 关键词
  • color: String, 高亮词颜色

demo 展示

  1. demo2:搜索结果关键词高亮 查看 demo 代码

  2. demo1:支持各类文字样式继承: 对齐,fontsize,fontweight,单行省略,多行省略,颜色等等 查看 demo 代码

使用方法

大致可以分为 4 步:

  1. npm 安装 mina-keyword-highlight,开发工具构建 npm
  2. json 引入 mina-keyword-highlight 组件
  3. wxml 使用组件

命令行

npm install mina-keyword-highlight
安装完成后,开发工具构建 npm

*.json

{
  "usingComponents": {
    "keyword-highlight": "mina-keyword-highlight"
  }
}

*.wxml

在 wxml 上利用 keyword-highlight 处理渲染逻辑

<keyword-highlight class="text" text="{{text}}" keyword="{{keyword}}" color="#FF4A56"> </keyword-highlight>

以上简单几步即可使用 mina-keyword-highlight

mina-keyword-highlight's People

Contributors

yrobot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.