P粉4278776762023-09-05 10:46:57
When using the composition API definition Vue SFC.
You can use the method< /a> or you can use the normal
and
setup
functions and optional defineComponent
.
<脚本设置>
<template> <div> <OnboardLand /> <OnboardShow /> </div> </template> <script setup> import OnboardLand from './onboardland.vue' import OnboardShow from './onboardshow.vue' // composition goes here... </script>
defineComponent
<template> <div> <OnboardLand /> <OnboardShow /> </div> </template> <script> import { defineComponent } from 'vue'; import OnboardLand from './onboardland.vue' import OnboardShow from './onboardshow.vue' export default defineComponent({ components: { OnboardLand, OnboardShow, }, setup(props) { // composition goes here. }, }) </script>