build docs site
This commit is contained in:
parent
5623402aa8
commit
cb1136e795
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"cn.css": "static/css/cn.fb9dfd08.css",
|
||||
"cn.css.map": "static/css/cn.fb9dfd08.css.map",
|
||||
"cn.js": "static/js/cn.4ef15d56.js",
|
||||
"cn.js.map": "static/js/cn.4ef15d56.js.map",
|
||||
"cn.js": "static/js/cn.a9c8ef1f.js",
|
||||
"cn.js.map": "static/js/cn.a9c8ef1f.js.map",
|
||||
"index.css": "static/css/index.fb9dfd08.css",
|
||||
"index.css.map": "static/css/index.fb9dfd08.css.map",
|
||||
"index.js": "static/js/index.2000b09a.js",
|
||||
"index.js.map": "static/js/index.2000b09a.js.map",
|
||||
"index.js": "static/js/index.03f7ba6b.js",
|
||||
"index.js.map": "static/js/index.03f7ba6b.js.map",
|
||||
"static/js/0.f770eb0e.chunk.js": "static/js/0.f770eb0e.chunk.js",
|
||||
"static/js/0.f770eb0e.chunk.js.map": "static/js/0.f770eb0e.chunk.js.map",
|
||||
"static/js/1.0d025b66.chunk.js": "static/js/1.0d025b66.chunk.js",
|
||||
|
@ -33,8 +33,8 @@
|
|||
"static/js/19.50bd4319.chunk.js.map": "static/js/19.50bd4319.chunk.js.map",
|
||||
"static/js/2.9632a8c5.chunk.js": "static/js/2.9632a8c5.chunk.js",
|
||||
"static/js/2.9632a8c5.chunk.js.map": "static/js/2.9632a8c5.chunk.js.map",
|
||||
"static/js/20.83b21c96.chunk.js": "static/js/20.83b21c96.chunk.js",
|
||||
"static/js/20.83b21c96.chunk.js.map": "static/js/20.83b21c96.chunk.js.map",
|
||||
"static/js/20.579215c0.chunk.js": "static/js/20.579215c0.chunk.js",
|
||||
"static/js/20.579215c0.chunk.js.map": "static/js/20.579215c0.chunk.js.map",
|
||||
"static/js/21.fc4d0781.chunk.js": "static/js/21.fc4d0781.chunk.js",
|
||||
"static/js/21.fc4d0781.chunk.js.map": "static/js/21.fc4d0781.chunk.js.map",
|
||||
"static/js/22.d0e764c7.chunk.js": "static/js/22.d0e764c7.chunk.js",
|
||||
|
@ -55,8 +55,8 @@
|
|||
"static/js/29.18dc7b40.chunk.js.map": "static/js/29.18dc7b40.chunk.js.map",
|
||||
"static/js/3.1c5042fb.chunk.js": "static/js/3.1c5042fb.chunk.js",
|
||||
"static/js/3.1c5042fb.chunk.js.map": "static/js/3.1c5042fb.chunk.js.map",
|
||||
"static/js/4.1a938e71.chunk.js": "static/js/4.1a938e71.chunk.js",
|
||||
"static/js/4.1a938e71.chunk.js.map": "static/js/4.1a938e71.chunk.js.map",
|
||||
"static/js/4.74864855.chunk.js": "static/js/4.74864855.chunk.js",
|
||||
"static/js/4.74864855.chunk.js.map": "static/js/4.74864855.chunk.js.map",
|
||||
"static/js/5.f187d1bc.chunk.js": "static/js/5.f187d1bc.chunk.js",
|
||||
"static/js/5.f187d1bc.chunk.js.map": "static/js/5.f187d1bc.chunk.js.map",
|
||||
"static/js/6.62a98a69.chunk.js": "static/js/6.62a98a69.chunk.js",
|
||||
|
|
|
@ -1 +1 @@
|
|||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="shortcut icon" href="./favicon.ico"><link rel="stylesheet" href="./highlight/prism.css"><style>*{-webkit-tap-highlight-color:rgba(255,255,255,0);-moz-user-focus:none}</style><title>Omi - Next Front End Framework</title><link href="./static/css/cn.fb9dfd08.css" rel="stylesheet"></head><body><script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script><script src="./highlight/prism.js"></script><script src="./js/remarkable.min.js"></script><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="./static/js/cn.4ef15d56.js"></script></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="shortcut icon" href="./favicon.ico"><link rel="stylesheet" href="./highlight/prism.css"><style>*{-webkit-tap-highlight-color:rgba(255,255,255,0);-moz-user-focus:none}</style><title>Omi - Next Front End Framework</title><link href="./static/css/cn.fb9dfd08.css" rel="stylesheet"></head><body><script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script><script src="./highlight/prism.js"></script><script src="./js/remarkable.min.js"></script><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="./static/js/cn.a9c8ef1f.js"></script></body></html>
|
|
@ -1 +1 @@
|
|||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="shortcut icon" href="./favicon.ico"><link rel="stylesheet" href="./highlight/prism.css"><style>*{-webkit-tap-highlight-color:rgba(255,255,255,0);-moz-user-focus:none}</style><title>Omi - Next Front End Framework</title><link href="./static/css/index.fb9dfd08.css" rel="stylesheet"></head><body><script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script><script src="./highlight/prism.js"></script><script src="./js/remarkable.min.js"></script><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="./static/js/index.2000b09a.js"></script></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="shortcut icon" href="./favicon.ico"><link rel="stylesheet" href="./highlight/prism.css"><style>*{-webkit-tap-highlight-color:rgba(255,255,255,0);-moz-user-focus:none}</style><title>Omi - Next Front End Framework</title><link href="./static/css/index.fb9dfd08.css" rel="stylesheet"></head><body><script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script><script src="./highlight/prism.js"></script><script src="./js/remarkable.min.js"></script><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="./static/js/index.03f7ba6b.js"></script></body></html>
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,2 @@
|
|||
webpackJsonp([20],{48:function(e,n){e.exports="\n## Props\n\nTransfer data to sub elements through props, such as:\n\n```jsx\nimport { WeElement, define, render } from 'omi'\n\ndefine('my-element', class extends WeElement {\n render(props) {\n return (\n <h1>Hello, {props.name}!</h1>\n )\n }\n})\n```\n\nUsing element:\n\n```jsx\n<my-element name=\"world\"></my-element>\n```\n\nYou can also pass any type of data to props:\n\n```jsx\ndefine('my-element', class extends WeElement {\n render(props) {\n return (\n <h1>Hello, {props.myObj.name}!</h1>\n )\n }\n})\n```\n\nUsing element:\n\n```jsx\n<my-element myObj={{ name: 'world' }}></my-element>\n```\n\nYou can set the default value by the `static defaultProps` property\uff0cuse `static propTypes` to set the type:\n\n```jsx\ndefine('my-element', class extends WeElement {\n static defaultProps = {\n\t\tname: 'Omi',\n\t\tmyAge: 18\n\t}\n\n static propTypes = {\n\t\tname: String,\n\t\tmyAge: Number\n }\n \n render(props) {\n return (\n <h1>Hello, {props.name}! Age {props.myAge}</h1>\n )\n }\n})\n```\n\nSpecial attention should be paid to adding `static propTypes` if your custom elements want to be used directly in other frameworks or without frameworks. For example, it can be used directly in the body:\n\n```html\n<body>\n <my-element name=\"dntzhang\" my-age=\"20\"></my-element>\n</body>\n```"}});
|
||||
//# sourceMappingURL=20.579215c0.chunk.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../static/js/20.579215c0.chunk.js","docs/en/props.md"],"names":["webpackJsonp","48","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/20.579215c0.chunk.js","sourcesContent":["webpackJsonp([20],{\n\n/***/ 48:\n/***/ (function(module, exports) {\n\nmodule.exports = \"\\n## Props\\n\\nTransfer data to sub elements through props, such as:\\n\\n```jsx\\nimport { WeElement, define, render } from 'omi'\\n\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.name}!</h1>\\n )\\n }\\n})\\n```\\n\\nUsing element:\\n\\n```jsx\\n<my-element name=\\\"world\\\"></my-element>\\n```\\n\\nYou can also pass any type of data to props:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.myObj.name}!</h1>\\n )\\n }\\n})\\n```\\n\\nUsing element:\\n\\n```jsx\\n<my-element myObj={{ name: 'world' }}></my-element>\\n```\\n\\nYou can set the default value by the `static defaultProps` property,use `static propTypes` to set the type:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n static defaultProps = {\\n\\t\\tname: 'Omi',\\n\\t\\tmyAge: 18\\n\\t}\\n\\n static propTypes = {\\n\\t\\tname: String,\\n\\t\\tmyAge: Number\\n }\\n \\n render(props) {\\n return (\\n <h1>Hello, {props.name}! Age {props.myAge}</h1>\\n )\\n }\\n})\\n```\\n\\nSpecial attention should be paid to adding `static propTypes` if your custom elements want to be used directly in other frameworks or without frameworks. For example, it can be used directly in the body:\\n\\n```html\\n<body>\\n <my-element name=\\\"dntzhang\\\" my-age=\\\"20\\\"></my-element>\\n</body>\\n```\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/20.579215c0.chunk.js","module.exports = \"\\n## Props\\n\\nTransfer data to sub elements through props, such as:\\n\\n```jsx\\nimport { WeElement, define, render } from 'omi'\\n\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.name}!</h1>\\n )\\n }\\n})\\n```\\n\\nUsing element:\\n\\n```jsx\\n<my-element name=\\\"world\\\"></my-element>\\n```\\n\\nYou can also pass any type of data to props:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.myObj.name}!</h1>\\n )\\n }\\n})\\n```\\n\\nUsing element:\\n\\n```jsx\\n<my-element myObj={{ name: 'world' }}></my-element>\\n```\\n\\nYou can set the default value by the `static defaultProps` property,use `static propTypes` to set the type:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n static defaultProps = {\\n\\t\\tname: 'Omi',\\n\\t\\tmyAge: 18\\n\\t}\\n\\n static propTypes = {\\n\\t\\tname: String,\\n\\t\\tmyAge: Number\\n }\\n \\n render(props) {\\n return (\\n <h1>Hello, {props.name}! Age {props.myAge}</h1>\\n )\\n }\\n})\\n```\\n\\nSpecial attention should be paid to adding `static propTypes` if your custom elements want to be used directly in other frameworks or without frameworks. For example, it can be used directly in the body:\\n\\n```html\\n<body>\\n <my-element name=\\\"dntzhang\\\" my-age=\\\"20\\\"></my-element>\\n</body>\\n```\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/en/props.md\n// module id = 48\n// module chunks = 20"],"sourceRoot":""}
|
|
@ -1,2 +0,0 @@
|
|||
webpackJsonp([20],{48:function(n,e){n.exports="\n## Props\n\nTransfer data to sub elements through props, such as:\n\n```jsx\nimport { WeElement, define, render } from 'omi'\n\ndefine('my-element', class extends WeElement {\n render(props) {\n return (\n <h1>Hello, {props.name}!</h1>\n )\n }\n})\n```\n\nUsing element:\n\n```jsx\n<my-element name=\"world\"></my-element>\n```\n\nYou can also pass any type of data to props:\n\n```jsx\ndefine('my-element', class extends WeElement {\n render(props) {\n return (\n <h1>Hello, {props.myObj.name}!</h1>\n )\n }\n})\n```\n\nUsing element:\n\n```jsx\n<my-element myObj={{ name: 'world' }}></my-element>\n```\n\nYou can set the default value by the static default Props property:\n\n```jsx\ndefine('my-element', class extends WeElement {\n static defaultProps = {\n\t\tname: 'Omi',\n\t\tmyAge: 18\n\t}\n\n render(props) {\n return (\n <h1>Hello, {props.name}! Age {props.myAge}</h1>\n )\n }\n})\n```"}});
|
||||
//# sourceMappingURL=20.83b21c96.chunk.js.map
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"sources":["../static/js/20.83b21c96.chunk.js","docs/en/props.md"],"names":["webpackJsonp","48","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/20.83b21c96.chunk.js","sourcesContent":["webpackJsonp([20],{\n\n/***/ 48:\n/***/ (function(module, exports) {\n\nmodule.exports = \"\\n## Props\\n\\nTransfer data to sub elements through props, such as:\\n\\n```jsx\\nimport { WeElement, define, render } from 'omi'\\n\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.name}!</h1>\\n )\\n }\\n})\\n```\\n\\nUsing element:\\n\\n```jsx\\n<my-element name=\\\"world\\\"></my-element>\\n```\\n\\nYou can also pass any type of data to props:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.myObj.name}!</h1>\\n )\\n }\\n})\\n```\\n\\nUsing element:\\n\\n```jsx\\n<my-element myObj={{ name: 'world' }}></my-element>\\n```\\n\\nYou can set the default value by the static default Props property:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n static defaultProps = {\\n\\t\\tname: 'Omi',\\n\\t\\tmyAge: 18\\n\\t}\\n\\n render(props) {\\n return (\\n <h1>Hello, {props.name}! Age {props.myAge}</h1>\\n )\\n }\\n})\\n```\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/20.83b21c96.chunk.js","module.exports = \"\\n## Props\\n\\nTransfer data to sub elements through props, such as:\\n\\n```jsx\\nimport { WeElement, define, render } from 'omi'\\n\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.name}!</h1>\\n )\\n }\\n})\\n```\\n\\nUsing element:\\n\\n```jsx\\n<my-element name=\\\"world\\\"></my-element>\\n```\\n\\nYou can also pass any type of data to props:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.myObj.name}!</h1>\\n )\\n }\\n})\\n```\\n\\nUsing element:\\n\\n```jsx\\n<my-element myObj={{ name: 'world' }}></my-element>\\n```\\n\\nYou can set the default value by the static default Props property:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n static defaultProps = {\\n\\t\\tname: 'Omi',\\n\\t\\tmyAge: 18\\n\\t}\\n\\n render(props) {\\n return (\\n <h1>Hello, {props.name}! Age {props.myAge}</h1>\\n )\\n }\\n})\\n```\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/en/props.md\n// module id = 48\n// module chunks = 20"],"sourceRoot":""}
|
|
@ -1,2 +0,0 @@
|
|||
webpackJsonp([4],{64:function(n,e){n.exports="\n## Props\n\n\u901a\u8fc7 Props \u5411\u5b50\u7ec4\u4ef6\u4f20\u9012\u6570\u636e\uff0c\u6bd4\u5982\uff1a\n\n```jsx\nimport { WeElement, define, render } from 'omi'\n\ndefine('my-element', class extends WeElement {\n render(props) {\n return (\n <h1>Hello, {props.name}!</h1>\n )\n }\n})\n```\n\n\u4f7f\u7528\u5143\u7d20:\n\n```jsx\n<my-element name=\"world\"></my-element>\n```\n\n\u4f60\u4e5f\u53ef\u4ee5\u4f20\u4efb\u610f\u7c7b\u578b\u7684\u6570\u636e\u7ed9 props:\n\n```jsx\ndefine('my-element', class extends WeElement {\n render(props) {\n return (\n <h1>Hello, {props.myObj.name}!</h1>\n )\n }\n})\n```\n\n\u4f7f\u7528\u5143\u7d20:\n\n```jsx\n<my-element myObj={{ name: 'world' }}></my-element>\n```\n\n\u4f60\u53ef\u4ee5\u901a\u8fc7\u9759\u6001\u5c5e\u6027 `static defaultProps` \u6765\u8bbe\u7f6e\u9ed8\u8ba4\u503c:\n\n```jsx\ndefine('my-element', class extends WeElement {\n static defaultProps = {\n\t\tname: 'Omi',\n\t\tmyAge: 18\n\t}\n\n render(props) {\n return (\n <h1>Hello, {props.name}! Age {props.myAge}</h1>\n )\n }\n})\n```"}});
|
||||
//# sourceMappingURL=4.1a938e71.chunk.js.map
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"sources":["../static/js/4.1a938e71.chunk.js","docs/zh-cn/props.md"],"names":["webpackJsonp","64","module","exports"],"mappings":"AAAAA,cAAc,IAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/4.1a938e71.chunk.js","sourcesContent":["webpackJsonp([4],{\n\n/***/ 64:\n/***/ (function(module, exports) {\n\nmodule.exports = \"\\n## Props\\n\\n通过 Props 向子组件传递数据,比如:\\n\\n```jsx\\nimport { WeElement, define, render } from 'omi'\\n\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.name}!</h1>\\n )\\n }\\n})\\n```\\n\\n使用元素:\\n\\n```jsx\\n<my-element name=\\\"world\\\"></my-element>\\n```\\n\\n你也可以传任意类型的数据给 props:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.myObj.name}!</h1>\\n )\\n }\\n})\\n```\\n\\n使用元素:\\n\\n```jsx\\n<my-element myObj={{ name: 'world' }}></my-element>\\n```\\n\\n你可以通过静态属性 `static defaultProps` 来设置默认值:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n static defaultProps = {\\n\\t\\tname: 'Omi',\\n\\t\\tmyAge: 18\\n\\t}\\n\\n render(props) {\\n return (\\n <h1>Hello, {props.name}! Age {props.myAge}</h1>\\n )\\n }\\n})\\n```\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/4.1a938e71.chunk.js","module.exports = \"\\n## Props\\n\\n通过 Props 向子组件传递数据,比如:\\n\\n```jsx\\nimport { WeElement, define, render } from 'omi'\\n\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.name}!</h1>\\n )\\n }\\n})\\n```\\n\\n使用元素:\\n\\n```jsx\\n<my-element name=\\\"world\\\"></my-element>\\n```\\n\\n你也可以传任意类型的数据给 props:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.myObj.name}!</h1>\\n )\\n }\\n})\\n```\\n\\n使用元素:\\n\\n```jsx\\n<my-element myObj={{ name: 'world' }}></my-element>\\n```\\n\\n你可以通过静态属性 `static defaultProps` 来设置默认值:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n static defaultProps = {\\n\\t\\tname: 'Omi',\\n\\t\\tmyAge: 18\\n\\t}\\n\\n render(props) {\\n return (\\n <h1>Hello, {props.name}! Age {props.myAge}</h1>\\n )\\n }\\n})\\n```\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/props.md\n// module id = 64\n// module chunks = 4"],"sourceRoot":""}
|
|
@ -0,0 +1,2 @@
|
|||
webpackJsonp([4],{64:function(n,e){n.exports="\n## Props\n\n\u901a\u8fc7 Props \u5411\u5b50\u7ec4\u4ef6\u4f20\u9012\u6570\u636e\uff0c\u6bd4\u5982\uff1a\n\n```jsx\nimport { WeElement, define, render } from 'omi'\n\ndefine('my-element', class extends WeElement {\n render(props) {\n return (\n <h1>Hello, {props.name}!</h1>\n )\n }\n})\n```\n\n\u4f7f\u7528\u5143\u7d20:\n\n```jsx\n<my-element name=\"world\"></my-element>\n```\n\n\u4f60\u4e5f\u53ef\u4ee5\u4f20\u4efb\u610f\u7c7b\u578b\u7684\u6570\u636e\u7ed9 props:\n\n```jsx\ndefine('my-element', class extends WeElement {\n render(props) {\n return (\n <h1>Hello, {props.myObj.name}!</h1>\n )\n }\n})\n```\n\n\u4f7f\u7528\u5143\u7d20:\n\n```jsx\n<my-element myObj={{ name: 'world' }}></my-element>\n```\n\n\u4f60\u53ef\u4ee5\u901a\u8fc7\u9759\u6001\u5c5e\u6027 `static defaultProps` \u6765\u8bbe\u7f6e\u9ed8\u8ba4\u503c\uff0c\u4f7f\u7528 `static propTypes` \u6765\u8bbe\u7f6e\u7c7b\u578b:\n\n```jsx\ndefine('my-element', class extends WeElement {\n static defaultProps = {\n\t\tname: 'Omi',\n\t\tmyAge: 18\n }\n \n static propTypes = {\n\t\tname: String,\n\t\tmyAge: Number\n\t}\n\n render(props) {\n return (\n <h1>Hello, {props.name}! Age {props.myAge}</h1>\n )\n }\n})\n```\n\n\u9700\u8981\u7279\u522b\u6ce8\u610f\uff0c\u5982\u679c\u4f60\u7684\u81ea\u5b9a\u4e49\u5143\u7d20\u60f3\u8981\u76f4\u63a5\u5728\u5176\u4ed6\u6846\u67b6\u6216\u8005\u65e0\u6846\u67b6\u7684\u60c5\u51b5\u4e0b\u539f\u751f\u4f7f\u7528\uff0c\u8bf7\u4e00\u5b9a\u8981\u52a0\u4e0a `static propTypes` \u624d\u80fd\u751f\u6548\u3002\u6bd4\u5982\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u76f4\u63a5\u5728 body \u4e2d\u4f7f\u7528:\n\n```html\n<body>\n <my-element name=\"dntzhang\" my-age=\"20\"></my-element>\n</body>\n```"}});
|
||||
//# sourceMappingURL=4.74864855.chunk.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../static/js/4.74864855.chunk.js","docs/zh-cn/props.md"],"names":["webpackJsonp","64","module","exports"],"mappings":"AAAAA,cAAc,IAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/4.74864855.chunk.js","sourcesContent":["webpackJsonp([4],{\n\n/***/ 64:\n/***/ (function(module, exports) {\n\nmodule.exports = \"\\n## Props\\n\\n通过 Props 向子组件传递数据,比如:\\n\\n```jsx\\nimport { WeElement, define, render } from 'omi'\\n\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.name}!</h1>\\n )\\n }\\n})\\n```\\n\\n使用元素:\\n\\n```jsx\\n<my-element name=\\\"world\\\"></my-element>\\n```\\n\\n你也可以传任意类型的数据给 props:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.myObj.name}!</h1>\\n )\\n }\\n})\\n```\\n\\n使用元素:\\n\\n```jsx\\n<my-element myObj={{ name: 'world' }}></my-element>\\n```\\n\\n你可以通过静态属性 `static defaultProps` 来设置默认值,使用 `static propTypes` 来设置类型:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n static defaultProps = {\\n\\t\\tname: 'Omi',\\n\\t\\tmyAge: 18\\n }\\n \\n static propTypes = {\\n\\t\\tname: String,\\n\\t\\tmyAge: Number\\n\\t}\\n\\n render(props) {\\n return (\\n <h1>Hello, {props.name}! Age {props.myAge}</h1>\\n )\\n }\\n})\\n```\\n\\n需要特别注意,如果你的自定义元素想要直接在其他框架或者无框架的情况下原生使用,请一定要加上 `static propTypes` 才能生效。比如,这样就可以直接在 body 中使用:\\n\\n```html\\n<body>\\n <my-element name=\\\"dntzhang\\\" my-age=\\\"20\\\"></my-element>\\n</body>\\n```\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/4.74864855.chunk.js","module.exports = \"\\n## Props\\n\\n通过 Props 向子组件传递数据,比如:\\n\\n```jsx\\nimport { WeElement, define, render } from 'omi'\\n\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.name}!</h1>\\n )\\n }\\n})\\n```\\n\\n使用元素:\\n\\n```jsx\\n<my-element name=\\\"world\\\"></my-element>\\n```\\n\\n你也可以传任意类型的数据给 props:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n return (\\n <h1>Hello, {props.myObj.name}!</h1>\\n )\\n }\\n})\\n```\\n\\n使用元素:\\n\\n```jsx\\n<my-element myObj={{ name: 'world' }}></my-element>\\n```\\n\\n你可以通过静态属性 `static defaultProps` 来设置默认值,使用 `static propTypes` 来设置类型:\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n static defaultProps = {\\n\\t\\tname: 'Omi',\\n\\t\\tmyAge: 18\\n }\\n \\n static propTypes = {\\n\\t\\tname: String,\\n\\t\\tmyAge: Number\\n\\t}\\n\\n render(props) {\\n return (\\n <h1>Hello, {props.name}! Age {props.myAge}</h1>\\n )\\n }\\n})\\n```\\n\\n需要特别注意,如果你的自定义元素想要直接在其他框架或者无框架的情况下原生使用,请一定要加上 `static propTypes` 才能生效。比如,这样就可以直接在 body 中使用:\\n\\n```html\\n<body>\\n <my-element name=\\\"dntzhang\\\" my-age=\\\"20\\\"></my-element>\\n</body>\\n```\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/props.md\n// module id = 64\n// module chunks = 4"],"sourceRoot":""}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -63,6 +63,8 @@ define('my-element', class extends WeElement {
|
|||
|
||||
Special attention should be paid to adding `static propTypes` if your custom elements want to be used directly in other frameworks or without frameworks. For example, it can be used directly in the body:
|
||||
|
||||
```html
|
||||
<body>
|
||||
<my-element name="dntzhang" my-age="20"></my-element>
|
||||
</body>
|
||||
```
|
|
@ -63,6 +63,8 @@ define('my-element', class extends WeElement {
|
|||
|
||||
需要特别注意,如果你的自定义元素想要直接在其他框架或者无框架的情况下原生使用,请一定要加上 `static propTypes` 才能生效。比如,这样就可以直接在 body 中使用:
|
||||
|
||||
```html
|
||||
<body>
|
||||
<my-element name="dntzhang" my-age="20"></my-element>
|
||||
</body>
|
||||
```
|
Loading…
Reference in New Issue