Commit 95f5d67e authored by lipengcheng 's avatar lipengcheng

一些优化

parent eae03e33
...@@ -9,9 +9,9 @@ module.exports = { ...@@ -9,9 +9,9 @@ module.exports = {
// extends: ['plugin:vue/essential', '@vue/airbnb',], // extends: ['plugin:vue/essential', '@vue/airbnb',],
// 3: ESLint + Standard config // 3: ESLint + Standard config
// extends: [ 'plugin:vue/essential', '@vue/airbnb',], // extends: [ 'plugin:vue/essential', '@vue/airbnb',],
// ESLint + Prettier // 4. ESLint + Prettier
// extends: ['plugin:vue/recommended', 'eslint:recommended'], // extends: ['plugin:vue/recommended', 'eslint:recommended', '@vue/prettier'],
extends: ['plugin:vue/recommended', 'eslint:recommended', '@vue/prettier'], extends: ['plugin:vue/recommended', 'eslint:recommended'],
plugins: [], plugins: [],
parserOptions: { parserOptions: {
parser: 'babel-eslint' parser: 'babel-eslint'
......
module.exports = { module.exports = {
// 换行长度 // 换行长度
printWidth: 80, printWidth: 150,
// tab缩进大小,默认为2 // tab缩进大小,默认为2
tabWidth: 4, tabWidth: 4,
// 使用tab缩进,默认false // 使用tab缩进,默认false
......
...@@ -19,9 +19,7 @@ export default { ...@@ -19,9 +19,7 @@ export default {
}, },
methods: { methods: {
async request() { async request() {
let result = await this.$http.get( let result = await this.$http.get('/webapi/home/banner?type=1&category=18')
'/webapi/home/banner?type=1&category=18'
)
console.log('result:', result) console.log('result:', result)
} }
} }
......
...@@ -5,10 +5,7 @@ import { register } from 'register-service-worker' ...@@ -5,10 +5,7 @@ import { register } from 'register-service-worker'
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
register(`${process.env.BASE_URL}service-worker.js`, { register(`${process.env.BASE_URL}service-worker.js`, {
ready() { ready() {
console.log( console.log('App is being served from cache by a service worker.\n' + 'For more details, visit https://goo.gl/AFskqB')
'App is being served from cache by a service worker.\n' +
'For more details, visit https://goo.gl/AFskqB'
)
}, },
registered() { registered() {
console.log('Service worker has been registered.') console.log('Service worker has been registered.')
...@@ -23,9 +20,7 @@ if (process.env.NODE_ENV === 'production') { ...@@ -23,9 +20,7 @@ if (process.env.NODE_ENV === 'production') {
console.log('New content is available; please refresh.') console.log('New content is available; please refresh.')
}, },
offline() { offline() {
console.log( console.log('No internet connection found. App is running in offline mode.')
'No internet connection found. App is running in offline mode.'
)
}, },
error(error) { error(error) {
console.error('Error during service worker registration:', error) console.error('Error during service worker registration:', error)
......
...@@ -12,14 +12,12 @@ const routes = [ ...@@ -12,14 +12,12 @@ const routes = [
layout: 'DefaultLayout', layout: 'DefaultLayout',
title: '首页' title: '首页'
}, },
component: () => component: () => import(/* webpackChunkName: "about" */ '../views/home.vue')
import(/* webpackChunkName: "about" */ '../views/home.vue')
}, },
{ {
path: '/page1', path: '/page1',
name: 'Page1', name: 'Page1',
component: () => component: () => import(/* webpackChunkName: "about" */ '../views/page1.vue')
import(/* webpackChunkName: "about" */ '../views/page1.vue')
}, },
{ {
path: '/page2', path: '/page2',
...@@ -31,8 +29,7 @@ const routes = [ ...@@ -31,8 +29,7 @@ const routes = [
// route level code-splitting // route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route // this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited. // which is lazy-loaded when the route is visited.
component: () => component: () => import(/* webpackChunkName: "about" */ '../views/page2.vue')
import(/* webpackChunkName: "about" */ '../views/page2.vue')
} }
] ]
......
...@@ -22,10 +22,7 @@ ...@@ -22,10 +22,7 @@
<script> <script>
export default { export default {
components: { components: {
ffasfasdfsfa: () => ffasfasdfsfa: () => import('@.../dfsfsfsfds/fsdfdsfsdf/sdfsdfsdf/sdfsdfdsf/sdfsdfsdf/sdf.vue')
import(
'@.../dfsfsfsfds/fsdfdsfsdf/sdfsdfsdf/sdfsdfdsf/sdfsdfsdf/sdf.vue'
)
}, },
data() { data() {
return {} return {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment