Skip to content

Commit

Permalink
perf: 菜单增加操作列
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Dec 14, 2022
1 parent 871f852 commit 4b328ce
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 20 deletions.
8 changes: 8 additions & 0 deletions docs/zh/api/common-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ component:{
type:"", //a-button,el-button的类型
style:{},
disabled:false,
tooltip:{ //tooltip的属性
title //a-tooltip 提示内容
slots:{ //tooltip插槽
default(){
return "n-tooltip的提示内容"
}
}
},
...// a-button,el-button的其他配置
},
}
Expand Down
3 changes: 2 additions & 1 deletion packages/fast-crud/src/components/basic/fs-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,11 @@ export default defineComponent({
const computeTooltipProps = computed(() => {
return _.omit(props.tooltip, "slots");
});
const triggerSlotName = ui.tooltip.trigger;
return () => {
const slots = {
...props.tooltip?.slots,
default: renderBtn
[triggerSlotName]: renderBtn
};
return <tooltipComp {...computeTooltipProps.value}>{slots}</tooltipComp>;
};
Expand Down
8 changes: 4 additions & 4 deletions packages/fast-crud/src/components/crud/fs-row-handle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,12 @@ export default defineComponent({
.fs-row-handle {
// display: flex ; // 这里不能用flex,否则会破坏align:center配置
flex-wrap: wrap;
.row-handle-btn {
.el-button + .el-button {
margin-left: 2px;
}
& > * {
margin: 2px;
display: inline-flex;
&.el-button {
margin: 2px;
}
}
.fs-row-handle-dropdown-item {
display: flex;
Expand Down
26 changes: 13 additions & 13 deletions packages/ui/ui-interface/src/ui-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface FormCI {
inlineLayout: Object;
resetWrap: Function;
validateWrap: Function;
transformValidateErrors: (e:Error) => { [key: string]: any }
transformValidateErrors: (e: Error) => { [key: string]: any };
}
export interface SelectCI extends CI {
modelValue;
Expand Down Expand Up @@ -53,16 +53,16 @@ export interface DialogCI extends CI {
footer: Function;
buildOnClosedBind: Function;
customClass;
titleSlotName?:string;
buildWidthBind?:any;
buildInitBind?:any;
titleSlotName?: string;
buildWidthBind?: any;
buildInitBind?: any;
}

export interface DrawerCI extends CI {
visible;
customClass;
width;
hasContentWrap?:string;
hasContentWrap?: string;
}

export interface TableColumnCI extends CI {
Expand All @@ -73,7 +73,7 @@ export interface TableColumnCI extends CI {
}

export interface TableCI extends CI {
defaultRowKey?: (string|((rowData:any)=>any));
defaultRowKey?: string | ((rowData: any) => any);
data;
fixedHeaderNeedComputeBodyHeight: boolean;
headerDomSelector: string; //用于计算高度
Expand Down Expand Up @@ -133,8 +133,8 @@ export interface MessageCI extends CI {
error;
warn;
info;
instance:any;
getInstance?:any
instance: any;
getInstance?: any;
}

export type MessageBoxContextType = {
Expand All @@ -148,17 +148,17 @@ export type MessageBoxOpenType = (context: MessageBoxContextType) => Promise<voi
export interface MessageBoxCI extends CI {
open: MessageBoxOpenType;
confirm: MessageBoxOpenType;
instance:any;
getInstance?:any
instance: any;
getInstance?: any;
}
export interface NotificationCI extends CI {
open;
success;
error;
warn;
info;
instance:any;
getInstance?:any
instance: any;
getInstance?: any;
}
export interface IconCI extends CI {
isComponent: boolean;
Expand Down Expand Up @@ -190,7 +190,7 @@ export interface FormWrapperCI extends CI {
buildWidthBind: (is, width: any) => {};
buildInitBind: (is) => {};
buildInnerBind: (opts: any) => {};
hasContentWrap?: (is) => string|undefined;
hasContentWrap?: (is) => string | undefined;
}
export interface DatePickerCI extends CI {
modelValue;
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/ui-naive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"@fast-crud/ui-interface": "^1.6.1"
},
"peerDependencies": {
"@ant-design/icons-vue": "^6.0.1",
"@fast-crud/fast-crud": "^2.*"
},
"devDependencies": {
"@ant-design/icons-vue": "^6.0.1",
"@rollup/plugin-strip": "^3.0.1",
"@rollup/plugin-typescript": "^10.0.1",
"@typescript-eslint/eslint-plugin": "^5.46.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
DownOutlined,
EyeOutlined,
QuestionCircleOutlined
// @ts-ignore
} from "@ant-design/icons-vue";

const icons = {
Expand Down Expand Up @@ -64,7 +65,7 @@ const icons = {
QuestionCircleOutlined
};
export default function (app) {
for (let key in icons) {
for (const key in icons) {
app.component(key, icons[key]);
}
}

0 comments on commit 4b328ce

Please sign in to comment.