当前位置: 代码迷 >> 综合 >> Vue-Template 三种制作模版方法
  详细解决方案

Vue-Template 三种制作模版方法

热度:52   发布时间:2023-12-03 02:11:48.0
<!DOCTYPE html>
<html><head><meta charset="UTF-8"><script type="text/javascript" src="js/vue.js"></script><title></title></head><body><h1>Template 三种制作模版方法</h1><hr><div id="app">{
   {message}}</div><!--第二种--><template id="dd2"><h2 style="color:red">我是标签模板</h2></template><!--第三种--><script type="x-template" id="dd3"><h2 style="color:red">我是script模板</h2></script><script type="text/javascript">var app=new Vue({el:'#app',data:{message:'hello Vue!'},template:"#dd3"//第一种
//          template:`
//          	<h2 style="color:red">我是选项模板</h2>
//          `})</script>
</body>
</html>

 

  相关解决方案