原文:在Vue+element 开发中报: The template root requires exactly one elemen 错的解决和原因

一.我正准备使用Vue Element进行新的项目开发,然后在进行添加下一个组件时报错 二.解决及原因: 原来template中只允许模板里存在一个根节点,在 template 中添加一个 lt div gt 标签,之后所有的组件全部加在 lt div gt 即可解决。 注意: lt template gt lt template gt 中必须要有一个根节点且只能存在一个根节点 ...

2020-01-20 23:55 0 8602 推荐指数:

查看详情

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>中的元素用一个大的<div>包起来,这样就可以在其中添加多个元素了,可以参考以下示例: ...

Thu Jan 28 08:09:00 CST 2021 0 612
Vue:The template root requires exactly one element.的解决办法

这是因为vue的模版中只有能一个根节点,所以在<template>中插入第二个元素就会报错 解决方案: 将<template>中的元素用一个大的 包起来,这样就可以在其中添加多个元素了,可以参考以下示例: 例子如下 ...

Wed Dec 15 05:29:00 CST 2021 0 1631
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM