Skip to content

Commit

Permalink
feat: replace useAttrs to $attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
yue1123 committed Nov 22, 2022
1 parent 6e1d9f9 commit 83e816c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions packages/components/control/control/index.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div style="display: none">
<div ref="controlContainer" v-bind="attrs">
<div ref="controlContainer" v-bind="$attrs">
<slot></slot>
</div>
</div>
</template>

<script setup lang="ts">
import { ref, defineProps, withDefaults, onMounted, useAttrs } from 'vue'
import { ref, defineProps, withDefaults, onMounted } from 'vue'
import useLifeCycle from '../../../hooks/useLifeCycle'
import useBaseMapEffect from '../../../hooks/useBaseMapEffect'
export interface baseBmControlOptions {
Expand All @@ -25,7 +25,6 @@
}
const controlContainer = ref<HTMLDivElement>()
const { ready } = useLifeCycle()
const attrs = useAttrs()
const props = withDefaults(defineProps<baseBmControlOptions>(), {
anchor: 'BMAP_ANCHOR_TOP_LEFT',
offset: () => ({ x: 83, y: 18 })
Expand Down
5 changes: 2 additions & 3 deletions packages/components/control/copyright/index.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div style="display: none">
<div ref="copyrightContainer" v-bind="attrs">
<div ref="copyrightContainer" v-bind="$attrs">
<slot></slot>
</div>
</div>
</template>

<script setup lang="ts">
import { defineProps, withDefaults, defineEmits, onMounted, ref, getCurrentInstance, onUpdated, useAttrs } from 'vue'
import { defineProps, withDefaults, defineEmits, onMounted, ref, getCurrentInstance, onUpdated } from 'vue'
import useBaseMapEffect from '../../../hooks/useBaseMapEffect'
import useLifeCycle from '../../../hooks/useLifeCycle'
import copyrightControlPosCacheMap from './copyrightControlPosCacheMap'
Expand All @@ -32,7 +32,6 @@
const copyrightContainer = ref<HTMLDivElement>()
let copyrightControl: BMapGL.CopyrightControl
const uid = getCurrentInstance()?.uid
const attrs = useAttrs()
defineEmits(['initd', 'unload'])
onMounted(() => {
const { anchor, offset } = props
Expand Down
5 changes: 2 additions & 3 deletions packages/components/overlay/infowindow/index.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div style="display: none">
<div ref="infoWindowContainer" v-bind="attrs">
<div ref="infoWindowContainer" v-bind="$attrs">
<slot></slot>
</div>
</div>
</template>

<script setup lang="ts">
import { ref, watch, withDefaults, onUpdated, nextTick, computed, provide, useAttrs } from 'vue'
import { ref, watch, withDefaults, onUpdated, nextTick, computed, provide } from 'vue'
import useBaseMapEffect from '../../../hooks/useBaseMapEffect'
import bindEvents, { Callback } from '../../../utils/bindEvents'
import useLifeCycle from '../../../hooks/useLifeCycle'
Expand Down Expand Up @@ -86,7 +86,6 @@
const { ready } = useLifeCycle()
let infoWindow: BMapGL.InfoWindow
let _map: BMapGL.Map
const attrs = useAttrs()
useBaseMapEffect((map: BMapGL.Map) => {
_map = map
const cal = () => {
Expand Down

0 comments on commit 83e816c

Please sign in to comment.