Skip to content

Commit

Permalink
feat: width 和 height 支持响应式
Browse files Browse the repository at this point in the history
  • Loading branch information
yue1123 committed Dec 5, 2022
1 parent 2d2478a commit e16dc90
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/components/map/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
provide,
nextTick,
getCurrentInstance,
ref
ref,
computed
} from 'vue'
import useLifeCycle from '../../hooks/useLifeCycle'
import bindEvents, { Callback } from '../../utils/bindEvents'
Expand Down Expand Up @@ -256,8 +257,8 @@
enablePinchToZoom: true,
enableAutoResize: true
})
const width = isString(props.width) ? props.width : `${props.width}px`
const height = isString(props.height) ? props.height : `${props.height}px`
const width = computed(() => (isString(props.width) ? props.width : `${props.width}px`))
const height = computed(() => (isString(props.height) ? props.height : `${props.height}px`))
const vueEmits = defineEmits([
'initd',
'unload',
Expand Down Expand Up @@ -307,7 +308,6 @@
? Object.assign(proxy!.$baiduMapPluginsSourceLink, props.pluginsSourceLink)
: props.pluginsSourceLink || proxy!.$baiduMapPluginsSourceLink || {}
if (!ak) error('missing required props: ak')
const scriptKey = `_initBMap${ak}`
// 初始化地图
function init() {
Expand Down

0 comments on commit e16dc90

Please sign in to comment.