我在使用一個沒什么人維護的庫https://github.com/sombriks/v...作者把包裝成了componentmodule.exports = {
openlayers,
install (Vue, options) {
Vue.component('ol-map', olMap)
Vue.component('ol-marker', olMarker)
}
}給出的使用例子是<template>
<div id="map">
<ol-map>
<ol-marker/>
<ol-marker/>
<ol-marker/>
</ol-map>
</div></template>請問,在這些component里都有一些method...我該如何invoke這些method呢?比如olMap里有一個updateCenter的功能就很有用,但是我不知道怎么使用這種component里的method...再比如下面有多個ol-marker,怎么能在vue里表明我要用的是第幾個marker里面的method呢?
Vue.js Component的method應(yīng)該如何使用
喵喵時光機
2018-10-10 13:14:53