Skip to content

Commit

Permalink
Merge pull request vue-leaflet#105 from vue-leaflet/update-demo-usage
Browse files Browse the repository at this point in the history
Update demo usage
  • Loading branch information
DonNicoJs authored Mar 23, 2021
2 parents cadbdef + 7113550 commit e074820
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ or

## Usage

Until the complete documentation is ready, please check the [demo project](https://github.com/vue-leaflet/vue3-demo-project/blob/master/src/App.vue) for example usage.
Until the complete documentation is ready, please check the
[component playground](https://github.com/vue-leaflet/vue-leaflet/tree/master/src/playground/views) examples or the
[demo project](https://github.com/vue-leaflet/vue3-demo-project/blob/master/src/App.vue) for usage with Vue 3.
Most component props mimic the vanilla [Leaflet options](https://leafletjs.com/reference-1.7.1.html) as closely as
possible, and generally remain the same as in their [Vue2Leaflet counterparts](https://vue2-leaflet.netlify.app/components/).

### Working with Leaflet

Expand All @@ -53,14 +57,16 @@ classes are technically no longer the same. See [Issue 48](https://github.com/vu
To avoid these issues, import any Leaflet methods asynchronously in response to the LMap component's `@ready` event:
```vue
<template>
<l-map>
<l-map style="height:50vh">
<l-geo-json :geojson="geojson" :options="geojsonOptions" />
</l-map>
</template>
<script>
// DON'T load Leaflet components here!
import { LMap, LGeoJson } from "./../../components";
// Its CSS is needed though, if not imported elsewhere in your application.
import "leaflet/dist/leaflet.css"
import { LMap, LGeoJson } from "@vue-leaflet/vue-leaflet";
export default {
components: {
Expand Down

0 comments on commit e074820

Please sign in to comment.