fix: use two words component name

This commit is contained in:
Anthony Fu 2022-11-30 08:05:45 +08:00
parent 2e425e13bd
commit 01e0cbbb82
10 changed files with 13 additions and 13 deletions

6
src/components.d.ts vendored
View File

@ -7,11 +7,11 @@ export {}
declare module '@vue/runtime-core' {
export interface GlobalComponents {
Counter: typeof import('./components/Counter.vue')['default']
Footer: typeof import('./components/Footer.vue')['default']
Input: typeof import('./components/Input.vue')['default']
README: typeof import('./components/README.md')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
TheCounter: typeof import('./components/TheCounter.vue')['default']
TheFooter: typeof import('./components/TheFooter.vue')['default']
TheInput: typeof import('./components/TheInput.vue')['default']
}
}

View File

@ -1,7 +1,7 @@
<template>
<main class="px-4 py-10 text-center text-gray-700 dark:text-gray-200">
<RouterView />
<Footer />
<TheFooter />
<div class="mt-5 mx-auto text-center opacity-75 dark:opacity-50 text-sm">
[Default Layout]
</div>

View File

@ -1,7 +1,7 @@
<template>
<main class="px-4 py-10 text-center text-gray-700 dark:text-gray-200">
<RouterView />
<Footer />
<TheFooter />
<div class="mt-5 mx-auto text-center opacity-75 dark:opacity-50 text-sm">
[Home Layout]
</div>

View File

@ -27,9 +27,9 @@ watchEffect(() => {
<span opacity-75>{{ t('intro.aka') }}:</span>
<ul>
<li v-for="otherName in user.otherNames" :key="otherName">
<router-link :to="`/hi/${otherName}`" replace>
<RouterLink :to="`/hi/${otherName}`" replace>
{{ otherName }}
</router-link>
</RouterLink>
</li>
</ul>
</p>

View File

@ -30,7 +30,7 @@ const { t } = useI18n()
<div py-4 />
<Input
<TheInput
v-model="name"
placeholder="What's your name?"
autocomplete="false"

View File

@ -1,3 +1,3 @@
// Vitest Snapshot v1
exports[`Counter.vue > should render 1`] = `"<div>10 <button class=\\"inc\\"> + </button><button class=\\"dec\\"> - </button></div>"`;
exports[`TheCounter.vue > should render 1`] = `"<div>10 <button class=\\"inc\\"> + </button><button class=\\"dec\\"> - </button></div>"`;

View File

@ -1,16 +1,16 @@
import { mount } from '@vue/test-utils'
import { describe, expect, it } from 'vitest'
import Counter from '../src/components/Counter.vue'
import TheCounter from '../src/components/TheCounter.vue'
describe('Counter.vue', () => {
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)