@uiw/doc
Version:
UIW documentation website.
2 lines • 5.6 kB
JavaScript
(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6037],{4934:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=4934,e.exports=t},5301:(e,t,r)=>{"use strict";r.d(t,{Z:()=>g});var n=r(8573),o=r(6320),s=r(8563),i=r(7622),a=r(7937);const l={docinfo:"index_docinfo__3Vx8S",markdown:"index_markdown__hcQCp",markdownWrap:"index_markdownWrap__t60jR"};var c=r(4760);function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{path:t}=e,r=/^http/.test(t||"")?t:"https://github.com/uiwjs/uiw/blob/master/".concat(t);return(0,c.jsxs)("div",{className:l.docinfo,children:["\u72af\u4e86\u9519\u8bef\u8fd8\u662f\u60f3\u5bf9\u6587\u4ef6\u505a\u51fa\u8d21\u732e\uff1f",r&&(0,c.jsx)("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:"\u5728Github\u4e0a\u7f16\u8f91\u672c\u9875\uff01"}),(0,c.jsx)("br",{}),(0,c.jsx)("a",{href:"https://github.com/uiwjs/uiw/issues",target:"_blank",rel:"noopener noreferrer",children:"\u53cd\u9988\u5efa\u8bae"}),(0,c.jsx)(a.Divider,{type:"vertical"}),(0,c.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw/issues/new",children:"\u63d0\u4ea4bug"}),(0,c.jsx)(a.Divider,{type:"vertical"}),(0,c.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/uiwjs/uiw",children:"Github"}),(0,c.jsx)(a.Divider,{type:"vertical"}),(0,c.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt",children:"kkt"}),(0,c.jsx)(a.Divider,{type:"vertical"}),(0,c.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/kktjs/kkt-ssr",children:"@kkt/ssr"}),(0,c.jsx)(a.Divider,{type:"vertical"}),(0,c.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"http://uiw.gitee.io",children:"\u56fd\u5185\u955c\u50cf"})]})}const p=o.ZP.Preview,u=o.ZP.Code,h=o.ZP.Toolbar,m=e=>{var t,r;let{node:i,components:a,data:l,...d}=e;const m=(0,n.useRef)(null),{headings:g,headingsList:f,...b}=d;(0,n.useEffect)((()=>{if(m.current){const e=m.current.parentElement;e&&e.parentElement&&e.parentElement.replaceChild(m.current,e)}}),[m]);const j=null===i||void 0===i||null===(t=i.position)||void 0===t?void 0:t.start.line,x=null===i||void 0===i||null===(r=i.data)||void 0===r?void 0:r.meta,w=(0,s.Mx)(x)||String(j),k=a["".concat(w)];if(w&&"function"===typeof k){const e=l[w].value||"",t=(0,s.aE)(x||"");return(0,c.jsxs)(o.ZP,{ref:m,children:[(0,c.jsx)(p,{style:{background:t.bg||"transparent"},children:(0,c.jsx)(k,{})}),(0,c.jsx)(h,{text:e,children:t.title||"Example"}),(0,c.jsx)(u,{children:(0,c.jsx)("pre",{...b})})]})}return(0,c.jsx)("code",{...b})};function g(e){return(0,c.jsxs)(n.Fragment,{children:[(0,c.jsx)(i.Z,{className:l.markdownWrap,source:e.source||"",disableCopy:!0,wrapperElement:{"data-color-mode":"light"},components:{code:t=>(0,c.jsx)(m,{...e,...t})}}),(0,c.jsx)(d,{path:e.path})]})}},5066:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});const n={components:{},data:{},source:"Portal \u5165\u53e3\n===\n\n[](https://jaywcjlove.github.io/#/sponsor)\n[](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-portal/file/README.md)\n[](https://www.npmjs.com/package/@uiw/react-portal)\n[](https://npmjs.com/@uiw/react-portal)\n\n[`Portals`](https://reactjs.org/docs/portals.html#event-bubbling-through-portals) \u662f react 16 \u63d0\u4f9b\u7684\u5b98\u65b9\u89e3\u51b3\u65b9\u6848\uff0c\u4f7f\u5f97\u7ec4\u4ef6\u53ef\u4ee5\u8131\u79bb\u7236\u7ec4\u4ef6\u5c42\u7ea7\u6302\u8f7d\u5728 DOM \u6811\u7684\u4efb\u4f55\u4f4d\u7f6e\uff0c\u6211\u4eec\u5229\u7528\u8fd9\u4e2a\u65b9\u6cd5\uff0c\u53ef\u5c06\u6a21\u6001\u5bf9\u8bdd\u6846\u751f\u6210\u5230\u6839\u8282\u70b9\u7684\u5916\u9762\u3002 \n\n```jsx\nimport { Portal } from 'uiw';\n// or\nimport Portal from '@uiw/react-portal';\n```\n\n### \u57fa\u672c\u4f7f\u7528\n\n```jsx\nimport { Portal } from 'uiw';\n\n<Portal>\n \u6b64\u6587\u672c\u5728 document.body \u7684\u672b\u5c3e\u4f20\u9001\uff01\n</Portal>\n<Portal node={document && document.getElementById('dom-id')}>\n \u6b64\u6587\u672c\u5728\u663e\u793a\u5728 dom-id \u7684 dom \u5bf9\u8c61\u4e2d \n</Portal>\n\n```\n\n\u5207\u6362\u4e0d\u540c\u7684 `<Portal />`\n\n```jsx\n{isVisiable && <Portal>\u5207\u6362\u4e0d\u540c\u7684 Portal</Portal>}\n```\n\n## Props\n\n| \u53c2\u6570 | \u8bf4\u660e | \u7c7b\u578b | \u9ed8\u8ba4\u503c |\n|--------- |-------- |--------- |-------- |\n| container | \u6307\u5b9a\u5bb9\u5668\u8282\u70b9\u751f\u6210\uff0c\u670d\u52a1\u7aef\u6e32\u67d3\u9ed8\u8ba4\u4e3a `null` | any | `document.body` |\n| ~~visible~~ | ~~\u5f53\u503c\u4e3a `true` \u7684\u65f6\u5019\u624d\u4f1a\u521b\u5efa `createPortal`\uff0c\u53ef\u907f\u514d\u521d\u59cb\u5316\u521b\u5efa\u591a\u4f59\u7684 `dom` \u8282\u70b9\u6302\u8f7d~~ `@v4.9.0+`\x3c!--rehype:style=color:red--\x3e \u4e4b\u540e\u79fb\u9664\u4e86 | boolean | - |\n| ~~onChildrenMount~~ | ~~\u6e32\u67d3\u540e\u7684\u56de\u8c03\u51fd\u6570~~ `@v4.9.0+`\x3c!--rehype:style=color:red--\x3e \u4e4b\u540e\u79fb\u9664\u4e86 | () => void | - |",headings:[],headingsList:[]};var o=r(5301),s=r(4760);function i(){return(0,s.jsx)(o.Z,{...n,path:"https://github.com/uiwjs/uiw/tree/master/packages/react-portal/README.md"})}}}]);
//# sourceMappingURL=6037.2ff85e2d.chunk.js.map