1.0.6 • Published 8 months ago
@szlx/navigation v1.0.6
@szlx/navigation
uniapp 内部项目调用打开地图工具函数
Installtion
npm i @szlx/navigation
Usage
import Vue from 'vue'
import OpenLocation from '@szlx/navigation'
Vue.use(OpenLocation, {
name: '$openMap',
t: (name, opts) => i18n.t(name, opts)
})
export default {
methods: {
handleOpenMap() {
this.$openMap({
latitude: 39.909187,
longitude: 116.397455,
address: '北京天安门'
})
}
}
}
Install Options
参数名 | 说明 | 类型 | 必填 | 默认值 |
---|---|---|---|---|
name | 方法名 | string | false | $openLocation |
title | 标题 | string | false | 选择地图应用 |
cancelText | 取消文字 | string | false | 取消 |
showOpenFailed | 打开失败回调 | function | false | $openLocation |
t | i18n.t | function | true | (k, o) => o?.default |
name props
参数名 | 说明 | 类型 | 必填 | 默认值 |
---|---|---|---|---|
latitude | 维度 | number | true | - |
longitude | 经度 | number | true | - |
address | 地址 | string | true | - |