Vue.component传递多个参数
<html><head><script src="vue.js"></script><title>标题</title></head><body><div id="ids">{{show()}}<login2 items="1212qqq" userna...
·
<html>
<head>
<script src="vue.js"></script>
<title>标题</title>
</head>
<body>
<div id="ids">{{show()}}
<login2 items="1212qqq" username="89adasads0" message="jfsdajfsadjflaksjfkds"></login2>
<button v-on:click="click()">{{message}}</button>
</div>
<script>
Vue.component('login2', {
props: ['items', 'username'],
template: '<h1>{{items}}---{{username}}</h1>'
});
var vue = new Vue({
el: '#ids',
data: {
title: 'titles',
message: 'fdasfidsajflhdsa'
},
methods: {
show: function () {
return 100;
},
click: function () {
return this.message = "you guess!";
}
},
});
</script>
</body>
</html>
更多推荐
已为社区贡献1条内容
所有评论(0)