dcms-ui-map
v1.0.2
Published
DCMS前端地图组件库
Downloads
4
Readme
DCMS-UI-Map
DCMS 前端地图组件库,基于百度地图+ElementUI,本项目依赖于 DCMS.UI 库
文档说明
安装
npm install -S dcms-ui-map
注册
在模块的 callback 函数中进行注册,已 DCMS.Module.Common 模块为例
import './api'
import store from './store'
import routes from './routes'
import components from './components'
import module from './module'
export default {
module,
routes,
store,
components,
callback({ Vue }) {
// 附件上传地址
Vue.prototype.$attachment = {
// 上传地址
uploadUrl: $api.common.attachment.getUploadUrl(),
// 下载方法
download(id) {
$api.common.attachment.download(id)
}
}
},
callback({ Vue }) {
DCMSMap.init(Vue, { ak: '百度地图Key' })
}
}
坐标拾取组件
<nm-form-page v-bind="form">
<el-row>
<el-col :span="10" :offset="1">
<el-form-item label="坐标:" prop="point">
<nm-map-coord-picking v-model="form.model.point" />
</el-form-item>
<el-form-item label="允许手动输入坐标:" prop="point">
<nm-map-coord-picking v-model="form.model.point1" allow-input />
</el-form-item>
<el-form-item label="禁用:" prop="point">
<nm-map-coord-picking v-model="form.model.point1" disabled />
</el-form-item>
<el-form-item label="设置精度:" prop="point">
<nm-map-coord-picking v-model="form.model.point2" :precision="8" />
</el-form-item>
</el-col>
</el-row>
</nm-form-page>