赞
踩
通过名称传递必须先对其进行注册, 将组件本身传递给 is
而不是其名称,则不需要注册
<script> import { Transition, TransitionGroup } from 'vue' export default { components: { Transition, TransitionGroup } } </script> <template> <component :is="isGroup ? 'TransitionGroup' : 'Transition'"> ... </component> </template>
<script setup>
import TestOne from './components/TestOne.vue'
import TestTwo from './components/TestTwo.vue'
const tabs = [TestTwo, TestOne];
const title = 'Hello';
</script>
<script setup>
const tabs = [TestTwo, TestOne];
const title = 'Hello';
</script>
<script>
import TestOne from './components/TestOne.vue'
import TestTwo from './components/TestTwo.vue'
export default {
components: {
TestOne,
TestTwo
}
}
</script>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。