From 85081134f098f0df807d1bfef27bab29f4bb3554 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Wed, 30 Nov 2022 08:10:46 +0800 Subject: [PATCH] fix: use two words component --- README.md | 1 + components.d.ts | 6 +++--- src/App.vue | 2 +- src/components/{Counter.vue => TheCounter.vue} | 0 src/components/{Footer.vue => TheFooter.vue} | 0 src/components/{Input.vue => TheInput.vue} | 0 src/pages/index.vue | 2 +- test/component.test.ts | 8 ++++---- 8 files changed, 10 insertions(+), 9 deletions(-) rename src/components/{Counter.vue => TheCounter.vue} (100%) rename src/components/{Footer.vue => TheFooter.vue} (100%) rename src/components/{Input.vue => TheInput.vue} (100%) diff --git a/README.md b/README.md index 316fbb8..0bbdc55 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ See [Vitesse](https://github.com/antfu/vitesse) for full featureset. - [`vite-plugin-pages`](https://github.com/hannoeru/vite-plugin-pages) - file system based routing - [`unplugin-auto-import`](https://github.com/antfu/unplugin-auto-import) - Directly use Vue Composition API and others without importing - [`unplugin-vue-components`](https://github.com/antfu/unplugin-vue-components) - components auto import +- [`unplugin-vue-macros`](https://github.com/sxzz/unplugin-vue-macros) - Explore and extend more macros and syntax sugar to Vue. - [VueUse](https://github.com/antfu/vueuse) - collection of useful composition APIs ## Try it now! diff --git a/components.d.ts b/components.d.ts index 17ed50b..091bbfb 100644 --- a/components.d.ts +++ b/components.d.ts @@ -7,10 +7,10 @@ export {} declare module '@vue/runtime-core' { export interface GlobalComponents { - Counter: typeof import('./src/components/Counter.vue')['default'] - Footer: typeof import('./src/components/Footer.vue')['default'] - Input: typeof import('./src/components/Input.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + TheCounter: typeof import('./src/components/TheCounter.vue')['default'] + TheFooter: typeof import('./src/components/TheFooter.vue')['default'] + TheInput: typeof import('./src/components/TheInput.vue')['default'] } } diff --git a/src/App.vue b/src/App.vue index 001c20e..c1caf1f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,6 @@ diff --git a/src/components/Counter.vue b/src/components/TheCounter.vue similarity index 100% rename from src/components/Counter.vue rename to src/components/TheCounter.vue diff --git a/src/components/Footer.vue b/src/components/TheFooter.vue similarity index 100% rename from src/components/Footer.vue rename to src/components/TheFooter.vue diff --git a/src/components/Input.vue b/src/components/TheInput.vue similarity index 100% rename from src/components/Input.vue rename to src/components/TheInput.vue diff --git a/src/pages/index.vue b/src/pages/index.vue index 2f8545c..c795c5e 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -26,7 +26,7 @@ const go = () => {
- { +describe('TheCounter.vue', () => { it('should render', () => { - const wrapper = mount(Counter, { props: { initial: 10 } }) + const wrapper = mount(TheCounter, { props: { initial: 10 } }) expect(wrapper.text()).toContain('10') expect(wrapper.html()).toMatchSnapshot() }) it('should be interactive', async () => { - const wrapper = mount(Counter, { props: { initial: 0 } }) + const wrapper = mount(TheCounter, { props: { initial: 0 } }) expect(wrapper.text()).toContain('0') expect(wrapper.find('.inc').exists()).toBe(true)