中国优质的IT技术网站
专业IT技术创作平台
IT职业在线教育平台
如何跳转选择联系人页面?
微信扫码分享
import { BusinessError } from '@kit.BasicServicesKit'; import { contact } from '@kit.ContactsKit'; @Entry @Component struct Index { build() { Column() { Button("选择联系人").onClick(() => { let promise = contact.selectContacts(); promise.then((data) => { console.info(`Succeeded in selecting Contacts. data->${JSON.stringify(data)}`); }).catch((err: BusinessError) => { console.error(`Failed to select Contacts. Code: ${err.code}, message: ${err.message}`); }); }) } .height("100%") .width('100%') .justifyContent(FlexAlign.Center) } }