We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 28f0327 + 9269d30 commit b5314e5Copy full SHA for b5314e5
1 file changed
src/livecodes/templates/starter/vue-sfc-starter.ts
@@ -27,14 +27,15 @@ import Counter from './Component.vue';
27
<script setup lang="tsx">
28
import { ref } from 'vue';
29
30
- const props = defineProps({
31
- name: String
32
- })
+ interface Props {
+ name?: string
+ }
33
+ const props = defineProps<Props>();
34
const count = ref(0);
35
const align = 'center';
36
37
// define inline component
- function Greeting(props: {name?: string}) {
38
+ function Greeting(props: Props) {
39
return <h1>Hello, { props.name || 'World' }!</h1>
40
}
41
</script>
0 commit comments