Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Discussion options

You must be logged in to vote

Solved?

Oooh right, it's not auto unwrapping the ref, so I have to use .value. Wondering why...

~/pages/index.setup.tsx

const myName = ref<string>('Vue Macros')

export default () => (
  <div>
    <h1 class="text-3xl font-bold underline">
      Hello {myName.value}
      <button onClick={() => myName.value = 'Nuxt Macros'}>Change Name</button>
    </h1>
  </div>
)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sxzz
Comment options

sxzz Feb 4, 2024
Maintainer

Answer selected by sxzz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants