Skip to content

Use Dropdown in TABS to define a drop-down menu: visible="true", it will be rendered twice #5411

Open
@mengyu987

Description

@mengyu987
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.0.0-beta.10

Environment

win11 vue3

Reproduction link

https://codesandbox.io/s/mystifying-hugle-sw680i?file=/src/demo.vue

Steps to reproduce

{{ item.title }}
  • 重命名
  • 复制视图
  • 删除视图
  • 表格视图
  • 图表视图
<script setup> import {nextTick, reactive} from "vue"; // 引入样式 import "./css/tabs.less"; // 引入表格 import Table from "./table.vue"; // 引入jq import $ from "jquery"; import { PlusOutlined } from "@ant-design/icons-vue" import { Tabs, TabPane, Dropdown } from "ant-design-vue" // 默认需要用到的属性 const state = reactive({ activeKey: 1, // 添加视图的下拉菜单 addVisible:false, // 假数据 tableViewArr: [ {title: "视图1", id: 1, tabsDropdown: false, isInput: false}, {title: "视图2", id: 2, tabsDropdown: false, isInput: false}, {title: "视图3", id: 3, tabsDropdown: false, isInput: false}, ], }); // 重命名方法 const rename = (item, index) => { state.tableViewArr[index].tabsDropdown = false; state.tableViewArr[index].isInput = true; nextTick(() => { $(".tablesInput-tab").focus(); }) }; // 文本框失去焦点事件 const inputBlur = (index) => { state.tableViewArr[index].isInput = false; }; // 下拉菜单的改变事件 const tabVisibleChange = (e, index) => { console.log(e); state.tableViewArr[index].tabsDropdown = e; }; // 添加视图的下拉菜单改变事件 const addDropdownChange = (e) =>{ console.log(e); state.addVisible = e; } const onEdit = (e) =>{ console.log(e); } console.log("哈哈") </script> <style scoped> </style>

What is expected?

期望修复

What is actually happening?

重复渲染

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions