Skip to content

Commit

Permalink
fix(unrefElement): revert #1657
Browse files Browse the repository at this point in the history
This reverts commit 050da20.
  • Loading branch information
antfu committed Jun 18, 2022
1 parent 5d4b848 commit 3d846d1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 74 deletions.
72 changes: 0 additions & 72 deletions packages/core/unrefElement/index.test.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/core/unrefElement/index.ts
Expand Up @@ -15,6 +15,5 @@ export type UnRefElementReturn<T extends MaybeElement = MaybeElement> = T extend
*/
export function unrefElement<T extends MaybeElement>(elRef: MaybeElementRef<T>): UnRefElementReturn<T> {
const plain = unref(elRef)

return plain != null && '$el' in (plain as VueInstance) ? (plain as VueInstance).$el : plain
return (plain as VueInstance)?.$el ?? plain
}

0 comments on commit 3d846d1

Please sign in to comment.