<!DOCTYPE html><html><body><div id="app"><my-component></my-component></div><-- 注意:使用<script>标签时,type指定为text/x-template,意在告诉浏览器这不是一段js脚本,浏览器在解析HTML文档时会忽略<script>标签内定义的内容。--><script type="text/x-template" id="myComponent">//注意 type 和id。<div>This is a component