0.0.10 • Published 2 years ago

@flow_in_river/baidu-map-vue v0.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Description

Baidu map component library

Install

npm install @flow_in_river/baidu-map-vue -S

如果你使用 ts

npm install @flow_in_river/baidu-map-web-types -D

Document

文档地址,仅供参考,事件集中放在 events 参数

Usage

import { createApp } from 'vue'
import BaiduMapVue from '@flow_in_river/baidu-map-vue'
import App from './App.vue'

const app = createApp(App)
app.use(BaiduMapVue, {
  apiKey: apiKey,
  autoInitMap: true, // 是否自动引入百度地图,默认为true,如果设置为false,<bm-map :b-map="BMap"></bm-map>,需要手动引入
})

tsconfig

{
  "types": ["@flow_in_river/baidu-map-web-types"]
}

events demo

<template>
  <bm-map
    style="height: 350px"
    :center="center"
    :zoom="zoom"
    :keyboard="true"
    :scroll-wheel-zoom="true"
    :map-click="false"
    :events="events"
  >
  </bm-map>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
export default defineComponent({
  name: 'App',
  setup() {
    const center = ref({ lng: 116.332782, lat: 40.007978 })
    const zoom = 16
    const events = {
      click: (e) => {
        console.log(e)
      },
    }
    return {
      center,
      zoom,
      events,
    }
  },
})
</script>
0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago