VueJS将对象传递给prop中的数组

时间:2017-12-13 16:51:00

标签: arrays vue.js prop

 <gmap-map :center="center" :zoom="19" style="width: 100%; height: 750px" map-type-id="hybrid">
    <gmap-info-window :options="infoOptions" :position="infoWindowPos" :opened="infoWinOpen" @closeclick="infoWinOpen=false">
        {{infoContent}}
    </gmap-info-window>
    <template v-for="pin in pins">
        lat: {{pin.latitude}},lng: {{pin.longitude}}
        <gmap-marker :icon="{url: themepath + 'pin.png'}" :position="{lat: pin.latitude, lng: pin.longitude}" :clickable="true" @click="toggleInfoWindow(m,i)"></gmap-marker>
    </template>
</gmap-map>

我上面有这个代码,我试图使用:position="{lat: pin.latitude, lng: pin.longitude}"循环内容传递v-for,但这似乎不起作用。有没有更简单的方法来传递这些?

0 个答案:

没有答案