在vue3中setup语法糖使用onMounted报警告

在vue3中setup语法糖使用onMounted报警告

明明没有使用async setup() 为什么也会报出这个警告呢
不让我添加图片

<script setup>

import { reactive, computed, onMounted } from 'vue';

const loadingInstance = ElLoading.service();

onMounted(() => {

loadingInstance.close()

})

</script>

runtime-core.esm-bundler.js?5c40:38 [Vue warn]: onMounted is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.

以上是 在vue3中setup语法糖使用onMounted报警告 的全部内容, 来源链接: utcz.com/p/937111.html

回到顶部