Skip to content

Can I use v-on:click in VPButton? #4445

Answered by ms264556
xycabcd asked this question in Q&A
Discussion options

You must be logged in to vote

I use VPButton in several places on my vitepress site, with @click pointing to functions defined in the page's <script setup>. It works just fine.

When I was just using it on just one page, I included import { VPButton } from 'vitepress/theme'; in my page's <script setup>. Now I have it added to my enhanceapp: app.component('VPButton', VPButton) so I can easily use it everywhere.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xycabcd
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