From 391c22ddf0984d444e8b684d9584381e4d26bf7a Mon Sep 17 00:00:00 2001 From: lance Date: Mon, 7 Nov 2022 21:36:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A9=BE=E8=BD=A6=E8=B7=AF=E7=BA=BF=E8=A7=84?= =?UTF-8?q?=E5=88=92=E5=A2=9E=E5=8A=A0=E6=94=AF=E6=8C=81=E8=B5=B7=E5=A7=8B?= =?UTF-8?q?=E7=82=B9=E6=8B=96=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/search/Driving.vue | 9 +++++++-- docs/md/zh/bm-driving.md | 7 +++++-- types/driving.d.ts | 4 ++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/components/search/Driving.vue b/components/search/Driving.vue index d3f8a5b3..01b976d6 100644 --- a/components/search/Driving.vue +++ b/components/search/Driving.vue @@ -43,6 +43,10 @@ export default { }, selectFirstResult: { type: Boolean + }, + dragging: { + type: Boolean, + default: false } }, watch: { @@ -135,7 +139,7 @@ export default { }, load () { const instance = this - const {map, BMap, location, policy, selectFirstResult, autoViewport, highlightMode, search, start, end, startCity, endCity, waypoints, originInstance, getWaypoints} = this + const {map, BMap, location, policy, selectFirstResult, autoViewport, highlightMode, search, start, end, startCity, endCity, waypoints, originInstance, getWaypoints, dragging} = this const _location = location ? isPoint(location) ? createPoint(BMap, location) : location : map const route = this.originInstance = new BMap.DrivingRoute(_location, { renderOptions: { @@ -144,7 +148,8 @@ export default { panel: this.$el, selectFirstResult, autoViewport, - highlightMode + highlightMode, + enableDragging: dragging }, policy: global[policy], onSearchComplete (e) { diff --git a/docs/md/zh/bm-driving.md b/docs/md/zh/bm-driving.md index 0f5d2f91..4888aba4 100644 --- a/docs/md/zh/bm-driving.md +++ b/docs/md/zh/bm-driving.md @@ -18,6 +18,7 @@ |panel|Boolean|true|是否选展现检索结果面板。| |autoViewport|Boolean||检索结束后是否自动调整地图视野。| |selectFirstResult|Boolean||是否选择第一个检索结果。| +|dragging|Boolean||是否支持起终点支持拖动| ## 事件 @@ -47,7 +48,8 @@ startCity="北京" endCity="南京" :auto-viewport="true" - :waypoints="['呼和浩特', {lng: 112.53, lat: 37.87}, '陕西兵马俑']"> + :waypoints="['呼和浩特', {lng: 112.53, lat: 37.87}, '陕西兵马俑']" + :dragging="true"> ``` @@ -64,7 +66,8 @@ startCity="北京" endCity="南京" :auto-viewport="true" - :waypoints="['呼和浩特', {lng: 112.53, lat: 37.87}, '陕西兵马俑']"> + :waypoints="['呼和浩特', {lng: 112.53, lat: 37.87}, '陕西兵马俑']" + :dragging="true"> diff --git a/types/driving.d.ts b/types/driving.d.ts index ce028b98..cab1b3d2 100644 --- a/types/driving.d.ts +++ b/types/driving.d.ts @@ -45,4 +45,8 @@ export declare class Driving extends BaiduMapComponent { * 是否选择第一个检索结果。 */ selectFirstResult: boolean + /** + * 是否支持起终点支持拖动。 + */ + dragging: boolean } \ No newline at end of file