Vue.component注册组件
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://test.thinkfmf.cn/css/test.css">
</head>
<body>
<div id="test">
<logo-box v-for="src in div_message" :src="src">
</logo-box>
</div>
<script>
Vue.component('logo-box', {//注册logo-box组件
props:['src'],
template:`
<div class="logo-box">
<div>div_message</div>
<img :src="'https://www.thinkfmf.cn/logo/'+src"/>
</div>`
})
var vue = new Vue({
el: '#test',
data: { div_message: ['money.png', 'balance.png', 'cardRepay.png', 'cards.png']}
})
</script>
</body>
</html>