亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Vue.js Component的method應該如何使用

Vue.js Component的method應該如何使用

喵喵時光機 2018-10-10 13:14:53
我在使用一個沒什么人維護的庫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呢?
查看完整描述

1 回答

?
12345678_0001

TA貢獻1802條經驗 獲得超5個贊

<ol-map ref="map">

</ol-map>



this.$refs.map.updateCenter()


查看完整回答
反對 回復 2018-11-29
  • 1 回答
  • 0 關注
  • 1223 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號