<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<script src="../vue/vue.js"></script>
<title>学习vue</title>
</head>
<body>
<div id="app">
<table>
<tbody>
<tr is='row'></tr>
<tr is='row'></tr>
<tr is='row'></tr>
</tbody>
</table>
</div>
<script>
Vue.component("row", {
data:function(){//不能用对象 只能函数 返回对象
return {
content:'hello!'
}
},
template: "<tr><td>{{content}}<td><tr>"
});
var app = new Vue({
el: "#app",
data: {}
});
</script>
</body>
</html>
vue学习(九) 组件中is的使用
最新推荐文章于 2022-03-16 18:00:25 发布