更新记录
1.0.0(2023-11-22) 下载此版本
引用组件
import wxPrivacySetting from '@/components/wx-privacy-setting/wx-privacy-setting.vue';
注入组件
components: { wxPrivacySetting }
使用组件
<wx-privacy-setting :show="protocolPo" @privacySetting="initMethod">
自动触发打开隐私弹窗:
getPrivacySetting() {
if(wx.getPrivacySetting){
wx.getPrivacySetting({
success: res => {
if(res.needAuthorization) {
this.protocolPo = true;
uni.hideTabBar();
}else{
this.initMethod();
}
}
})
}else{
this.initMethod();
}
},
关闭隐私弹窗:
initMethod() {
this.protocolPo = false;
uni.showTabBar();
},
平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | √ | √ | √ | √ | - | - | - | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
√ | √ | √ | √ | √ | √ | - | √ | √ | √ | √ |
其他
多语言 | 暗黑模式 | 宽屏模式 |
---|---|---|
× | × | √ |
用户隐私弹窗
引用组件
import wxPrivacySetting from '@/components/wx-privacy-setting/wx-privacy-setting.vue';
注入组件
components: { wxPrivacySetting }
使用组件
<wx-privacy-setting :show="protocolPo" @privacySetting="initMethod">
自动触发打开隐私弹窗:
getPrivacySetting() {
if(wx.getPrivacySetting){
wx.getPrivacySetting({
success: res => {
if(res.needAuthorization) {
this.protocolPo = true;
uni.hideTabBar();
}else{
this.initMethod();
}
}
})
}else{
this.initMethod();
}
},
关闭隐私弹窗:
initMethod() {
this.protocolPo = false;
uni.showTabBar();
},