<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<script src="vue.js"></script>
</head>
<body>
<div>
<h1>--通过 v-once 创建低开销的静态组件--</h1>
<div id="example1">
<my-component></my-component>
</div>
<script>
Vue.component('my-component', {
template: '\
<div v-once>\
<h1>Terms of Service</h1>\
</div>\
'
})
// Vue 根实例
var example1 = new Vue({
el: '#example1'
})
</script>
</div>
</body>
</html>