根据uniapp调整工程结构
This commit is contained in:
47
components/AiConsole.vue
Normal file
47
components/AiConsole.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<section class="AiConsole">
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "AiConsole",
|
||||
props: {
|
||||
show: Boolean
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
count: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleConsole() {
|
||||
if (this.count == 5) {
|
||||
this.$injectLib("https://cdn.cunwuyun.cn/vconsole.min.js", () => {
|
||||
new VConsole()
|
||||
this.count++
|
||||
})
|
||||
} else {
|
||||
this.count++
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.show) {
|
||||
this.count = 5
|
||||
this.handleConsole()
|
||||
} else {
|
||||
this.count = 0
|
||||
window.addEventListener('touchstart', evt => {
|
||||
if (evt.touches.length == 3) this.$u.debounce(this.handleConsole, 500)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AiConsole {
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user