Giter Club home page Giter Club logo

j-contacts's Introduction

通讯录插件

获取手机通讯录,拼音排序,首字母索引,分解同一联系人的多个号码,支持单选多选

使用

<template>
	<view class="content">
		<jContacts ref="jContacts" :mode="mode" :hashFirst="hashFirst" @confirm="contactsConfirm" @cancel="contactsCancel"></jContacts>
		
		<button type="default" @tap="show('single')">单选模式</button>
		<button type="default" @tap="show('multi')">多选模式</button>
		<button type="default" @tap="chooseList = []">清除</button>
		
		<view class="res" v-for="(value, index) in chooseList" :key="index">
			{{value.name}}&nbsp;&nbsp;{{value.phone}}
		</view>
		
	</view>
</template>

<script>
	import jContacts from "@/components/j-contacts/j-contacts.vue"
	
	export default {
		components: {
			jContacts,
		},
		data() {
			return {
				showMask: false,
				mode: "single",
				hashFirst: false,
				chooseList: [],
			}
		},
		methods: {
			
			show(mode) {
				this.showMask = true
				this.mode = mode
				this.$refs.jContacts.show()
			},
			contactsConfirm(res) {
				this.chooseList = res
				console.log("返回结果:", JSON.stringify(this.chooseList))
			},
			contactsCancel(){
				
			},

		},
	}
</script>

j-contacts's People

Contributors

linnjie avatar

Watchers

 avatar

j-contacts's Issues

平台兼容性?

你好,请问你这个组件,支持哪些平台呢?H5,小程序,Chrome等?

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.