docs(framework/vue/devtools): inline the toggle and 'onClose' handler in the 'Embedded Mode' example to match the other adapters#10856
Conversation
… in the 'Embedded Mode' example to match the other adapters
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Vue devtools documentation is updated to simplify the Embedded Mode example. The code snippet removes a separate ChangesVue Devtools Documentation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit 53e683f
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview2 package(s) bumped directly, 23 bumped as dependents. 🟩 Patch bumps
|
size-limit report 📦
|
🎯 Changes
Simplify the Vue
## Embedded Modeexample by inlining thetoggleDevtoolsfunction and theonClosehandler so the snippet stays focused on the state and template, matching how the React/Preact/Solid examples already work:toggleDevtoolsfunction and inline@click="isOpen = !isOpen"on the button:onClose="() => (isOpen = false)"so the handler explicitly closes the panel (mirroring React'sonClose={() => setIsOpen(false)}) instead of toggling, which more accurately reflects the prop's semanticsconst isOpen = ref(false)so the locals are visually separated from the import block<script setup> import { ref } from 'vue' import { VueQueryDevtoolsPanel } from '@tanstack/vue-query-devtools' -const isOpen = ref(false) -function toggleDevtools() { - isOpen.value = !isOpen.value -} + +const isOpen = ref(false) </script> <template> <h1>The app!</h1> - <button @click="toggleDevtools"> + <button @click="isOpen = !isOpen"> {{ isOpen ? 'Close' : 'Open' }} the devtools panel </button> - <VueQueryDevtoolsPanel v-if="isOpen" :onClose="toggleDevtools" /> + <VueQueryDevtoolsPanel v-if="isOpen" :onClose="() => (isOpen = false)" /> </template>Follow-up to #10855 (which already aligned the state name and button label). The
<script setup>+v-if+@clicktemplate syntax remain idiomatic Vue 3.✅ Checklist
🚀 Release Impact
Summary by CodeRabbit