A.html
<x-header v-bind:a="a" ></x-header>
var _vm = new Vue({
el: "-sharpapp",
data: {
a:[
{
name: "",
img: "../assets/images/menu.png",
url: "../index/index.html",
active: false
}
]
},
mounted () {
var _this = this;
Vue.component("x-header", function (resolve,reject) {
require(["text!../component/x-header.html"],function(html) {
resolve({
props: {
a:Array
},
template: html
})
});
});
},
methods: {
}
});
b.html
<div>
<div v-for="(index,item) in a" >
{{index}}--- {{item}}
</div>
</div>
the actual output results are as follows:
[- 0
Omurmuri-1
BQM-2
JMQ-3
EMUR-4
CQM-5
TFI-6
-7
Omuri-8
BMMI-9
JFLY-10
EMul-11
CMuy-12
TFI-13
]-- 14