This commit is contained in:
2022-04-08 14:40:34 +08:00
parent 5c63952ed3
commit 715dadf3f5
11 changed files with 1626 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
<script setup>
<script setup lang="ts">
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
import HelloWorld from './components/HelloWorld.vue'
@@ -6,7 +6,7 @@ import HelloWorld from './components/HelloWorld.vue'
<template>
<img alt="Vue logo" src="./assets/logo.png" />
<HelloWorld msg="Hello Vue 3 + Vite" />
<HelloWorld msg="Hello Vue 3 + TypeScript + Vite" />
</template>
<style>

View File

@@ -1,9 +1,7 @@
<script setup>
<script setup lang="ts">
import { ref } from 'vue'
defineProps({
msg: String
})
defineProps<{ msg: string }>()
const count = ref(0)
</script>
@@ -11,6 +9,22 @@ const count = ref(0)
<template>
<h1>{{ msg }}</h1>
<p>
Recommended IDE setup:
<a href="https://code.visualstudio.com/" target="_blank">VSCode</a>
+
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
</p>
<p>See <code>README.md</code> for more information.</p>
<p>
<a href="https://vitejs.dev/guide/features.html" target="_blank">
Vite Docs
</a>
|
<a href="https://v3.vuejs.org/" target="_blank">Vue 3 Docs</a>
</p>
<button type="button" @click="count++">count is: {{ count }}</button>
<p>
@@ -23,4 +37,16 @@ const count = ref(0)
a {
color: #42b983;
}
label {
margin: 0 0.5em;
font-weight: bold;
}
code {
background-color: #eee;
padding: 2px 4px;
border-radius: 4px;
color: #304455;
}
</style>

8
src/env.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
/// <reference types="vite/client" />
declare module '*.vue' {
import type { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default component
}