更新记录
1.0.8(2025-06-04) 下载此版本
增加支持vue3版本功能
1.0.7(2025-05-27) 下载此版本
修复已知问题
1.0.6(2025-05-27) 下载此版本
修复vivo、oppo、荣耀等手机相册权限判断不准确问题; 修复ios麦克风权限;
查看更多平台兼容性
uni-app(4.25)
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | √ | √ | √ | √ | √ | √ | √ | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
- | - | - | - | - | - | - | - | - | - | - |
uni-app x(4.25)
Chrome | Safari | Android | iOS | 鸿蒙 | 微信小程序 |
---|---|---|---|---|---|
- | - | - | - | - | - |
使用方法
<yk-authpup ref="authpup" type="top" @changeAuth="changeAuth" permissionID="WRITE_EXTERNAL_STORAGE"></yk-authpup>
import ykAuthpup from "@/components/yk-authpup/yk-authpup";
// #ifdef VUE3
import { ref } from 'vue'
// #endif
export default {
components: {
ykAuthpup
},
// #ifdef VUE3
setup() {
const permissionID = ref('');
const authpup = ref(null);
//打开自定义权限目的弹框
const openAuth = (permission) => {
permissionID.value = permission // 这个是对应的权限 ACCESS_FINE_LOCATION 位置权限 / WRITE_EXTERNAL_STORAGE 存储空间/照片权限 / CAMERA相机权限 / CALL_PHONE 拨打电话
setTimeout(() => {
authpup.value?.open()
}, 500)
}
//用户授权权限后的回调
const changeAuth = () => {
// 这里是权限通过后执行自己的代码逻辑
console.log('权限已授权,此时可以调用uni的chooseImage等api了')
}
return {
permissionID,
authpup,
openAuth,
changeAuth
}
}
// #endif
// #ifndef VUE3
data() {
return {
permissionID:''
}
},
methods: {
//打开自定义权限目的弹框
openAuth(permissionID){
this.permissionID = permissionID;//这个是对应的权限 ACCESS_FINE_LOCATION 位置权限 / WRITE_EXTERNAL_STORAGE 存储空间/照片权限 / CAMERA相机权限 / CALL_PHONE 拨打电话
setTimeout(()=>{
this.$refs['authpup'].open();
},500)
},
//用户授权权限后的回调
changeAuth(){
//这里是权限通过后执行自己的代码逻辑
console.log('权限已授权,此时可以调用uni的chooseImage等api了');
}
}
// #endif