遮罩
This commit is contained in:
@@ -10,23 +10,14 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { useEnv } from '@/composables/useEnv';
|
||||
|
||||
// 定义一个响应式变量,表示是否在微信环境
|
||||
const isWeChat = ref(false);
|
||||
|
||||
// 检查是否为微信环境
|
||||
const checkIfWeChat = () => {
|
||||
const userAgent = navigator.userAgent.toLowerCase();
|
||||
isWeChat.value = /micromessenger/.test(userAgent);
|
||||
};
|
||||
|
||||
// 在组件挂载后检查环境
|
||||
onMounted(() => {
|
||||
checkIfWeChat();
|
||||
});
|
||||
// 使用全局的微信环境检测,与 App.vue 保持一致ss
|
||||
const { isWeChat } = useEnv();
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<style scoped>
|
||||
/* 遮罩层样式 */
|
||||
.wechat-overlay {
|
||||
|
||||
Reference in New Issue
Block a user