This commit is contained in:
@ -1,4 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="tsx" setup>
|
||||||
|
import type { FunctionalComponent } from 'vue';
|
||||||
|
|
||||||
useHead({
|
useHead({
|
||||||
// Titles
|
// Titles
|
||||||
title: 'Hello World',
|
title: 'Hello World',
|
||||||
@ -13,6 +15,14 @@ useHead({
|
|||||||
definePage({
|
definePage({
|
||||||
alias: '/',
|
alias: '/',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://cn.vuejs.org/guide/extras/render-function#typing-functional-components
|
||||||
|
const FComponent: FunctionalComponent<{ prop: string }> = (props, context) => (
|
||||||
|
<>
|
||||||
|
<div>This is a functional component with prop: {props.prop}</div>
|
||||||
|
<div>{props.prop}</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -24,4 +34,5 @@ definePage({
|
|||||||
<li><router-link :to="{ name: '中文页面' }">中文-页面.page.vue</router-link></li>
|
<li><router-link :to="{ name: '中文页面' }">中文-页面.page.vue</router-link></li>
|
||||||
<li><router-link :to="{ name: 'MdPage' }">Markdown Page</router-link></li>
|
<li><router-link :to="{ name: 'MdPage' }">Markdown Page</router-link></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<FComponent prop="Hello World" />
|
||||||
</template>
|
</template>
|
||||||
|
Reference in New Issue
Block a user