config
This commit is contained in:
parent
31f7c998a2
commit
cbb14e0916
@ -1,9 +0,0 @@
|
||||
## Components
|
||||
|
||||
Components in this dir will be auto-registered and on-demand, powered by [`unplugin-vue-components`](https://github.com/antfu/unplugin-vue-components).
|
||||
|
||||
### Icons
|
||||
|
||||
You can use icons from almost any icon sets by the power of [Iconify](https://iconify.design/).
|
||||
|
||||
It will only bundle the icons you use. Check out [`unplugin-icons`](https://github.com/antfu/unplugin-icons) for more details.
|
@ -1,20 +0,0 @@
|
||||
## File-based Routing
|
||||
|
||||
Routes will be auto-generated for Vue files in this dir with the same file structure.
|
||||
Check out [`unplugin-vue-router`](https://github.com/posva/unplugin-vue-router) for more details.
|
||||
|
||||
### Path Aliasing
|
||||
|
||||
`~/` is aliased to `./src/` folder.
|
||||
|
||||
For example, instead of having
|
||||
|
||||
```ts
|
||||
import { isDark } from '../../../../composables'
|
||||
```
|
||||
|
||||
now, you can use
|
||||
|
||||
```ts
|
||||
import { isDark } from '~/composables'
|
||||
```
|
@ -1,5 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
Not Found
|
||||
</div>
|
||||
</template>
|
@ -1,22 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
const params = useRoute('/hi/[name]').params
|
||||
const router = useRouter()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div i-carbon-pedestrian inline-block text-4xl />
|
||||
<p>
|
||||
Hi, {{ params.name }}
|
||||
</p>
|
||||
<p text-sm op50>
|
||||
<em>Dynamic route!</em>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<button m-3 mt-8 text-sm btn @click="router.back()">
|
||||
Back
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
@ -1,3 +0,0 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`component of TheCounter.vue > should render 1`] = `"<div>10 <button class="inc"> + </button><button class="dec"> - </button></div>"`;
|
@ -1,7 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
describe('hi', () => {
|
||||
it('should works', () => {
|
||||
expect(1 + 1).toEqual(2)
|
||||
})
|
||||
})
|
@ -1,22 +0,0 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import TheCounter from '../src/components/TheCounter.vue'
|
||||
|
||||
describe('component of TheCounter.vue', () => {
|
||||
it('should render', () => {
|
||||
const wrapper = mount(TheCounter, { props: { initial: 10 } })
|
||||
expect(wrapper.text()).toContain('10')
|
||||
expect(wrapper.html()).toMatchSnapshot()
|
||||
})
|
||||
|
||||
it('should be interactive', async () => {
|
||||
const wrapper = mount(TheCounter, { props: { initial: 0 } })
|
||||
expect(wrapper.text()).toContain('0')
|
||||
|
||||
expect(wrapper.find('.inc').exists()).toBe(true)
|
||||
|
||||
await wrapper.get('button').trigger('click')
|
||||
|
||||
expect(wrapper.text()).toContain('1')
|
||||
})
|
||||
})
|
2
typed-router.d.ts
vendored
2
typed-router.d.ts
vendored
@ -19,7 +19,5 @@ declare module 'vue-router/auto-routes' {
|
||||
*/
|
||||
export interface RouteNamedMap {
|
||||
'/': RouteRecordInfo<'/', '/', Record<never, never>, Record<never, never>>,
|
||||
'/[...all]': RouteRecordInfo<'/[...all]', '/:all(.*)', { all: ParamValue<true> }, { all: ParamValue<false> }>,
|
||||
'/hi/[name]': RouteRecordInfo<'/hi/[name]', '/hi/:name', { name: ParamValue<true> }, { name: ParamValue<false> }>,
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ import {
|
||||
presetAttributify,
|
||||
presetIcons,
|
||||
presetUno,
|
||||
presetWebFonts,
|
||||
} from 'unocss'
|
||||
|
||||
export default defineConfig({
|
||||
@ -18,12 +17,12 @@ export default defineConfig({
|
||||
scale: 1.2,
|
||||
warn: true,
|
||||
}),
|
||||
presetWebFonts({
|
||||
fonts: {
|
||||
sans: 'DM Sans',
|
||||
serif: 'DM Serif Display',
|
||||
mono: 'DM Mono',
|
||||
},
|
||||
}),
|
||||
// presetWebFonts({
|
||||
// fonts: {
|
||||
// sans: 'DM Sans',
|
||||
// serif: 'DM Serif Display',
|
||||
// mono: 'DM Mono',
|
||||
// },
|
||||
// }),
|
||||
],
|
||||
})
|
||||
|
@ -60,9 +60,4 @@ export default defineConfig({
|
||||
// see uno.config.ts for config
|
||||
UnoCSS(),
|
||||
],
|
||||
|
||||
// https://github.com/vitest-dev/vitest
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
},
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user