From ee1cc5bc69d4838ed83bdc4bd9da703f2e1dc5bd Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Thu, 18 Nov 2021 14:34:18 +0800 Subject: [PATCH] refactor: use multi-word component names so that it won't encounter lint errors when using eslint-plugin-vue's recommended ruleset. --- template/code/default/src/App.vue | 4 ++-- .../src/components/{Welcome.vue => TheWelcome.vue} | 0 .../src/components/{Welcome.vue => TheWelcome.vue} | 0 template/code/router/src/router/index.js | 10 +++++----- .../code/router/src/views/{About.vue => AboutView.vue} | 0 .../code/router/src/views/{Home.vue => HomeView.vue} | 4 ++-- template/code/typescript-default/src/App.vue | 4 ++-- .../src/components/{Welcome.vue => TheWelcome.vue} | 0 .../src/components/{Welcome.vue => TheWelcome.vue} | 0 template/code/typescript-router/src/router/index.ts | 10 +++++----- .../src/views/{About.vue => AboutView.vue} | 0 .../src/views/{Home.vue => HomeView.vue} | 4 ++-- 12 files changed, 18 insertions(+), 18 deletions(-) rename template/code/default/src/components/{Welcome.vue => TheWelcome.vue} (100%) rename template/code/router/src/components/{Welcome.vue => TheWelcome.vue} (100%) rename template/code/router/src/views/{About.vue => AboutView.vue} (100%) rename template/code/router/src/views/{Home.vue => HomeView.vue} (52%) rename template/code/typescript-default/src/components/{Welcome.vue => TheWelcome.vue} (100%) rename template/code/typescript-router/src/components/{Welcome.vue => TheWelcome.vue} (100%) rename template/code/typescript-router/src/views/{About.vue => AboutView.vue} (100%) rename template/code/typescript-router/src/views/{Home.vue => HomeView.vue} (52%) diff --git a/template/code/default/src/App.vue b/template/code/default/src/App.vue index 945ae423..b0b6901b 100644 --- a/template/code/default/src/App.vue +++ b/template/code/default/src/App.vue @@ -1,6 +1,6 @@ diff --git a/template/code/default/src/components/Welcome.vue b/template/code/default/src/components/TheWelcome.vue similarity index 100% rename from template/code/default/src/components/Welcome.vue rename to template/code/default/src/components/TheWelcome.vue diff --git a/template/code/router/src/components/Welcome.vue b/template/code/router/src/components/TheWelcome.vue similarity index 100% rename from template/code/router/src/components/Welcome.vue rename to template/code/router/src/components/TheWelcome.vue diff --git a/template/code/router/src/router/index.js b/template/code/router/src/router/index.js index e0434fd0..a49ae507 100644 --- a/template/code/router/src/router/index.js +++ b/template/code/router/src/router/index.js @@ -1,21 +1,21 @@ import { createRouter, createWebHistory } from 'vue-router' -import Home from '../views/Home.vue' +import HomeView from '../views/HomeView.vue' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [ { path: '/', - name: 'Home', - component: Home + name: 'home', + component: HomeView }, { path: '/about', - name: 'About', + name: 'about', // route level code-splitting // this generates a separate chunk (About.[hash].js) for this route // which is lazy-loaded when the route is visited. - component: () => import('../views/About.vue') + component: () => import('../views/AboutView.vue') } ] }) diff --git a/template/code/router/src/views/About.vue b/template/code/router/src/views/AboutView.vue similarity index 100% rename from template/code/router/src/views/About.vue rename to template/code/router/src/views/AboutView.vue diff --git a/template/code/router/src/views/Home.vue b/template/code/router/src/views/HomeView.vue similarity index 52% rename from template/code/router/src/views/Home.vue rename to template/code/router/src/views/HomeView.vue index ba9b6dc3..6555a646 100644 --- a/template/code/router/src/views/Home.vue +++ b/template/code/router/src/views/HomeView.vue @@ -1,9 +1,9 @@ diff --git a/template/code/typescript-default/src/App.vue b/template/code/typescript-default/src/App.vue index adcd6fe7..d91eefc4 100644 --- a/template/code/typescript-default/src/App.vue +++ b/template/code/typescript-default/src/App.vue @@ -1,6 +1,6 @@ diff --git a/template/code/typescript-default/src/components/Welcome.vue b/template/code/typescript-default/src/components/TheWelcome.vue similarity index 100% rename from template/code/typescript-default/src/components/Welcome.vue rename to template/code/typescript-default/src/components/TheWelcome.vue diff --git a/template/code/typescript-router/src/components/Welcome.vue b/template/code/typescript-router/src/components/TheWelcome.vue similarity index 100% rename from template/code/typescript-router/src/components/Welcome.vue rename to template/code/typescript-router/src/components/TheWelcome.vue diff --git a/template/code/typescript-router/src/router/index.ts b/template/code/typescript-router/src/router/index.ts index e0434fd0..a49ae507 100644 --- a/template/code/typescript-router/src/router/index.ts +++ b/template/code/typescript-router/src/router/index.ts @@ -1,21 +1,21 @@ import { createRouter, createWebHistory } from 'vue-router' -import Home from '../views/Home.vue' +import HomeView from '../views/HomeView.vue' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [ { path: '/', - name: 'Home', - component: Home + name: 'home', + component: HomeView }, { path: '/about', - name: 'About', + name: 'about', // route level code-splitting // this generates a separate chunk (About.[hash].js) for this route // which is lazy-loaded when the route is visited. - component: () => import('../views/About.vue') + component: () => import('../views/AboutView.vue') } ] }) diff --git a/template/code/typescript-router/src/views/About.vue b/template/code/typescript-router/src/views/AboutView.vue similarity index 100% rename from template/code/typescript-router/src/views/About.vue rename to template/code/typescript-router/src/views/AboutView.vue diff --git a/template/code/typescript-router/src/views/Home.vue b/template/code/typescript-router/src/views/HomeView.vue similarity index 52% rename from template/code/typescript-router/src/views/Home.vue rename to template/code/typescript-router/src/views/HomeView.vue index ba9b6dc3..6555a646 100644 --- a/template/code/typescript-router/src/views/Home.vue +++ b/template/code/typescript-router/src/views/HomeView.vue @@ -1,9 +1,9 @@ -- 2.39.5