feat: hide wwads for non-zh user

This commit is contained in:
naiba 2024-07-05 20:12:42 +08:00
parent 1956217fe7
commit aebd224338
2 changed files with 14 additions and 2 deletions

View File

@ -9,7 +9,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.show = navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i) this.show = navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i) && navigator.language.indexOf('zh') > -1
} }
} }
</script> </script>

View File

@ -1,3 +1,15 @@
<template> <template>
<div class="wwads-cn wwads-vertical" data-id="296" style="margin-bottom: 20px;"></div> <div v-if="show" class="wwads-cn wwads-vertical" data-id="296" style="margin-bottom: 20px;"></div>
</template> </template>
<script>
export default {
data() {
return {
show: false
}
},
mounted() {
this.show = navigator.language.indexOf('zh') > -1
}
}
</script>