2024-06-06 13:41:22 +08:00

26 lines
547 B
Vue

<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
const pcList = ['/', '/s']
const mobileList = ['/_m', '/_m/']
export default {
name: 'App',
components: {},
watch: {
$route: function(to) {
const path = to.path
if (pcList.includes(path) && !this.$pc) {
this.$router.push({ path: path + '_m', query: to.query })
}
if (mobileList.includes(path) && this.$pc) {
this.$router.push({ path: path.split('_m')[0], query: to.query })
}
},
},
}
</script>