Skip to content

Commit

Permalink
chore: use utils
Browse files Browse the repository at this point in the history
  • Loading branch information
holazz committed Jun 18, 2022
1 parent 9210a48 commit 70d0077
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/components/popover/src/popover.vue
Expand Up @@ -45,7 +45,7 @@
<script lang="ts" setup>
import { computed, ref, unref } from 'vue'
import { ElTooltip } from '@element-plus/components/tooltip'
import { isString } from '@element-plus/utils'
import { addUnit } from '@element-plus/utils'
import { useNamespace } from '@element-plus/hooks'
import { popoverEmits, popoverProps } from './popover'
import type { TooltipInstance } from '@element-plus/components/tooltip'
Expand All @@ -62,17 +62,11 @@ const tooltipRef = ref<TooltipInstance>()
const popperRef = computed(() => {
return unref(tooltipRef)?.popperRef
})
const width = computed(() => {
if (isString(props.width)) {
return props.width
}
return `${props.width}px`
})
const style = computed(() => {
return [
{
width: width.value,
width: addUnit(props.width),
},
props.popperStyle!,
]
Expand Down

0 comments on commit 70d0077

Please sign in to comment.