我正在像这样在 Vuejs 中创建第一个 View :
<template>
<p>Welcome to MyWebsite</p>
<p>These terms and conditions outline the rules and regulations for the use of MySite Website.</p> <br />
<span style="text-transform: capitalize;"> MySite</span> is located at:<br />
<address>Adresss , City<br />State - 00000, USA<br />
</address>
</template>
但我总是得到
Welcome to MyWebsite
These terms and conditions outline the rules and regulations for the use of MySite Website.
MySite is located at:
Adresss , City
State - 00000, USA
- Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.
为什么它推荐我使用 v-if?我不明白我应该在那里做什么?问候
最佳答案
Component template should contain exactly one root element.
<template>
<div><!-- ONLY ONE DIRECT CHILD IN THE TEMPLATE -->
<p>Welcome to MyWebsite</p>
<p>These terms and conditions outline the rules and regulations for the use of MySite Website.</p> <br />
<span style="text-transform: capitalize;"> MySite</span> is located at:<br />
<address>Adresss , City<br />State - 00000, USA<br /></address>
</div>
</template>
关于vue.js - 在 Vue.js 中创建第一个 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49545096/