Giter VIP home page Giter VIP logo

zhilin-picker's Introduction

使用方法

1、在 script 中引用组件

	import zhilinPicker from "@/components/zhilin-picker/zhilin-picker.vue"
	//此插件已发布到npm,你也可以使用npm i zhilin-picker来安装到项目
	//uniapp官方插件市场https://ext.dcloud.net.cn/plugin?id=1469
	export default {
		components:{ zhilinPicker },
		data() {
			return {
				show: false,
				title: '选择福利',
				data: ['五险', '加班补助', '出国旅行', '生日福利', '年终分红', '带薪年假', '节日福利', '包吃', '包住', '聚餐经费', '交通补贴'],
			}
		},
		methods:{
			onChange(val){
				console.log(val)
			}
		}
	}

2、在 template 中使用组件

<zhilin-picker
    v-model="show"
    :data="data"
    @change="onChange"
/>

属性说明

属性名 类型 必填 默认值 说明
v-model Boolean 控制选择器弹出/隐藏
data Array/ObjectArray 格式:["五险","加班补助"]或者[{label:"五险",value:"11"}]
title String "请选择" 选择器的标题
initSelected Array 默认选中项
multiple Boolean true 是否开启多选模式
showSearch Boolean false 是否支持列表搜索,开启后默认对列表内进行模糊筛选,若要异步搜索需结合searchInput方法
searchInput Function 搜索的input事件回调,接收搜索框当前value,可用于对列表异步筛选

事件说明

事件名 说明 返回值
change 选中项发生改变时触发 接收当前选中项value,多选模式下为以英文逗号拼接的字符串
confirm 点击确定时触发 接收当前选中项value,多选模式下为以英文逗号拼接的字符串

zhilin-picker's People

Contributors

lucklin520 avatar

Stargazers

DodoRex avatar  avatar  avatar  avatar  avatar 周洋 avatar

Watchers

James Cloos avatar

Forkers

xiazehui alexch1

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.