1.0.0 • Published 5 years ago

dj-test-huan v1.0.0

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

dj-input-search

组件使用

安装

npm i dj-input-search -S

引入

import inputSearch from 'dj-input-search';

使用 一般配合弹层使用

<template>
  <div>
    ...
    <van-popup
      v-model="schoolShow"
      position="right"
      class="school-pop"
      overlay-class="overlay-cls"
    >
      <input-search
        v-model="str"
        placeholder="请输入搜索内容"
        :fetch-suggestions="queryFn"
        :addBtn="addBtn"
        @select="select"
        value-key="value"
        @cancel="cancel"
      ></input-search>
    </van-popup>
    ...
  </div>
</template>

... components: { inputSearch } ...

组件参数 Attributes

参数说明类型默认值
value输入框绑定的值StringNumber--
placeholder输入框的 placeholderString请输入您要搜索的内容
add-btn是否需要添加选项按钮Booleantrue
value-key选项对象中,文字对应的 keyStringvalue
fetch-suggestions返回输入建议的方法,仅当你的输入建议数据 resolve 时,通过调用 callback(data:[]) 来返回它Function(queryString, callback)--

组件 Methods

方法名说明参数
select选中列表以及添加选项按钮选中的值
cancel点击取消按钮时触发--

维护者

zhuhuanhuan

zhuhuanhuan@daojia-inc.com

1.0.0

5 years ago