1.0.5 • Published 2 years ago

@qjorg/hint-keywords v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

hint-keywords

Installation

npm i --save @qjorg/hint-keywords

Usage

import hintKeywords from '@qjorg/hint-keywords'

Example

const options = [
  {
    label: '脑部ct',
    value: 1
  },
  {
    label: '脑部CT平扫',
    value: 2
  },
  {
    label: '胸部cT',
    value: 3
  },
] as any[]
const list = hintKeywords(options, 'ct')
// console.log(list)
const r = [
  {
    label: '脑部ct',
    value: 1,
    customLabel: '脑部<span style=\'color: red;\'>ct</span>'
  },
  {
    label: '脑部CT平扫',
    value: 2,
    customLabel: '脑部<span style=\'color: red;\'>CT</span>平扫'
  },
  {
    label: '胸部cT',
    value: 3,
    customLabel: '胸部<span style=\'color: red;\'>cT</span>'
  }
] as any[]

params

list: any[]
keywords?: any
config: {
    targetLabel: string // default: label
    customLabel: string // customLabel: customLabel
    color: string // red
}
1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago