1.0.0-beta.4 • Published 2 years ago

menu-search-modal v1.0.0-beta.4

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

menu-search-modal

A popup modal component based on vue3 and antdv, that can search menu.

English | 中文

Examples

Table of contents

Installation

npm i -S menu-search-modal
# or
pnpm add -S menu-search-modal

Usage

import the component where you want to use it.

import MenuSearchModal from 'menu-search-modal'
import 'menu-search-modal/lib/MenuSearchModal/style.css'

if you are using typescript, you might also need to import the type.

import type { MenuSearchModalOption } from 'menu-search-modal'

Props

PropDescriptionTypeDefault
buttonTypeType of the button component, same as antdv'sprimary | ghost | dashed | link | text | defaultdefault
buttonSizeSize of th button component, same as antdv'slarge | middle | smallmiddle
buttonShapeShape of the button component, same as antdv'sdefault | circle | rounddefault
buttonContentThe text inside buttonstring⌘ + K in macOS, and Ctrl + K in windows or linux
modalVisible(v-model)The visibility of modalbooleanfalse
autofocusWhether auto focus on the input box while open the modalbooleantrue
optionsThe data that you want to deal with(search)MenuSearchModalOption | { label: string \| number, value: string \| number, disabled?: boolean, children?: MenuSearchModalOption[] }[][]

Events

EventDescriptionCallback
selectSelect the menu in result listfunction({ label, value, disabled })