Skip to content

Commit

Permalink
Merge pull request #223 from onmax/patch-1
Browse files Browse the repository at this point in the history
fix: only run `useLayout` in the client
  • Loading branch information
tmg0 authored Nov 18, 2024
2 parents aae90f2 + 8438e12 commit 8b55fb0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/core/src/composables/use-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ function useTransform(target: PermissiveTarget) {
}

export function useStyle(target: PermissiveTarget, options: UseStyleOptions = {}) {
let observer: MutationObserver
const transform = ref<Partial<Transform>>({})

if (import.meta.server)
return { transform }

let observer: MutationObserver
const domRef = toRef(target)
const transform = ref<Partial<Transform>>({})

if (domRef.value)
transform.value = useTransform(domRef).value
Expand Down

0 comments on commit 8b55fb0

Please sign in to comment.