-
Notifications
You must be signed in to change notification settings - Fork 0
/
component---docs-components-menu-menu-en-mdx-2fea336deda1853979b0.js
2 lines (2 loc) · 6.53 KB
/
component---docs-components-menu-menu-en-mdx-2fea336deda1853979b0.js
1
2
(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{XTPN:function(e,t,n){"use strict";n.r(t),n.d(t,"_frontmatter",(function(){return c})),n.d(t,"default",(function(){return d}));var i=n("Fcif"),l=n("+I+c"),o=n("/FXl"),u=n("TjRS"),r=n("ZFoC"),s=n("3ql3"),a=n("DrYe"),m=n("7uBi"),c=(n("aD51"),{});void 0!==c&&c&&c===Object(c)&&Object.isExtensible(c)&&!c.hasOwnProperty("__filemeta")&&Object.defineProperty(c,"__filemeta",{configurable:!0,value:{name:"_frontmatter",filename:"docs/components/menu/menu.en.mdx"}});var p={_frontmatter:c},f=u.a;function d(e){var t,n=e.components,d=Object(l.a)(e,["components"]);return Object(o.b)(f,Object(i.a)({},p,d,{components:n,mdxType:"MDXLayout"}),Object(o.b)("h1",{id:"menu"},"Menu"),Object(o.b)("p",null,"Menu"),Object(o.b)("h2",{id:"examples"},"Examples"),Object(o.b)(r.c,{__position:0,__code:"() => {\n /**\n * 文件菜单栏\n */\n const fileMenuListItem = [\n { key: '1', leftText: 'New File', rightText: 'Ctrl+N' },\n { key: '2', leftText: 'New Window', rightText: 'Ctrl+Shift+N' },\n { splitLine: true },\n { key: '3', leftText: 'Open File...', rightText: 'Ctrl+O' },\n { key: '4', leftText: 'Open Folder...', rightText: 'Ctrl+K Ctrl+O' },\n {\n key: '5',\n leftText: 'Open Recent',\n menuListItems: [\n {\n key: '5-1',\n leftText: 'Reopen Closed Editor',\n rightText: 'Ctrl+Shift+T',\n menuListItems: [\n {\n key: '5-1-1',\n leftText: 'Reopen Closed Editor',\n rightText: 'Ctrl+Shift+T',\n },\n { splitLine: true },\n { key: '5-1-2', leftText: 'D:\\\\Documents\\\\Git\\\\Zain\\\\zainote' },\n {\n key: '5-1-3',\n leftText: 'D:\\\\Documents\\\\Git\\\\Zain\\\\zainote.github.io',\n },\n { key: '5-1-4', leftText: 'D:\\\\Documents\\\\Git\\\\Zain\\\\vscode' },\n { splitLine: true },\n { key: '5-1-5', leftText: 'More...', rightText: 'Ctrl+R' },\n { splitLine: true },\n { key: '5-1-6', leftText: 'Clear Recently Opened' },\n ],\n },\n { splitLine: true },\n { key: '5-2', leftText: 'D:\\\\Documents\\\\Git\\\\Zain\\\\zainote' },\n {\n key: '5-3',\n leftText: 'D:\\\\Documents\\\\Git\\\\Zain\\\\zainote.github.io',\n },\n { key: '5-4', leftText: 'D:\\\\Documents\\\\Git\\\\Zain\\\\vscode' },\n { splitLine: true },\n { key: '5-5', leftText: 'More...', rightText: 'Ctrl+R' },\n { splitLine: true },\n { key: '5-6', leftText: 'Clear Recently Opened' },\n ],\n },\n { splitLine: true },\n { key: '6', leftText: 'Save', rightText: 'Ctrl+S' },\n { key: '7', leftText: 'Save As...', rightText: 'Ctrl+Shift+S' },\n ]\n menuListItemReturn = menuListItemReturn => {\n console.log('zain>>>>>menuListItemReturn', menuListItemReturn)\n }\n return (\n <>\n <Menu\n menuListItems={fileMenuListItem}\n onClickMenuListItem={menuListItemReturn}\n >\n <Button variant=\"contained\" size=\"small\">\n Menu\n </Button>\n </Menu>\n </>\n )\n}",__scope:(t={props:d,DefaultLayout:u.a,Playground:r.c,Props:s.a,Button:a.Button,Menu:m.a,MenuListItem:m.b},t.DefaultLayout=u.a,t._frontmatter=c,t),language:"tsx",wrapper:"https://stackblitz.com/edit/zain-ui-menu?file=menuDemo.tsx|https://stackblitz.com/edit/zain-ui-menu?file=menuDemo.tsx",mdxType:"Playground"},(function(){return menuListItemReturn=function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){console.log("zain>>>>>menuListItemReturn",e)})),Object(o.b)(React.Fragment,null,Object(o.b)(m.a,{menuListItems:[{key:"1",leftText:"New File",rightText:"Ctrl+N"},{key:"2",leftText:"New Window",rightText:"Ctrl+Shift+N"},{splitLine:!0},{key:"3",leftText:"Open File...",rightText:"Ctrl+O"},{key:"4",leftText:"Open Folder...",rightText:"Ctrl+K Ctrl+O"},{key:"5",leftText:"Open Recent",menuListItems:[{key:"5-1",leftText:"Reopen Closed Editor",rightText:"Ctrl+Shift+T",menuListItems:[{key:"5-1-1",leftText:"Reopen Closed Editor",rightText:"Ctrl+Shift+T"},{splitLine:!0},{key:"5-1-2",leftText:"D:\\Documents\\Git\\Zain\\zainote"},{key:"5-1-3",leftText:"D:\\Documents\\Git\\Zain\\zainote.github.io"},{key:"5-1-4",leftText:"D:\\Documents\\Git\\Zain\\vscode"},{splitLine:!0},{key:"5-1-5",leftText:"More...",rightText:"Ctrl+R"},{splitLine:!0},{key:"5-1-6",leftText:"Clear Recently Opened"}]},{splitLine:!0},{key:"5-2",leftText:"D:\\Documents\\Git\\Zain\\zainote"},{key:"5-3",leftText:"D:\\Documents\\Git\\Zain\\zainote.github.io"},{key:"5-4",leftText:"D:\\Documents\\Git\\Zain\\vscode"},{splitLine:!0},{key:"5-5",leftText:"More...",rightText:"Ctrl+R"},{splitLine:!0},{key:"5-6",leftText:"Clear Recently Opened"}]},{splitLine:!0},{key:"6",leftText:"Save",rightText:"Ctrl+S"},{key:"7",leftText:"Save As...",rightText:"Ctrl+Shift+S"}],onClickMenuListItem:menuListItemReturn,mdxType:"Menu"},Object(o.b)(a.Button,{variant:"contained",size:"small",mdxType:"Button"},"Menu")))})),Object(o.b)("h2",{id:"api"},"API"),Object(o.b)(s.a,{propsItems:[{name:"className",type:"string",default:"",description:"组件根元素新增 className"},{name:"children",type:"React.ReactNode",default:"",description:"触发显示菜单列表的元素,通过子元素传递"},{name:"open",type:"boolean | undefined",default:"true",description:"是否可以显示菜单列表组件"},{name:"menuListItems",type:"MenuListItem[]",default:"",description:"菜单列表项具体内容"},{name:"placement",type:"MenuListPlacementEnum",default:"MenuListPlacementEnum.BOTTOM_START",description:"菜单列表放置位置"},{name:"openMenuMouseEvent",type:"OpenMenuMouseEventEnum",default:"OpenMenuMouseEventEnum.ON_MOUSE_DOWN",description:"打开菜单列表的鼠标事件"},{name:"container",type:"Element | React.Component | (() => React.ReactInstance)",default:"",description:"菜单列表渲染到指定 DOM 元素内"},{name:"onMenuListOpenClose",type:"(open: boolean | undefined) => void",default:"",description:"监听菜单列表(打开/关闭)"},{name:"onClickMenuListItem",type:"(menuListItemReturn: MenuListItem) => void",default:"",description:"监听单击每个菜单项"}],mdxType:"Props"}))}void 0!==d&&d&&d===Object(d)&&Object.isExtensible(d)&&!d.hasOwnProperty("__filemeta")&&Object.defineProperty(d,"__filemeta",{configurable:!0,value:{name:"MDXContent",filename:"docs/components/menu/menu.en.mdx"}}),d.isMDXComponent=!0}}]);
//# sourceMappingURL=component---docs-components-menu-menu-en-mdx-2fea336deda1853979b0.js.map