原文:The template root requires exactly one element.eslint-plugin-vue

將 lt template gt 中的元素用一個大的 lt div gt 包起來,這樣就可以在其中添加多個元素了 ...

2021-09-21 21:39 0 165 推薦指數:

查看詳情

vue error:The template root requires exactly one element.

error:[vue/valid-template-root] The template root requires exactly one element. 原因: 因為vue的模版中只有能一個根節點,所以在<template>中插入第二個元素就會報錯 解決方案 ...

Wed Sep 19 23:22:00 CST 2018 0 1474
Vue:The template root requires exactly one element.的解決辦法

這是因為vue的模版中只有能一個根節點,所以在<template>中插入第二個元素就會報錯 解決方案: 將<template>中的元素用一個大的 包起來,這樣就可以在其中添加多個元素了,可以參考以下示例: 例子如下 ...

Wed Dec 15 05:29:00 CST 2021 0 1631
Vue:The template root requires exactly one element.的解決辦法

這是因為vue的模版中只有能一個根節點,所以在<template>中插入第二個元素就會報錯 解決方案: 將<template>中的元素用一個大的<div>包起來,這樣就可以在其中添加多個元素了,可以參考以下示例: ...

Thu Jan 28 08:09:00 CST 2021 0 612
Vue -->Error compiling template: Component template requires a root element, rather than just text.

報了個錯誤,根據意思來理解就是說,template模板編譯錯誤,組件模板需要一個根元素而不僅僅是個文本 然后我想到了template模板是需要一個根元素就像這樣 這個div就是需要的根元素,我寫了的啊,顯然不是這個的問題,想了好久后面那句話:“不僅僅是個文本?”什么意思 ...

Mon Apr 12 04:32:00 CST 2021 0 323
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM