组件在mounted生命周期触发判断是否需要弹出,组件内容如有需求可自行修改。

使用方法:

1、在 manifest.json 源码视图文件中 找到并添加以下内容

"mp-weixin" : {
      ........  
    "__usePrivacyCheck__" : true
},

2、将压缩包文件放至自己程序代码目录下,例如 :/项目根目录/components/ 下

如果使用位置较多,可以使用全局注册
// 在main.js 中 添加如下代码
import PrivacyPopup from '@/components/privacyPopup/index.vue';
Vue.component('PrivacyPopup',PrivacyPopup);
Copy
注意:注册全局组件必须要引入Vue之后。

// 在需要使用的文件中添加以下代码
<template>
    <view>
        <!-- #ifdef MP-WEIXIN -->
        <!-- 显示在底部 -->
        <!-- <privacy-popup ref="privacyComponent" position="bottom" ></privacy-popup> -->
        <!-- 显示在中间 -->
        <privacy-popup ref="privacyComponent"></privacy-popup>
        <!-- #endif -->
    </view>
</template>

如果是少数文件使用,直接在需要添加的文件中引入使用

<script>
import PrivacyPopup from '@/components/privacyPopup/index.vue';
export default {
    components: {

        PrivacyPopup
    },
}
</script>

附件.zip