提交 94661cdf 编写于 作者: Shine-zwj's avatar Shine-zwj

update: 更新

上级 6ccebdcd
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</ion-header> </ion-header>
<ion-content> <ion-content>
<ion-header> <ion-header>
<ion-searchbar :value="address" @ionChange="search($event)"></ion-searchbar> <ion-searchbar :value="address" @ionChange="search($event)" @ionClear="clearSearchList()"></ion-searchbar>
<div id="map__result" class="content-result"></div> <div id="map__result" class="content-result"></div>
</ion-header> </ion-header>
<ion-content> <ion-content>
...@@ -258,6 +258,22 @@ export default class AppMobMapPage extends Vue { ...@@ -258,6 +258,22 @@ export default class AppMobMapPage extends Vue {
} }
} }
/**
* 清空搜索列表
*
* @type {*}
* @memberof AppMobMapPage
*/
public clearSearchList() {
let el = document.getElementById('map__result');
let childs = el?.childNodes;
if (childs && childs.length > 0) {
for (let i=0; i< childs?.length; i++) {
el?.removeChild(childs[i]);
}
}
}
/** /**
* 搜索地址 * 搜索地址
* *
...@@ -271,7 +287,6 @@ export default class AppMobMapPage extends Vue { ...@@ -271,7 +287,6 @@ export default class AppMobMapPage extends Vue {
that.win.AMap.service(["AMap.PlaceSearch"], () => { that.win.AMap.service(["AMap.PlaceSearch"], () => {
placeSearch = new this.win.AMap.PlaceSearch({ placeSearch = new this.win.AMap.PlaceSearch({
pageSize: 5, pageSize: 5,
city: '成都',
citylimit: false, citylimit: false,
panel: 'map__result', panel: 'map__result',
}) })
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册