Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue3+nuxt3版本,Tabs标签不生效 #396

Open
yeshili opened this issue Dec 9, 2024 · 4 comments
Open

vue3+nuxt3版本,Tabs标签不生效 #396

yeshili opened this issue Dec 9, 2024 · 4 comments
Labels
Bug Something isn't working

Comments

@yeshili
Copy link

yeshili commented Dec 9, 2024

vue3+nuxt3版本,Tabs标签不生效

image
都不生效的
image

@yeshili
Copy link
Author

yeshili commented Dec 9, 2024

无法直接定位name2

@yeshili
Copy link
Author

yeshili commented Dec 9, 2024

image
就算这样子也不生效

image

@dosubot dosubot bot added the Bug Something isn't working label Dec 9, 2024
Copy link

dosubot bot commented Dec 9, 2024

Hey @yeshili! I'm here to help you with any bugs, questions, or to guide you on how to become a contributor. Let's squash those bugs together! 🤖

To resolve the issue with the Tabs component not working in your Vue 3 and Nuxt 3 project, ensure that you are using the correct version of ViewUIPlus, which is recommended to be version "1.3.19" for compatibility with Vue 3 and Nuxt 3 [1].

Additionally, make sure you are using the v-model directive to bind the active tab correctly. Instead of using the value attribute, you should use v-model with the modelValue prop. Here's an example of how you can set it up:

<template>
  <Tabs v-model="activeTab">
    <TabPane label="标签一" name="name1">标签一的内容</TabPane>
    <TabPane label="标签二" name="name2">标签二的内容</TabPane>
    <TabPane label="标签三" name="name3">标签三的内容</TabPane>
  </Tabs>
</template>

<script>
import { ref } from 'vue';

export default {
  setup() {
    const activeTab = ref('name2'); // Set the initial active tab
    return { activeTab };
  }
};
</script>

Ensure that your Tabs component is correctly imported and that the v-model is bound to a reactive reference (ref) in your setup function. This should help in making the tabs functional.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@yeshili
Copy link
Author

yeshili commented Dec 9, 2024

那文档应该也跟着版本修改才行

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant