-
Notifications
You must be signed in to change notification settings - Fork 0
/
4471-b046fec93c39ccc63f4e.js
1 lines (1 loc) · 6.51 KB
/
4471-b046fec93c39ccc63f4e.js
1
(self.webpackChunkzent_docs=self.webpackChunkzent_docs||[]).push([[4471],{14471:(n,a,s)=>{"use strict";s.r(a),s.d(a,{default:()=>f});var t=s(73450),e=s(27378),o=s(57318),c=s(67801),p=s(24246);function l(n,a){var s=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),s.push.apply(s,t)}return s}function r(n){for(var a=1;a<arguments.length;a++){var s=null!=arguments[a]?arguments[a]:{};a%2?l(Object(s),!0).forEach((function(a){(0,t.Z)(n,a,s[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(s)):l(Object(s)).forEach((function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(s,a))}))}return n}var i=function(){return(0,p.jsxs)("div",{children:[(0,p.jsx)(c.r,{href:"https://youzan.com",target:"_blank",children:"Index"}),(0,p.jsx)(c.r,{href:"https://youzan.com",disabled:!0,children:"Index"})]})};function d(n){return(0,p.jsx)(n.tag,r(r({},n.attributes),{},{dangerouslySetInnerHTML:{__html:n.html}}))}function u(n){return(0,p.jsx)(d,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function k(n){return(0,p.jsx)(d,{tag:"style",html:n.style})}function h(n,a){for(;n;)return n.offsetTop&&"static"!==getComputedStyle(n).position&&(a+=n.offsetTop),h(n.parentNode,a);return a}class m extends e.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{showCode:!1}),(0,t.Z)(this,"toggle",(()=>{this.setState({showCode:!this.state.showCode})}))}render(){var n=this.state.showCode,a=this.props,s=a.title,t=a.src,e=a.children;return(0,p.jsxs)("div",{className:"zandoc-react-demo",children:[(0,p.jsx)("div",{className:"zandoc-react-demo__preview",children:e}),(0,p.jsxs)("div",{className:"zandoc-react-demo__bottom",onClick:this.toggle,children:[(0,p.jsx)("div",{className:"zandoc-react-demo__title",children:(0,p.jsx)("p",{children:s||""})}),(0,p.jsx)("i",{className:"zenticon zenticon-caret-up zandoc-react-demo__toggle ".concat(n?"zandoc-react-demo__toggle-on":"zandoc-react-demo__toggle-off")})]}),n&&(0,p.jsx)("pre",{className:"zandoc-react-demo__code",children:(0,p.jsx)(d,{tag:"code",html:t,attributes:{className:"language-jsx"}})})]})}}class f extends e.Component{componentDidMount(){var n=location.hash;if(n){var a=document.querySelector('a[href="'.concat(n,'"]'));a&&(0,o.l)(document.documentElement,0,h(a,-9))}}render(){return e.createElement("div",{className:"zandoc-react-container"},e.createElement(k,{style:".zent-link {\n margin-left: 10px;\n }"}),e.createElement(u,{html:'<h2 class="anchor-heading"><a href="#link">¶</a><a href="javascript:void(0)" id="link" class="anchor-point"></a>Link</h2>\n<p>Link is a wrapper around native <code>a</code> tag, with an option to disable it.</p>\n<h3 class="anchor-heading"><a href="#demos">¶</a><a href="javascript:void(0)" id="demos" class="anchor-point"></a>Demos</h3>'}),e.createElement(m,{title:"Link",id:"Demo1basic",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Link</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Link</span></span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://youzan.com<span class="token punctuation">"</span></span> <span class="token attr-name">target</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>_blank<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token maybe-class-name">Index</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Link</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Link</span></span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://youzan.com<span class="token punctuation">"</span></span> <span class="token attr-name">disabled</span><span class="token punctuation">></span></span>\n <span class="token maybe-class-name">Index</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Link</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span><span class="token punctuation">,</span>\n mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},e.createElement(i)),e.createElement(u,{html:'<h3 class="anchor-heading"><a href="#api">¶</a><a href="javascript:void(0)" id="api" class="anchor-point"></a>API</h3>\n<p>Supports all props in <code><a></code>.</p>\n<table class="table">\n<thead>\n<tr>\n<th>Property</th>\n<th>Description</th>\n<th>Type</th>\n<th>Required</th>\n<th>Default</th>\n<th>Alternative</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>disabled</td>\n<td>Link is disabled</td>\n<td><code>boolean</code></td>\n<td>No</td>\n<td><code>false</code></td>\n<td><code>true</code></td>\n</tr>\n</tbody>\n</table>'}))}}},67801:(n,a,s)=>{"use strict";s.d(a,{r:()=>r});var t=s(59312),e=s(24246),o=s(60042),c=s.n(o),p=s(27378),l=s(1348),r=(0,p.forwardRef)((function(n,a){var s=(0,p.useContext)(l.d),o=n.className,r=n.disabled,d=void 0===r?s.value:r,u=n.onClick,k=(0,t._T)(n,["className","disabled","onClick"]);return(0,e.jsx)("a",(0,t.pi)({},k,{className:c()(o,"zent-link",{"zent-link__disabled":d}),ref:a,onClick:d?i:u,"data-zv":"9.12.16"}),void 0)}));function i(n){n.preventDefault(),n.stopPropagation()}r.displayName="Link"}}]);