- temlate编译出来了,以下是我的代码
<template>
<div></div>
</template>
元素查看:
2. 往div里面再加点内容看看
<template>
<div>111111</div>
</template>
元素查看:
现在依然是在页面中没有显现出来,dom元素都没有存在
3. 解决方法: 在template标签上加一个 v-if=“true”
<template v-if="true">
<div>111111</div>
</template>
原因猜想:template也是一个html标签,可能为了区分原始的标签和vue的模板吧!