@cainiaofe/cn-ui-m
Version:
31 lines (30 loc) • 1.31 kB
JavaScript
import React, { useMemo, useRef } from 'react';
import { CnCardItems, CnDemoPage } from "../../..";
export var 无底部工具条 = function () {
var ref = useRef(null);
var operateColumn = useMemo(function () { return ({
buttons: [
{
children: '编辑',
onClick: function (event, record, index) {
var _a;
console.log('编辑', event, record, index);
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.refreshAsync();
},
},
{
children: '详情',
onClick: function (event, record, index) {
var _a;
console.log('详情', event, record, index);
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.currentPageRefreshAsync();
},
},
],
}); }, []);
return (React.createElement(CnDemoPage, { title: "\u65E0\u5E95\u90E8\u5DE5\u5177\u6761" },
React.createElement(CnCardItems, { ref: ref, primaryKey: "id", operateColumn: operateColumn, requestConfig: {
url: 'https://mocks.alibaba-inc.com/mock/cnui-api-demo/cardsOpt',
} })));
};
export default { title: 'demo/CnCardItems' };