style: 使用prettier格式化App.vue
This commit is contained in:
parent
7853408cc2
commit
76f7bc1bea
@ -1,7 +1,7 @@
|
||||
module.exports = {
|
||||
singleQuote: true,
|
||||
semi: false,
|
||||
trailingComma: 'es5',
|
||||
trailingComma: 'es6',
|
||||
tabWidth: 2,
|
||||
printWidth: 80,
|
||||
endOfLine: 'lf'
|
||||
|
||||
17
src/App.vue
17
src/App.vue
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user