問(wèn)題描述
1、頁(yè)面切換后白屏,同時(shí)切換回上一個(gè)頁(yè)面同樣白屏
2、刷新后正常顯示
3、有警告:Component inside <Transition> renders non-element root node that cannot be animated
解決方法
<Transition>中的組件呈現(xiàn)不能動(dòng)畫(huà)化的非元素根節(jié)點(diǎn)
也就是說(shuō),組件內(nèi)必須有一個(gè)根元素
之前:
<template>
<div>你好</div>
<div>您好</div>
</template>
現(xiàn)在:文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-720377.html
<template>
<div>
<div>你好</div>
<div>您好</div>
</div>
</template>
?原來(lái)的vue2中,template下是必須有一個(gè)根元素的,vue3變?yōu)榭啥鄠€(gè)根元素文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-720377.html
到了這里,關(guān)于vue項(xiàng)目切換頁(yè)面白屏的解決方案的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!