home.vue
<template>
<view>
<!-- 无效 -->
<TestVComp v-show="false" />
<!-- 有效 -->
<TestComp v-show="false" />
</view>
</template>
<script lang="ts" setup>
import TestVComp from './test-v-comp.vue'
import TestComp from './test-comp.vue'
</script>
test-v-comp.vue,使用 virtualHost
<template>
<view>test-v-comp</view>
</template>
<script lang="ts" setup></script>
<script lang="ts">
export default {
options: {
virtualHost: true
}
}
</script>
test-comp.vue,不使用 virtualHost
<template>
<view>test-comp</view>
</template>
<script lang="ts" setup></script>
1***@qq.com (作者)
了解了,感谢解答
2024-07-04 15:26