Skip to content

fix(docs): import ref in Vue README TypeScript example#356

Open
erhnysr wants to merge 1 commit into
base:masterfrom
erhnysr:fix/vue-readme-missing-ref-import
Open

fix(docs): import ref in Vue README TypeScript example#356
erhnysr wants to merge 1 commit into
base:masterfrom
erhnysr:fix/vue-readme-missing-ref-import

Conversation

@erhnysr

@erhnysr erhnysr commented Jul 8, 2026

Copy link
Copy Markdown

What

The Vue integration guide's TypeScript example (packages/account-ui/src/frameworks/vue/README.md) imports only the Ref type from vue, but then calls the ref() function:

import { SignInWithBaseButton } from '@base-org/account-ui/vue';
import type { Ref } from 'vue';
...
const currentUser: Ref<User | null> = ref(null);   // ref is never imported

In a standard Vue 3 <script setup>, ref is not auto-imported (that only happens with plugins like unplugin-auto-import or Nuxt). As written, copy-pasting the snippet fails with ReferenceError: ref is not defined.

Fix

Import the ref function alongside the type:

import { ref, type Ref } from 'vue';

Docs-only change; no code or public API is affected.

The TypeScript example imported only the Ref type from vue but called
ref(null), which is not auto-imported in a standard Vue 3 <script setup>.
Import the ref function so the snippet runs as written.
@cb-heimdall

Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants