Skip to content

Commit

Permalink
style: 使用prettier格式化App.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
jamebal committed May 23, 2024
1 parent 7853408 commit 76f7bc1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion prettier.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
singleQuote: true,
semi: false,
trailingComma: 'es5',
trailingComma: 'es6',
tabWidth: 2,
printWidth: 80,
endOfLine: 'lf'
Expand Down
17 changes: 8 additions & 9 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@
</template>

<script>
const pcList = ['/','/s']
const mobileList = ['/_m','/_m/','/s_m','/s_m/']
const pcList = ['/', '/s']
const mobileList = ['/_m', '/_m/', '/s_m', '/s_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 (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})
if (mobileList.includes(path) && this.$pc) {
this.$router.push({ path: path.split('_m')[0], query: to.query })
}
}
}
},
},
}
</script>

0 comments on commit 76f7bc1

Please sign in to comment.