fix(web-antdv-next): TableAction 和 AI 菜单使用 MenuItem 并修正 Dropdown trigger
parent
d3bcfd7177
commit
4f5caf1566
|
|
@ -11,7 +11,15 @@ import { IconifyIcon } from '@vben/icons';
|
|||
import { $t } from '@vben/locales';
|
||||
import { isBoolean, isFunction } from '@vben/utils';
|
||||
|
||||
import { Button, Dropdown, Menu, Popconfirm, Space, Tooltip } from 'antdv-next';
|
||||
import {
|
||||
Button,
|
||||
Dropdown,
|
||||
Menu,
|
||||
MenuItem,
|
||||
Popconfirm,
|
||||
Space,
|
||||
Tooltip,
|
||||
} from 'antdv-next';
|
||||
|
||||
const props = defineProps({
|
||||
actions: {
|
||||
|
|
@ -188,7 +196,7 @@ watch(
|
|||
</slot>
|
||||
<template #popupRender>
|
||||
<Menu>
|
||||
<Menu.Item
|
||||
<MenuItem
|
||||
v-for="(action, index) in getDropdownList"
|
||||
:key="index"
|
||||
:disabled="action.disabled"
|
||||
|
|
@ -225,7 +233,7 @@ watch(
|
|||
{{ action.label }}
|
||||
</div>
|
||||
</template>
|
||||
</Menu.Item>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</template>
|
||||
</Dropdown>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { ref } from 'vue';
|
|||
|
||||
import { IconifyIcon } from '@vben/icons';
|
||||
|
||||
import { Avatar, Button, Card, Dropdown, Menu } from 'antdv-next';
|
||||
import { Avatar, Button, Card, Dropdown, Menu, MenuItem } from 'antdv-next';
|
||||
|
||||
const props = defineProps({
|
||||
loading: {
|
||||
|
|
@ -103,18 +103,18 @@ async function handleTabsScroll() {
|
|||
</Button>
|
||||
<template #popupRender>
|
||||
<Menu>
|
||||
<Menu.Item @click="handleMoreClick(['delete', role])">
|
||||
<MenuItem @click="handleMoreClick(['delete', role])">
|
||||
<div class="flex items-center">
|
||||
<IconifyIcon icon="lucide:trash" color="red" />
|
||||
<span class="ml-2 text-red-500">删除</span>
|
||||
</div>
|
||||
</Menu.Item>
|
||||
<Menu.Item @click="handleMoreClick(['edit', role])">
|
||||
</MenuItem>
|
||||
<MenuItem @click="handleMoreClick(['edit', role])">
|
||||
<div class="flex items-center">
|
||||
<IconifyIcon icon="lucide:edit" color="#787878" />
|
||||
<span class="ml-2 text-primary">编辑</span>
|
||||
</div>
|
||||
</Menu.Item>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</template>
|
||||
</Dropdown>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import {
|
|||
Form,
|
||||
InputNumber,
|
||||
Menu,
|
||||
MenuItem,
|
||||
message,
|
||||
Tooltip,
|
||||
} from 'antdv-next';
|
||||
|
|
@ -207,7 +208,7 @@ onMounted(async () => {
|
|||
<div class="mb-2.5">
|
||||
<Dropdown
|
||||
v-if="modelData.list && modelData.list.length > 0"
|
||||
trigger="click"
|
||||
:trigger="['click']"
|
||||
>
|
||||
<div class="flex cursor-pointer items-center">
|
||||
<IconifyIcon icon="lucide:file-text" class="mr-1" />
|
||||
|
|
@ -222,7 +223,7 @@ onMounted(async () => {
|
|||
</div>
|
||||
<template #popupRender>
|
||||
<Menu>
|
||||
<Menu.Item
|
||||
<MenuItem
|
||||
v-for="(file, index) in modelData.list"
|
||||
:key="index"
|
||||
@click="selectFile(index)"
|
||||
|
|
@ -231,7 +232,7 @@ onMounted(async () => {
|
|||
<span v-if="file.segments" class="ml-1 text-sm text-gray-500">
|
||||
({{ file.segments.length }} 个分片)
|
||||
</span>
|
||||
</Menu.Item>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</template>
|
||||
</Dropdown>
|
||||
|
|
|
|||
Loading…
Reference in New Issue