Vue学习之x-template
今天,我们来讲一个比较有趣的一个功能吧
先来看一段代码示例:
<html>
<head>
<meta charset="utf-8">
<script src="https://unpkg.com/vue/dist/vue.min.js"></script>
</head>
<body>
<div id="app">
<my-component></my-component>
<script type="text/x-template" id="my-component">
<div>
<p>This is the content of component</p>
<p>Hello Vue!</p>