class BaiduMap { show() { console.log('baidu show'); } } class GaodeMap { display() { console.log('gaode display'); } } class adapterBaidu extends BaiduMap { constructor() { super() } display() { this.show() } } function renderMap(map) { map.display() }
renderMap(new adapterBaidu()) renderMap(new GaodeMap())