docs: update docs site

This commit is contained in:
dntzhang 2019-10-28 09:26:36 +08:00
parent 84f5fcab45
commit e6f38b2677
45 changed files with 61 additions and 60 deletions

View File

@ -1,24 +1,24 @@
{
"cn.css": "static/css/cn.4dd07f49.css",
"cn.css.map": "static/css/cn.4dd07f49.css.map",
"cn.js": "static/js/cn.b4b89379.js",
"cn.js.map": "static/js/cn.b4b89379.js.map",
"cn.js": "static/js/cn.a3027e17.js",
"cn.js.map": "static/js/cn.a3027e17.js.map",
"index.css": "static/css/index.4dd07f49.css",
"index.css.map": "static/css/index.4dd07f49.css.map",
"index.js": "static/js/index.1f494a06.js",
"index.js.map": "static/js/index.1f494a06.js.map",
"static/js/0.fa4729fc.chunk.js": "static/js/0.fa4729fc.chunk.js",
"static/js/0.fa4729fc.chunk.js.map": "static/js/0.fa4729fc.chunk.js.map",
"static/js/1.21321ba9.chunk.js": "static/js/1.21321ba9.chunk.js",
"static/js/1.21321ba9.chunk.js.map": "static/js/1.21321ba9.chunk.js.map",
"index.js": "static/js/index.1911ef3f.js",
"index.js.map": "static/js/index.1911ef3f.js.map",
"static/js/0.8b145f4a.chunk.js": "static/js/0.8b145f4a.chunk.js",
"static/js/0.8b145f4a.chunk.js.map": "static/js/0.8b145f4a.chunk.js.map",
"static/js/1.41961270.chunk.js": "static/js/1.41961270.chunk.js",
"static/js/1.41961270.chunk.js.map": "static/js/1.41961270.chunk.js.map",
"static/js/10.29b8e7af.chunk.js": "static/js/10.29b8e7af.chunk.js",
"static/js/10.29b8e7af.chunk.js.map": "static/js/10.29b8e7af.chunk.js.map",
"static/js/11.1b7cb28d.chunk.js": "static/js/11.1b7cb28d.chunk.js",
"static/js/11.1b7cb28d.chunk.js.map": "static/js/11.1b7cb28d.chunk.js.map",
"static/js/12.7a88317e.chunk.js": "static/js/12.7a88317e.chunk.js",
"static/js/12.7a88317e.chunk.js.map": "static/js/12.7a88317e.chunk.js.map",
"static/js/13.187d2ee6.chunk.js": "static/js/13.187d2ee6.chunk.js",
"static/js/13.187d2ee6.chunk.js.map": "static/js/13.187d2ee6.chunk.js.map",
"static/js/13.2918b297.chunk.js": "static/js/13.2918b297.chunk.js",
"static/js/13.2918b297.chunk.js.map": "static/js/13.2918b297.chunk.js.map",
"static/js/14.8e15502a.chunk.js": "static/js/14.8e15502a.chunk.js",
"static/js/14.8e15502a.chunk.js.map": "static/js/14.8e15502a.chunk.js.map",
"static/js/15.29ed0917.chunk.js": "static/js/15.29ed0917.chunk.js",
@ -27,16 +27,16 @@
"static/js/16.c061a335.chunk.js.map": "static/js/16.c061a335.chunk.js.map",
"static/js/17.98ec3c54.chunk.js": "static/js/17.98ec3c54.chunk.js",
"static/js/17.98ec3c54.chunk.js.map": "static/js/17.98ec3c54.chunk.js.map",
"static/js/18.a945affa.chunk.js": "static/js/18.a945affa.chunk.js",
"static/js/18.a945affa.chunk.js.map": "static/js/18.a945affa.chunk.js.map",
"static/js/19.3afd506f.chunk.js": "static/js/19.3afd506f.chunk.js",
"static/js/19.3afd506f.chunk.js.map": "static/js/19.3afd506f.chunk.js.map",
"static/js/18.c2baaa95.chunk.js": "static/js/18.c2baaa95.chunk.js",
"static/js/18.c2baaa95.chunk.js.map": "static/js/18.c2baaa95.chunk.js.map",
"static/js/19.b2d3b23b.chunk.js": "static/js/19.b2d3b23b.chunk.js",
"static/js/19.b2d3b23b.chunk.js.map": "static/js/19.b2d3b23b.chunk.js.map",
"static/js/2.56c4128f.chunk.js": "static/js/2.56c4128f.chunk.js",
"static/js/2.56c4128f.chunk.js.map": "static/js/2.56c4128f.chunk.js.map",
"static/js/20.74ce16c4.chunk.js": "static/js/20.74ce16c4.chunk.js",
"static/js/20.74ce16c4.chunk.js.map": "static/js/20.74ce16c4.chunk.js.map",
"static/js/21.f0bfd8f6.chunk.js": "static/js/21.f0bfd8f6.chunk.js",
"static/js/21.f0bfd8f6.chunk.js.map": "static/js/21.f0bfd8f6.chunk.js.map",
"static/js/21.f32e4629.chunk.js": "static/js/21.f32e4629.chunk.js",
"static/js/21.f32e4629.chunk.js.map": "static/js/21.f32e4629.chunk.js.map",
"static/js/22.507213f4.chunk.js": "static/js/22.507213f4.chunk.js",
"static/js/22.507213f4.chunk.js.map": "static/js/22.507213f4.chunk.js.map",
"static/js/23.0d3df93c.chunk.js": "static/js/23.0d3df93c.chunk.js",
@ -45,16 +45,16 @@
"static/js/24.6b1e5b87.chunk.js.map": "static/js/24.6b1e5b87.chunk.js.map",
"static/js/25.1a80d358.chunk.js": "static/js/25.1a80d358.chunk.js",
"static/js/25.1a80d358.chunk.js.map": "static/js/25.1a80d358.chunk.js.map",
"static/js/26.ee99a6d0.chunk.js": "static/js/26.ee99a6d0.chunk.js",
"static/js/26.ee99a6d0.chunk.js.map": "static/js/26.ee99a6d0.chunk.js.map",
"static/js/26.7e140343.chunk.js": "static/js/26.7e140343.chunk.js",
"static/js/26.7e140343.chunk.js.map": "static/js/26.7e140343.chunk.js.map",
"static/js/27.1d911d63.chunk.js": "static/js/27.1d911d63.chunk.js",
"static/js/27.1d911d63.chunk.js.map": "static/js/27.1d911d63.chunk.js.map",
"static/js/28.b709e42a.chunk.js": "static/js/28.b709e42a.chunk.js",
"static/js/28.b709e42a.chunk.js.map": "static/js/28.b709e42a.chunk.js.map",
"static/js/29.bdde5e22.chunk.js": "static/js/29.bdde5e22.chunk.js",
"static/js/29.bdde5e22.chunk.js.map": "static/js/29.bdde5e22.chunk.js.map",
"static/js/3.95dc6d3d.chunk.js": "static/js/3.95dc6d3d.chunk.js",
"static/js/3.95dc6d3d.chunk.js.map": "static/js/3.95dc6d3d.chunk.js.map",
"static/js/29.4ab54b26.chunk.js": "static/js/29.4ab54b26.chunk.js",
"static/js/29.4ab54b26.chunk.js.map": "static/js/29.4ab54b26.chunk.js.map",
"static/js/3.5c65f2d1.chunk.js": "static/js/3.5c65f2d1.chunk.js",
"static/js/3.5c65f2d1.chunk.js.map": "static/js/3.5c65f2d1.chunk.js.map",
"static/js/30.aa3bcd07.chunk.js": "static/js/30.aa3bcd07.chunk.js",
"static/js/30.aa3bcd07.chunk.js.map": "static/js/30.aa3bcd07.chunk.js.map",
"static/js/31.2d60b0ad.chunk.js": "static/js/31.2d60b0ad.chunk.js",

View File

@ -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 - Front End Cross-Frameworks Framework</title><link href="./static/css/cn.4dd07f49.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.b4b89379.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 - Front End Cross-Frameworks Framework</title><link href="./static/css/cn.4dd07f49.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.a3027e17.js"></script></body></html>

View File

@ -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 - Front End Cross-Frameworks Framework</title><link href="./static/css/index.4dd07f49.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.1f494a06.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 - Front End Cross-Frameworks Framework</title><link href="./static/css/index.4dd07f49.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.1911ef3f.js"></script></body></html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
webpackJsonp([0],{72:function(n,t){n.exports="\n## Update\n\n`update` \u65b9\u6cd5\u662f\u5185\u7f6e\u7684\u91cd\u8981\u6838\u5fc3\u65b9\u6cd5\uff0c\u7528\u4e8e\u66f4\u65b0\u7ec4\u4ef6\u81ea\u8eab\u3002\u6bd4\u5982:\n\n```js\nthis.update()\n```\n\n\u4e5f\u53ef\u4ee5\u4f20\u9012\u53c2\u6570\uff0c\u51b3\u5b9a\u662f\u5426\u5728 html \u6a21\u5f0f\u4e0b\u5ffd\u7565 attributes:\n\n```js\nthis.update(true)\n```\n\n\u4e3e\u4e2a\u573a\u666f\uff0c\u6bd4\u5982\u70b9\u51fb\u5f39\u51fa\u5c42\u7684 mask \u5173\u95ed\u5f39\u51fa\uff0c\u5728 react \u4e2d\u9700\u8981\u4f20\u9012\u7ed9\u7236\u7ec4\u4ef6\uff0c\u8ba9\u7236\u7ec4\u4ef6\u66f4\u65b0\uff0c\u800c Omi \u63a8\u5d07\u81ea\u66f4\u65b0\uff0c\u8fd9\u6837 diff \u7684\u533a\u57df\u66f4\u5c0f\u3002\n\n```js\nonMaskClick = ()=> {\n //\u4fee\u6539 props\n this.props.show = false\n //\u9632\u6b62\u7236\u7ec4\u4ef6\u66f4\u65b0 diff \u4e0d\u51fa\u7ed3\u679c\n this.prevProps.show = false\n //\u66f4\u65b0\uff0c\u5e76\u4e14\u5728 html \u6a21\u5f0f\u4e0b\u5ffd\u7565 attributes\n this.update(true)\n //\u89e6\u53d1\u4e8b\u4ef6\uff0c\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u66f4\u6539\u5916\u90e8\u7684\u72b6\u6001\u53d8\u91cf\u6765\u4fdd\u6301\u4e00\u81f4\u6027\uff0c\u4f46\u662f\u5916\u9762\u7684\u7ec4\u4ef6\u4e0d\u7528\u518d\u66f4\u65b0\n this.fire('close')\n}\n```\n\n### UpdateSelf\n\n![](https://github.com/Tencent/omi/raw/master/assets/update.png)\n\n`updateSelf` \u65b9\u6cd5\u4e0d\u4f1a\u66f4\u65b0\u5b50\u7ec4\u4ef6\u3002"}});
//# sourceMappingURL=0.8b145f4a.chunk.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../static/js/0.8b145f4a.chunk.js","docs/zh-cn/update.md"],"names":["webpackJsonp","72","module","exports"],"mappings":"AAAAA,cAAc,IAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAOC,QAAU","file":"static/js/0.8b145f4a.chunk.js","sourcesContent":["webpackJsonp([0],{\n\n/***/ 72:\n/***/ (function(module, exports) {\n\nmodule.exports = \"\\n## Update\\n\\n`update` 方法是内置的重要核心方法,用于更新组件自身。比如:\\n\\n```js\\nthis.update()\\n```\\n\\n也可以传递参数决定是否在 html 模式下忽略 attributes:\\n\\n```js\\nthis.update(true)\\n```\\n\\n举个场景比如点击弹出层的 mask 关闭弹出,在 react 中需要传递给父组件,让父组件更新,而 Omi 推崇自更新,这样 diff 的区域更小。\\n\\n```js\\nonMaskClick = ()=> {\\n //修改 props\\n this.props.show = false\\n //防止父组件更新 diff 不出结果\\n this.prevProps.show = false\\n //更新,并且在 html 模式下忽略 attributes\\n this.update(true)\\n //触发事件,可以通过这个更改外部的状态变量来保持一致性,但是外面的组件不用再更新\\n this.fire('close')\\n}\\n```\\n\\n### UpdateSelf\\n\\n![](https://github.com/Tencent/omi/raw/master/assets/update.png)\\n\\n`updateSelf` 方法不会更新子组件。\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/0.8b145f4a.chunk.js","module.exports = \"\\n## Update\\n\\n`update` 方法是内置的重要核心方法,用于更新组件自身。比如:\\n\\n```js\\nthis.update()\\n```\\n\\n也可以传递参数决定是否在 html 模式下忽略 attributes:\\n\\n```js\\nthis.update(true)\\n```\\n\\n举个场景比如点击弹出层的 mask 关闭弹出,在 react 中需要传递给父组件,让父组件更新,而 Omi 推崇自更新,这样 diff 的区域更小。\\n\\n```js\\nonMaskClick = ()=> {\\n //修改 props\\n this.props.show = false\\n //防止父组件更新 diff 不出结果\\n this.prevProps.show = false\\n //更新,并且在 html 模式下忽略 attributes\\n this.update(true)\\n //触发事件,可以通过这个更改外部的状态变量来保持一致性,但是外面的组件不用再更新\\n this.fire('close')\\n}\\n```\\n\\n### UpdateSelf\\n\\n![](https://github.com/Tencent/omi/raw/master/assets/update.png)\\n\\n`updateSelf` 方法不会更新子组件。\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/update.md\n// module id = 72\n// module chunks = 0"],"sourceRoot":""}

View File

@ -1,2 +0,0 @@
webpackJsonp([0],{72:function(n,t){n.exports="\n## Update\n\n`update` \u65b9\u6cd5\u662f\u5185\u7f6e\u7684\u91cd\u8981\u6838\u5fc3\u65b9\u6cd5\uff0c\u7528\u4e8e\u66f4\u65b0\u7ec4\u4ef6\u81ea\u8eab\u3002\u6bd4\u5982:\n\n```js\nthis.update()\n```\n\n\u4e5f\u53ef\u4ee5\u4f20\u9012\u53c2\u6570\uff0c\u51b3\u5b9a\u662f\u5426\u5728 html \u6a21\u5f0f\u4e0b\u5ffd\u7565 attributes\uff0c\u5f3a\u884c\u66f4\u65b0:\n\n```js\nthis.update(true)\n```\n\n\u4e3e\u4e2a\u573a\u666f\uff0c\u6bd4\u5982\u70b9\u51fb\u5f39\u51fa\u5c42\u7684 mask \u5173\u95ed\u5f39\u51fa\uff0c\u5728 react \u4e2d\u9700\u8981\u4f20\u9012\u7ed9\u7236\u7ec4\u4ef6\uff0c\u8ba9\u7236\u7ec4\u4ef6\u66f4\u65b0\uff0c\u800c Omi \u63a8\u5d07\u81ea\u66f4\u65b0\uff0c\u8fd9\u6837 diff \u7684\u533a\u57df\u66f4\u5c0f\u3002\n\n```js\nonMaskClick = ()=> {\n //\u4fee\u6539 props\n this.props.show = false\n //\u9632\u6b62\u7236\u7ec4\u4ef6\u66f4\u65b0 diff \u4e0d\u51fa\u7ed3\u679c\n this.prevProps.show = false\n //\u66f4\u65b0\uff0c\u5e76\u4e14\u5728 html \u6a21\u5f0f\u4e0b\u5ffd\u7565 attributes\n this.update(true)\n //\u89e6\u53d1\u4e8b\u4ef6\uff0c\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u66f4\u6539\u5916\u90e8\u7684\u72b6\u6001\u53d8\u91cf\u6765\u4fdd\u6301\u4e00\u81f4\u6027\uff0c\u4f46\u662f\u5916\u9762\u7684\u7ec4\u4ef6\u4e0d\u7528\u518d\u66f4\u65b0\n this.fire('close')\n}\n```\n\n### UpdateSelf\n\n![](https://github.com/Tencent/omi/raw/master/assets/update.png)\n\n`updateSelf` \u65b9\u6cd5\u4e0d\u4f1a\u66f4\u65b0\u5b50\u7ec4\u4ef6\u3002"}});
//# sourceMappingURL=0.fa4729fc.chunk.js.map

View File

@ -1 +0,0 @@
{"version":3,"sources":["../static/js/0.fa4729fc.chunk.js","docs/zh-cn/update.md"],"names":["webpackJsonp","72","module","exports"],"mappings":"AAAAA,cAAc,IAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAOC,QAAU","file":"static/js/0.fa4729fc.chunk.js","sourcesContent":["webpackJsonp([0],{\n\n/***/ 72:\n/***/ (function(module, exports) {\n\nmodule.exports = \"\\n## Update\\n\\n`update` 方法是内置的重要核心方法,用于更新组件自身。比如:\\n\\n```js\\nthis.update()\\n```\\n\\n也可以传递参数决定是否在 html 模式下忽略 attributes强行更新:\\n\\n```js\\nthis.update(true)\\n```\\n\\n举个场景比如点击弹出层的 mask 关闭弹出,在 react 中需要传递给父组件,让父组件更新,而 Omi 推崇自更新,这样 diff 的区域更小。\\n\\n```js\\nonMaskClick = ()=> {\\n //修改 props\\n this.props.show = false\\n //防止父组件更新 diff 不出结果\\n this.prevProps.show = false\\n //更新,并且在 html 模式下忽略 attributes\\n this.update(true)\\n //触发事件,可以通过这个更改外部的状态变量来保持一致性,但是外面的组件不用再更新\\n this.fire('close')\\n}\\n```\\n\\n### UpdateSelf\\n\\n![](https://github.com/Tencent/omi/raw/master/assets/update.png)\\n\\n`updateSelf` 方法不会更新子组件。\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/0.fa4729fc.chunk.js","module.exports = \"\\n## Update\\n\\n`update` 方法是内置的重要核心方法,用于更新组件自身。比如:\\n\\n```js\\nthis.update()\\n```\\n\\n也可以传递参数决定是否在 html 模式下忽略 attributes强行更新:\\n\\n```js\\nthis.update(true)\\n```\\n\\n举个场景比如点击弹出层的 mask 关闭弹出,在 react 中需要传递给父组件,让父组件更新,而 Omi 推崇自更新,这样 diff 的区域更小。\\n\\n```js\\nonMaskClick = ()=> {\\n //修改 props\\n this.props.show = false\\n //防止父组件更新 diff 不出结果\\n this.prevProps.show = false\\n //更新,并且在 html 模式下忽略 attributes\\n this.update(true)\\n //触发事件,可以通过这个更改外部的状态变量来保持一致性,但是外面的组件不用再更新\\n this.fire('close')\\n}\\n```\\n\\n### UpdateSelf\\n\\n![](https://github.com/Tencent/omi/raw/master/assets/update.png)\\n\\n`updateSelf` 方法不会更新子组件。\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/update.md\n// module id = 72\n// module chunks = 0"],"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

View File

@ -1,2 +1,2 @@
webpackJsonp([13],{59:function(n,i){n.exports='## \u5b89\u88c5 \n\n\u76f4\u63a5\u4e0b\u8f7d\u5e76\u7528 `<script>` \u6807\u7b7e\u5f15\u5165\uff0cOmi \u4f1a\u88ab\u6ce8\u518c\u4e3a\u4e00\u4e2a\u5168\u5c40\u53d8\u91cf\u3002\n\n* [Omi \u5f00\u53d1\u7248\u672c](https://unpkg.com/omi@latest/dist/omi.js)\n* [Omi \u538b\u7f29\u7248\u672c](https://unpkg.com/omi@latest/dist/omi.min.js)\n\n\u4e5f\u53ef\u4ee5\u901a\u8fc7 npm \u5b89\u88c5\n\n```bash\nnpm i omi\n```\n\n\u5982\u679c\u9700\u8981\u517c\u5bb9 IE8+\uff0c\u53ef\u4ee5\u9009\u62e9 omio\uff0c\u5b83\u62e5\u6709\u548c omi \u51e0\u4e4e\u4e00\u6837\u7684 API\uff0c\u4e14 Omi \u4e5f\u4f1a\u88ab\u6ce8\u518c\u4e3a\u4e00\u4e2a\u5168\u5c40\u53d8\u91cf\u3002\n\n* [Omio \u5f00\u53d1\u7248\u672c](https://unpkg.com/omio@latest/dist/omi.js)\n* [Omio \u538b\u7f29\u7248\u672c](https://unpkg.com/omi@latest/dist/omi.min.js)\n\n\u6216\u8005\n\n```bash\nnpm i omio\n```\n\n## \u547d\u4ee4\u884c\u5de5\u5177\n\nOmi \u63d0\u4f9b\u4e86\u5b98\u65b9\u7684 CLI\uff0c\u4f60\u4e0d\u9700\u8981\u53bb\u5b66\u4e60\u600e\u4e48\u914d\u7f6e webpack\u3001babel\u6216\u8005 TypeScript\uff0cCLI \u5e2e\u4f60\u914d\u7f6e\u597d\u4e86\u4e00\u5207\uff0c\u4e14\u63d0\u4f9b\u4e86\u5404\u79cd\u6a21\u677f\u6ee1\u8db3\u4e0d\u540c\u7684\u9879\u76ee\u7c7b\u578b\u3002\n\n```bash\n$ npm i omi-cli -g # install cli\n$ omi init my-app # init project\n$ cd my-app \n$ npm start # develop\n$ npm run build # release\n```\n\n> `npx omi-cli init my-app` \u4e5f\u662f\u652f\u6301\u7684(npm v5.2.0+).\n\n\u76ee\u5f55\u63cf\u8ff0:\n\n```\n\u251c\u2500 config\n\u251c\u2500 public\n\u251c\u2500 scripts\n\u251c\u2500 src\n\u2502 \u251c\u2500 assets\n\u2502 \u251c\u2500 elements //Store all custom elements\n\u2502 \u251c\u2500 store //Store all this store of pages\n\u2502 \u251c\u2500 admin.js //Entry js of compiler\uff0cwill build to admin.html\n\u2502 \u2514\u2500 index.js //Entry js of compiler\uff0cwill build to index.html\n```\n\n\n### npm \u811a\u672c\n\n```json\n"scripts": {\n "start": "node scripts/start.js",\n "build": "PUBLIC_URL=. node scripts/build.js",\n "build-windows": "set PUBLIC_URL=.&& node scripts/build.js",\n "fix": "eslint src --fix"\n}\n```\n\n\u4f60\u4e5f\u53ef\u4ee5\u8bbe\u7f6e PUBLIC_URL, \u6bd4\u5982\uff1a\n\n```json\n...\n"build": "PUBLIC_URL=https://your.url.com/sub node scripts/build.js",\n"build-windows": "set PUBLIC_URL=https://your.url.com/sub&& node scripts/build.js",\n...\n```\n\n### \u5207\u6362 omi \u548c omio\n\n\u589e\u52a0\u6216\u5220\u9664 package.json \u91cc\u7684 alias config \u53ef\u4ee5\u5207\u6362 omi \u548c omio \u6e32\u67d3:\n\n```js\n ...\n "alias": {\n "omi": "omio"\n }\n ...\n```\n \n\n## \u9879\u76ee\u6a21\u677f\n\n| **Template Type**| **Command**| **Describe**|\n| ------------ | -----------| ----------------- |\n|\u57fa\u7840\u6a21\u677f(v3.3.0+)|`omi init my-app`| \u57fa\u7840\u6a21\u677f\uff0c\u652f\u6301 omi \u548c omio(IE8+)|\n|\u5c0f\u7a0b\u5e8f\u6a21\u677f(v3.3.5+)|`omi init-p my-app`| Omi \u5f00\u53d1\u5c0f\u7a0b\u5e8f |\n|mps|`omi init-mps my-app`| \u539f\u751f\u5c0f\u7a0b\u5e8f\u589e\u5f3a\u6846\u67b6(JSX + Less \u8f93\u51fa WXML + WXSS) |\n|mps ts \u7248\u672c|`omi init-mps-ts my-app`| \u539f\u751f\u5c0f\u7a0b\u5e8f\u589e\u5f3a\u6846\u67b6(JSX + Less \u8f93\u51fa WXML + WXSS) |\n|omi-cloud|`omi init-cloud my-app`| \u5c0f\u7a0b\u5e8f\u2022\u4e91\u5f00\u53d1|\n|\u57fa\u7840\u6a21\u677f(v3.3.9+)|`omi init-o my-app`| \u652f\u6301 IE8 \u7684\u57fa\u7840\u6a21\u677f\uff0c\u53ea\u662f build \u7684\u65f6\u5019\u652f\u6301 IE8\uff0c\u5f00\u53d1\u8c03\u8bd5\u8bf7\u7528 IE9|\n|\u652f\u6301\u9884\u6e32\u67d3\u5feb\u7167\u9aa8\u67b6\u7684\u6a21\u677f|`omi init-snap my-app`| \u57fa\u7840\u6a21\u677f\uff0c\u652f\u6301 omi \u548c omio(IE8+)\uff0c\u5185\u7f6e\u9884\u6e32\u67d3|\n|TypeScript \u6a21\u677f(omi-cli v3.3.0+)|`omi init-ts my-app`|\u4f7f\u7528 TypeScript \u7684\u6a21\u677f|\n|Mobile \u6a21\u677f|`omi init-weui my-app`| \u4f7f\u7528 weui \u548c omi-router \u7684\u6a21\u677f|\n|omi-mp \u6a21\u677f(omi-cli v3.0.13+)|`omi init-mp my-app` |\u4f7f\u7528\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1 H5|\n|MVVM \u6a21\u677f(omi-cli v3.0.22+)|`omi init-mvvm my-app` |MVVM \u6a21\u677f|\n'}});
//# sourceMappingURL=13.187d2ee6.chunk.js.map
webpackJsonp([13],{59:function(n,i){n.exports='## \u5b89\u88c5 \n\n\u76f4\u63a5\u4e0b\u8f7d\u5e76\u7528 `<script>` \u6807\u7b7e\u5f15\u5165\uff0cOmi \u4f1a\u88ab\u6ce8\u518c\u4e3a\u4e00\u4e2a\u5168\u5c40\u53d8\u91cf\u3002\n\n* [Omi \u5f00\u53d1\u7248\u672c](https://unpkg.com/omi@latest/dist/omi.js)\n* [Omi \u538b\u7f29\u7248\u672c](https://unpkg.com/omi@latest/dist/omi.min.js)\n\n\u4e5f\u53ef\u4ee5\u901a\u8fc7 npm \u5b89\u88c5\n\n```bash\nnpm i omi\n```\n\n\u5982\u679c\u9700\u8981\u517c\u5bb9 IE8+\uff0c\u53ef\u4ee5\u9009\u62e9 omio\uff0c\u5b83\u62e5\u6709\u548c omi \u51e0\u4e4e\u4e00\u6837\u7684 API\uff0c\u4e14 Omi \u4e5f\u4f1a\u88ab\u6ce8\u518c\u4e3a\u4e00\u4e2a\u5168\u5c40\u53d8\u91cf\u3002\n\n* [Omio \u5f00\u53d1\u7248\u672c](https://unpkg.com/omio@latest/dist/omi.js)\n* [Omio \u538b\u7f29\u7248\u672c](https://unpkg.com/omi@latest/dist/omi.min.js)\n\n\u6216\u8005\n\n```bash\nnpm i omio\n```\n\n## \u547d\u4ee4\u884c\u5de5\u5177\n\nOmi \u63d0\u4f9b\u4e86\u5b98\u65b9\u7684 CLI\uff0c\u4f60\u4e0d\u9700\u8981\u53bb\u5b66\u4e60\u600e\u4e48\u914d\u7f6e webpack\u3001babel\u6216\u8005 TypeScript\uff0cCLI \u5e2e\u4f60\u914d\u7f6e\u597d\u4e86\u4e00\u5207\uff0c\u4e14\u63d0\u4f9b\u4e86\u5404\u79cd\u6a21\u677f\u6ee1\u8db3\u4e0d\u540c\u7684\u9879\u76ee\u7c7b\u578b\u3002\n\n```bash\n$ npm i omi-cli -g # install cli\n$ omi init my-app # init project\n$ cd my-app \n$ npm start # develop\n$ npm run build # release\n```\n\n> `npx omi-cli init my-app` \u4e5f\u662f\u652f\u6301\u7684(npm v5.2.0+).\n\n\u76ee\u5f55\u63cf\u8ff0:\n\n```\n\u251c\u2500 config\n\u251c\u2500 public\n\u251c\u2500 scripts\n\u251c\u2500 src\n\u2502 \u251c\u2500 assets\n\u2502 \u251c\u2500 elements //Store all custom elements\n\u2502 \u251c\u2500 store //Store all this store of pages\n\u2502 \u251c\u2500 admin.js //Entry js of compiler\uff0cwill build to admin.html\n\u2502 \u2514\u2500 index.js //Entry js of compiler\uff0cwill build to index.html\n```\n\n\n### npm \u811a\u672c\n\n```json\n"scripts": {\n "start": "node scripts/start.js",\n "build": "PUBLIC_URL=. node scripts/build.js",\n "build-windows": "set PUBLIC_URL=.&& node scripts/build.js",\n "fix": "eslint src --fix"\n}\n```\n\n\u4f60\u4e5f\u53ef\u4ee5\u8bbe\u7f6e PUBLIC_URL, \u6bd4\u5982\uff1a\n\n```json\n...\n"build": "PUBLIC_URL=https://your.url.com/sub node scripts/build.js",\n"build-windows": "set PUBLIC_URL=https://your.url.com/sub&& node scripts/build.js",\n...\n```\n\n### \u5207\u6362 omi \u548c omio\n\n\u589e\u52a0\u6216\u5220\u9664 package.json \u91cc\u7684 alias config \u53ef\u4ee5\u5207\u6362 omi \u548c omio \u6e32\u67d3:\n\n```js\n ...\n "alias": {\n "omi": "omio"\n }\n ...\n```\n \n\n## \u9879\u76ee\u6a21\u677f\n\n| **Template Type**| **Command**| **Describe**|\n| ------------ | -----------| ----------------- |\n|\u57fa\u7840\u6a21\u677f(v3.3.0+)|`omi init my-app`| \u57fa\u7840\u6a21\u677f\uff0c\u652f\u6301 omi \u548c omio(IE8+)|\n|Kbone Template|`omi init-kbone my-app` | \u4f7f\u7528 omi \u5f00\u53d1\u5c0f\u7a0b\u5e8f\u6216\u8005 Web|\n|\u5c0f\u7a0b\u5e8f\u6a21\u677f(v3.3.5+)|`omi init-p my-app`| Omi \u5f00\u53d1\u5c0f\u7a0b\u5e8f |\n|mps|`omi init-mps my-app`| \u539f\u751f\u5c0f\u7a0b\u5e8f\u589e\u5f3a\u6846\u67b6(JSX + Less \u8f93\u51fa WXML + WXSS) |\n|mps ts \u7248\u672c|`omi init-mps-ts my-app`| \u539f\u751f\u5c0f\u7a0b\u5e8f\u589e\u5f3a\u6846\u67b6(JSX + Less \u8f93\u51fa WXML + WXSS) |\n|omi-cloud|`omi init-cloud my-app`| \u5c0f\u7a0b\u5e8f\u2022\u4e91\u5f00\u53d1|\n|\u57fa\u7840\u6a21\u677f(v3.3.9+)|`omi init-o my-app`| \u652f\u6301 IE8 \u7684\u57fa\u7840\u6a21\u677f\uff0c\u53ea\u662f build \u7684\u65f6\u5019\u652f\u6301 IE8\uff0c\u5f00\u53d1\u8c03\u8bd5\u8bf7\u7528 IE9|\n|\u652f\u6301\u9884\u6e32\u67d3\u5feb\u7167\u9aa8\u67b6\u7684\u6a21\u677f|`omi init-snap my-app`| \u57fa\u7840\u6a21\u677f\uff0c\u652f\u6301 omi \u548c omio(IE8+)\uff0c\u5185\u7f6e\u9884\u6e32\u67d3|\n|TypeScript \u6a21\u677f(omi-cli v3.3.0+)|`omi init-ts my-app`|\u4f7f\u7528 TypeScript \u7684\u6a21\u677f|\n|Mobile \u6a21\u677f|`omi init-weui my-app`| \u4f7f\u7528 weui \u548c omi-router \u7684\u6a21\u677f|\n|omi-mp \u6a21\u677f(omi-cli v3.0.13+)|`omi init-mp my-app` |\u4f7f\u7528\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1 H5|\n'}});
//# sourceMappingURL=13.2918b297.chunk.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
webpackJsonp([18],{54:function(e,t){e.exports="\n## Update\n\n`update` method is an important built-in core method for updating components themselves. For example:\n\n```js\nthis.update()\n```\n\nYou can also pass parameters to decide whether to ignore attributes in html mode and force updates:\n\n```js\nthis.update(true)\n```\n\nFor example, click on the mask of the pop-up layer to close the pop-up, pass it to the parent component in the react, let the parent component update, while Omi advocates self-update, so that the diff area is smaller.\n\n```js\nonMaskClick = ()=> {\n //change props\n this.props.show = false\n //prevent parent component from updating diff without results\n this.prevProps.show = false\n //update self and ignore attributes in html mode\n this.update(true)\n //trigger events, which can be used to change external state variables to maintain consistency, but external components need not be updated\n this.fire('close')\n}\n```\n\n### UpdateSelf\n\n![](https://github.com/Tencent/omi/raw/master/assets/update.png)\n\n`updateSelf` method does not update child components."}});
//# sourceMappingURL=18.a945affa.chunk.js.map

View File

@ -1 +0,0 @@
{"version":3,"sources":["../static/js/18.a945affa.chunk.js","docs/en/update.md"],"names":["webpackJsonp","54","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAOC,QAAU","file":"static/js/18.a945affa.chunk.js","sourcesContent":["webpackJsonp([18],{\n\n/***/ 54:\n/***/ (function(module, exports) {\n\nmodule.exports = \"\\n## Update\\n\\n`update` method is an important built-in core method for updating components themselves. For example:\\n\\n```js\\nthis.update()\\n```\\n\\nYou can also pass parameters to decide whether to ignore attributes in html mode and force updates:\\n\\n```js\\nthis.update(true)\\n```\\n\\nFor example, click on the mask of the pop-up layer to close the pop-up, pass it to the parent component in the react, let the parent component update, while Omi advocates self-update, so that the diff area is smaller.\\n\\n```js\\nonMaskClick = ()=> {\\n //change props\\n this.props.show = false\\n //prevent parent component from updating diff without results\\n this.prevProps.show = false\\n //update self and ignore attributes in html mode\\n this.update(true)\\n //trigger events, which can be used to change external state variables to maintain consistency, but external components need not be updated\\n this.fire('close')\\n}\\n```\\n\\n### UpdateSelf\\n\\n![](https://github.com/Tencent/omi/raw/master/assets/update.png)\\n\\n`updateSelf` method does not update child components.\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/18.a945affa.chunk.js","module.exports = \"\\n## Update\\n\\n`update` method is an important built-in core method for updating components themselves. For example:\\n\\n```js\\nthis.update()\\n```\\n\\nYou can also pass parameters to decide whether to ignore attributes in html mode and force updates:\\n\\n```js\\nthis.update(true)\\n```\\n\\nFor example, click on the mask of the pop-up layer to close the pop-up, pass it to the parent component in the react, let the parent component update, while Omi advocates self-update, so that the diff area is smaller.\\n\\n```js\\nonMaskClick = ()=> {\\n //change props\\n this.props.show = false\\n //prevent parent component from updating diff without results\\n this.prevProps.show = false\\n //update self and ignore attributes in html mode\\n this.update(true)\\n //trigger events, which can be used to change external state variables to maintain consistency, but external components need not be updated\\n this.fire('close')\\n}\\n```\\n\\n### UpdateSelf\\n\\n![](https://github.com/Tencent/omi/raw/master/assets/update.png)\\n\\n`updateSelf` method does not update child components.\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/en/update.md\n// module id = 54\n// module chunks = 18"],"sourceRoot":""}

View File

@ -0,0 +1,2 @@
webpackJsonp([18],{54:function(e,t){e.exports="\n## Update\n\n`update` method is an important built-in core method for updating components themselves. For example:\n\n```js\nthis.update()\n```\n\nYou can also pass parameters to decide whether to ignore attributes in html mode and updates:\n\n```js\nthis.update(true)\n```\n\nFor example, click on the mask of the pop-up layer to close the pop-up, pass it to the parent component in the react, let the parent component update, while Omi advocates self-update, so that the diff area is smaller.\n\n```js\nonMaskClick = ()=> {\n //change props\n this.props.show = false\n //prevent parent component from updating diff without results\n this.prevProps.show = false\n //update self and ignore attributes in html mode\n this.update(true)\n //trigger events, which can be used to change external state variables to maintain consistency, but external components need not be updated\n this.fire('close')\n}\n```\n\n### UpdateSelf\n\n![](https://github.com/Tencent/omi/raw/master/assets/update.png)\n\n`updateSelf` method does not update child components."}});
//# sourceMappingURL=18.c2baaa95.chunk.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../static/js/18.c2baaa95.chunk.js","docs/en/update.md"],"names":["webpackJsonp","54","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAOC,QAAU","file":"static/js/18.c2baaa95.chunk.js","sourcesContent":["webpackJsonp([18],{\n\n/***/ 54:\n/***/ (function(module, exports) {\n\nmodule.exports = \"\\n## Update\\n\\n`update` method is an important built-in core method for updating components themselves. For example:\\n\\n```js\\nthis.update()\\n```\\n\\nYou can also pass parameters to decide whether to ignore attributes in html mode and updates:\\n\\n```js\\nthis.update(true)\\n```\\n\\nFor example, click on the mask of the pop-up layer to close the pop-up, pass it to the parent component in the react, let the parent component update, while Omi advocates self-update, so that the diff area is smaller.\\n\\n```js\\nonMaskClick = ()=> {\\n //change props\\n this.props.show = false\\n //prevent parent component from updating diff without results\\n this.prevProps.show = false\\n //update self and ignore attributes in html mode\\n this.update(true)\\n //trigger events, which can be used to change external state variables to maintain consistency, but external components need not be updated\\n this.fire('close')\\n}\\n```\\n\\n### UpdateSelf\\n\\n![](https://github.com/Tencent/omi/raw/master/assets/update.png)\\n\\n`updateSelf` method does not update child components.\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/18.c2baaa95.chunk.js","module.exports = \"\\n## Update\\n\\n`update` method is an important built-in core method for updating components themselves. For example:\\n\\n```js\\nthis.update()\\n```\\n\\nYou can also pass parameters to decide whether to ignore attributes in html mode and updates:\\n\\n```js\\nthis.update(true)\\n```\\n\\nFor example, click on the mask of the pop-up layer to close the pop-up, pass it to the parent component in the react, let the parent component update, while Omi advocates self-update, so that the diff area is smaller.\\n\\n```js\\nonMaskClick = ()=> {\\n //change props\\n this.props.show = false\\n //prevent parent component from updating diff without results\\n this.prevProps.show = false\\n //update self and ignore attributes in html mode\\n this.update(true)\\n //trigger events, which can be used to change external state variables to maintain consistency, but external components need not be updated\\n this.fire('close')\\n}\\n```\\n\\n### UpdateSelf\\n\\n![](https://github.com/Tencent/omi/raw/master/assets/update.png)\\n\\n`updateSelf` method does not update child components.\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/en/update.md\n// module id = 54\n// module chunks = 18"],"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

View File

@ -1,2 +0,0 @@
webpackJsonp([21],{51:function(n,e){n.exports="# omi-router\n\nomi-router is a router plugin of [Omi](https://tencent.github.io/omi/), and it is lightweight, easy and powerful to use. It is a solution to build Omi's SPA(Single Page Application).\n\n[\u2192 DEMO](https://tencent.github.io/omi/packages/omi-router/examples/spa/build/)\n\nThe advantage of SPA is very clear.\n\n* No refresh to load a content\n* No refresh to previous/forward page\n* Shareable link (Other can see the same page as you see)\n* No blank page and transmission animation\n* Reusable resource (If multi-page, same resource shold be loaded multi times)\n\nYes, there are many advantages. Let's do it.\n\n## Install\n\n### NPM\n\n```js\nnpm install omi-router\n```\n\n## Usage\n\n```js\n//You can visit route in the global context.\nimport 'omi-router'\nimport { define, WeElement, render } from 'omi'\nimport './about'\nimport './home'\nimport './user'\nimport './user-list'\n\ndefine('my-app', class extends WeElement {\n static observe = true\n\n data = { tag: 'my-home' }\n\n install() {\n\n route('/', () => {\n this.data.tag = 'my-home'\n })\n\n route('/about', (evt) => {\n console.log(evt.query)\n this.data.tag = 'my-about'\n })\n\n route('/user-list', () => {\n this.data.tag = 'user-list'\n })\n\n route('/user/:name/category/:category', (evt) => {\n this.data.tag = 'my-user'\n this.data.params = evt.params\n })\n\n route('*', function () {\n console.log('not found')\n })\n\n route.before = (evt) => {\n console.log('before')\n //prevent route when return false\n //return false\n }\n\n route.after = (evt) => {\n console.log('after')\n }\n }\n\n onClick = () => {\n route.to('/user/vorshen/category/html')\n }\n\n render(props, data) {\n return (\n <div>\n <ul>\n <li><a href=\"#/\" >Home</a></li>\n <li><a href=\"#/about\" >About</a></li>\n <li><a href=\"#/user-list\" >UserList</a></li>\n <li><a href=\"#/about?name=dntzhang&age=18\" >About Dntzhang</a></li>\n </ul>\n <div id=\"view\">\n <data.tag params={data.params} />\n </div>\n <div><button onClick={this.onClick}>Test route.to</button></div>\n </div>\n )\n }\n})\n\nrender(<my-app />, \"#container\")\n```\n\n## Match\n\n| Rule | Path | route.params |\n|---------|------|--------|\n| /user/:name | /user/dntzhang | `{ name: 'dntzhang' }` |\n| /user/:name/category/:category | /user/dntzhang/category/js | `{ name: 'dntzhang', category: 'js' }` |\n\nNote: If hash is empty, it will be automatically recognized as `/` \u3002\n\n## With Query Parameter\n\n```html\n<li><a href=\"#/about?name=dntzhang&age=18\" >About</a></li>\n```\n\n```js\nroute('/about', (evt) => {\n //output { name: 'dntzhang', age : '18' } when click the tag above\n console.log(evt.query)\n})\n```\n\n## With Data\n\n```js\nroute.to('/about',(evt) => {\n //{ a: 1 }\n console.log(evt.data)\n})\nroute.to('/about', { a: 1 })\n```\n\n## Links\n\n* [DEMO](https://tencent.github.io/omi/packages/omi-router/examples/simple/)\n* [Source](https://github.com/Tencent/omi/tree/master/packages/omi-router/examples/simple)\n\n## License\nThis content is released under the [MIT](http://opensource.org/licenses/MIT) License.\n"}});
//# sourceMappingURL=21.f0bfd8f6.chunk.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
webpackJsonp([21],{51:function(n,e){n.exports="# omi-router\n\nomi-router is a router plugin of [Omi](https://tencent.github.io/omi/), and it is lightweight, easy and powerful to use. It is a solution to build Omi's SPA(Single Page Application).\n\n[\u2192 DEMO](https://tencent.github.io/omi/packages/omi-router/examples/spa/build/)\n\nThe advantage of SPA is very clear.\n\n* No refresh to load a content\n* No refresh to previous/forward page\n* Shareable link (Other can see the same page as you see)\n* No blank page and transmission animation\n* Reusable resource (If multi-page, same resource shold be loaded multi times)\n\nYes, there are many advantages. Let's do it.\n\n## Install\n\n### NPM\n\n```js\nnpm install omi-router\n```\n\n## Usage\n\n```js\n//You can visit route in the global context.\nimport 'omi-router'\nimport { define, WeElement, render } from 'omi'\nimport './about'\nimport './home'\nimport './user'\nimport './user-list'\n\ndefine('my-app', class extends WeElement {\n\n data = { tag: 'my-home' }\n\n install() {\n\n route('/', () => {\n this.data.tag = 'my-home'\n this.update()\n })\n\n route('/about', (evt) => {\n console.log(evt.query)\n this.data.tag = 'my-about'\n this.update()\n })\n\n route('/user-list', () => {\n this.data.tag = 'user-list'\n this.update()\n })\n\n route('/user/:name/category/:category', (evt) => {\n this.data.tag = 'my-user'\n this.data.params = evt.params\n this.update()\n })\n\n route('*', function () {\n console.log('not found')\n })\n\n route.before = (evt) => {\n console.log('before')\n //prevent route when return false\n //return false\n }\n\n route.after = (evt) => {\n console.log('after')\n }\n }\n\n onClick = () => {\n route.to('/user/vorshen/category/html')\n }\n\n render(props, data) {\n return (\n <div>\n <ul>\n <li><a href=\"#/\" >Home</a></li>\n <li><a href=\"#/about\" >About</a></li>\n <li><a href=\"#/user-list\" >UserList</a></li>\n <li><a href=\"#/about?name=dntzhang&age=18\" >About Dntzhang</a></li>\n </ul>\n <div id=\"view\">\n <data.tag params={data.params} />\n </div>\n <div><button onClick={this.onClick}>Test route.to</button></div>\n </div>\n )\n }\n})\n\nrender(<my-app />, \"#container\")\n```\n\n## Match\n\n| Rule | Path | route.params |\n|---------|------|--------|\n| /user/:name | /user/dntzhang | `{ name: 'dntzhang' }` |\n| /user/:name/category/:category | /user/dntzhang/category/js | `{ name: 'dntzhang', category: 'js' }` |\n\nNote: If hash is empty, it will be automatically recognized as `/` \u3002\n\n## With Query Parameter\n\n```html\n<li><a href=\"#/about?name=dntzhang&age=18\" >About</a></li>\n```\n\n```js\nroute('/about', (evt) => {\n //output { name: 'dntzhang', age : '18' } when click the tag above\n console.log(evt.query)\n})\n```\n\n## With Data\n\n```js\nroute.to('/about',(evt) => {\n //{ a: 1 }\n console.log(evt.data)\n})\nroute.to('/about', { a: 1 })\n```\n\n## Links\n\n* [DEMO](https://tencent.github.io/omi/packages/omi-router/examples/simple/)\n* [Source](https://github.com/Tencent/omi/tree/master/packages/omi-router/examples/simple)\n\n## License\nThis content is released under the [MIT](http://opensource.org/licenses/MIT) License.\n"}});
//# sourceMappingURL=21.f32e4629.chunk.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
webpackJsonp([26],{46:function(e,n){e.exports="## Lifecycle\n\n| Lifecycle method | When it gets called |\n| ---------------- | -------------------------------------------- |\n| `install` | before the component gets mounted to the DOM |\n| `installed` | after the component gets mounted to the DOM |\n| `uninstall` | prior to removal from the DOM |\n| `beforeUpdate` | before update |\n| `updated` | after update |\n| `beforeRender` | before `render()` |\n| `receiveProps` | parent element re-render will trigger it, `return false` will prevent update action |\n\nFor example:\n\n```js\nimport { render, WeElement, define } from 'omi'\n\ndefine('my-timer', class extends WeElement {\n static observe = true\n\n data = {\n seconds: 0\n }\n\n tick() {\n this.data.seconds++\n }\n\n install() {\n this.interval = setInterval(() => this.tick(), 1000)\n }\n\n uninstall() {\n clearInterval(this.interval)\n }\n\n render() {\n return <div>Seconds: {this.data.seconds}</div>\n }\n})\n\nrender(<my-timer />, 'body')\n```\n"}});
//# sourceMappingURL=26.ee99a6d0.chunk.js.map
webpackJsonp([26],{46:function(e,n){e.exports="## Lifecycle\n\n| Lifecycle method | When it gets called |\n| ---------------- | -------------------------------------------- |\n| `install` | before the component gets mounted to the DOM |\n| `installed` | after the component gets mounted to the DOM |\n| `uninstall` | prior to removal from the DOM |\n| `beforeUpdate` | before update |\n| `updated` | after update |\n| `beforeRender` | before `render()` |\n| `receiveProps` | parent element re-render will trigger it, `return false` will prevent update action |\n\nFor example:\n\n```js\nimport { render, WeElement, define } from 'omi'\n\ndefine('my-timer', class extends WeElement {\n data = {\n seconds: 0\n }\n\n tick() {\n this.data.seconds++\n this.update()\n }\n\n install() {\n this.interval = setInterval(() => this.tick(), 1000)\n }\n\n uninstall() {\n clearInterval(this.interval)\n }\n\n render() {\n return <div>Seconds: {this.data.seconds}</div>\n }\n})\n\nrender(<my-timer />, 'body')\n```\n"}});
//# sourceMappingURL=26.7e140343.chunk.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../static/js/26.7e140343.chunk.js","docs/en/lifecycle.md"],"names":["webpackJsonp","46","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAOC,QAAU","file":"static/js/26.7e140343.chunk.js","sourcesContent":["webpackJsonp([26],{\n\n/***/ 46:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Lifecycle\\n\\n| Lifecycle method | When it gets called |\\n| ---------------- | -------------------------------------------- |\\n| `install` | before the component gets mounted to the DOM |\\n| `installed` | after the component gets mounted to the DOM |\\n| `uninstall` | prior to removal from the DOM |\\n| `beforeUpdate` | before update |\\n| `updated` | after update |\\n| `beforeRender` | before `render()` |\\n| `receiveProps` | parent element re-render will trigger it, `return false` will prevent update action |\\n\\nFor example:\\n\\n```js\\nimport { render, WeElement, define } from 'omi'\\n\\ndefine('my-timer', class extends WeElement {\\n data = {\\n seconds: 0\\n }\\n\\n tick() {\\n this.data.seconds++\\n this.update()\\n }\\n\\n install() {\\n this.interval = setInterval(() => this.tick(), 1000)\\n }\\n\\n uninstall() {\\n clearInterval(this.interval)\\n }\\n\\n render() {\\n return <div>Seconds: {this.data.seconds}</div>\\n }\\n})\\n\\nrender(<my-timer />, 'body')\\n```\\n\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/26.7e140343.chunk.js","module.exports = \"## Lifecycle\\n\\n| Lifecycle method | When it gets called |\\n| ---------------- | -------------------------------------------- |\\n| `install` | before the component gets mounted to the DOM |\\n| `installed` | after the component gets mounted to the DOM |\\n| `uninstall` | prior to removal from the DOM |\\n| `beforeUpdate` | before update |\\n| `updated` | after update |\\n| `beforeRender` | before `render()` |\\n| `receiveProps` | parent element re-render will trigger it, `return false` will prevent update action |\\n\\nFor example:\\n\\n```js\\nimport { render, WeElement, define } from 'omi'\\n\\ndefine('my-timer', class extends WeElement {\\n data = {\\n seconds: 0\\n }\\n\\n tick() {\\n this.data.seconds++\\n this.update()\\n }\\n\\n install() {\\n this.interval = setInterval(() => this.tick(), 1000)\\n }\\n\\n uninstall() {\\n clearInterval(this.interval)\\n }\\n\\n render() {\\n return <div>Seconds: {this.data.seconds}</div>\\n }\\n})\\n\\nrender(<my-timer />, 'body')\\n```\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/en/lifecycle.md\n// module id = 46\n// module chunks = 26"],"sourceRoot":""}

View File

@ -1 +0,0 @@
{"version":3,"sources":["../static/js/26.ee99a6d0.chunk.js","docs/en/lifecycle.md"],"names":["webpackJsonp","46","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAOC,QAAU","file":"static/js/26.ee99a6d0.chunk.js","sourcesContent":["webpackJsonp([26],{\n\n/***/ 46:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Lifecycle\\n\\n| Lifecycle method | When it gets called |\\n| ---------------- | -------------------------------------------- |\\n| `install` | before the component gets mounted to the DOM |\\n| `installed` | after the component gets mounted to the DOM |\\n| `uninstall` | prior to removal from the DOM |\\n| `beforeUpdate` | before update |\\n| `updated` | after update |\\n| `beforeRender` | before `render()` |\\n| `receiveProps` | parent element re-render will trigger it, `return false` will prevent update action |\\n\\nFor example:\\n\\n```js\\nimport { render, WeElement, define } from 'omi'\\n\\ndefine('my-timer', class extends WeElement {\\n static observe = true\\n\\n data = {\\n seconds: 0\\n }\\n\\n tick() {\\n this.data.seconds++\\n }\\n\\n install() {\\n this.interval = setInterval(() => this.tick(), 1000)\\n }\\n\\n uninstall() {\\n clearInterval(this.interval)\\n }\\n\\n render() {\\n return <div>Seconds: {this.data.seconds}</div>\\n }\\n})\\n\\nrender(<my-timer />, 'body')\\n```\\n\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/26.ee99a6d0.chunk.js","module.exports = \"## Lifecycle\\n\\n| Lifecycle method | When it gets called |\\n| ---------------- | -------------------------------------------- |\\n| `install` | before the component gets mounted to the DOM |\\n| `installed` | after the component gets mounted to the DOM |\\n| `uninstall` | prior to removal from the DOM |\\n| `beforeUpdate` | before update |\\n| `updated` | after update |\\n| `beforeRender` | before `render()` |\\n| `receiveProps` | parent element re-render will trigger it, `return false` will prevent update action |\\n\\nFor example:\\n\\n```js\\nimport { render, WeElement, define } from 'omi'\\n\\ndefine('my-timer', class extends WeElement {\\n static observe = true\\n\\n data = {\\n seconds: 0\\n }\\n\\n tick() {\\n this.data.seconds++\\n }\\n\\n install() {\\n this.interval = setInterval(() => this.tick(), 1000)\\n }\\n\\n uninstall() {\\n clearInterval(this.interval)\\n }\\n\\n render() {\\n return <div>Seconds: {this.data.seconds}</div>\\n }\\n})\\n\\nrender(<my-timer />, 'body')\\n```\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/en/lifecycle.md\n// module id = 46\n// module chunks = 26"],"sourceRoot":""}

View File

@ -1,2 +1,2 @@
webpackJsonp([29],{43:function(n,i){n.exports='## Installation \n\nSimply download and include with `<script>`. Omi will be registered as a global variable.\n\n* [Omi Development Version](https://unpkg.com/omi@latest/dist/omi.js)\n* [Omi Production Version](https://unpkg.com/omi@latest/dist/omi.min.js)\n\nInstall via npm:\n\n```\nnpm i omi\n```\n\nIf you need to be compatible with IE8+, you can choose omio, which has almost the same API as omi, and Omi will be registered as a global variable.\n\n* [Omio Development Version](https://unpkg.com/omio@latest/dist/omi.js)\n* [Omio Production Version](https://unpkg.com/omi@latest/dist/omi.min.js)\n\nInstall via npm:\n\n```\nnpm i omio\n```\n\n## CLI\n\nOmi provides the official CLI. You don\'t need to learn how to configure webpack, Babel or TypeScript. CLI helps you configure everything and provides various templates for different project types.\n\n```bash\n$ npm i omi-cli -g # install cli\n$ omi init my-app # init project\n$ cd my-app \n$ npm start # develop\n$ npm run build # release\n```\n\n> `npx omi-cli init my-app` is also supported(npm v5.2.0+).\n\nDirectory description:\n\n```\n\u251c\u2500 config\n\u251c\u2500 public\n\u251c\u2500 scripts\n\u251c\u2500 src\n\u2502 \u251c\u2500 assets\n\u2502 \u251c\u2500 elements //Store all custom elements\n\u2502 \u251c\u2500 store //Store all this store of pages\n\u2502 \u251c\u2500 admin.js //Entry js of compiler\uff0cwill build to admin.html\n\u2502 \u2514\u2500 index.js //Entry js of compiler\uff0cwill build to index.html\n```\n\n\n### Scripts\n\n```json\n"scripts": {\n "start": "node scripts/start.js",\n "build": "PUBLIC_URL=. node scripts/build.js",\n "build-windows": "set PUBLIC_URL=.&& node scripts/build.js",\n "fix": "eslint src --fix"\n}\n```\n\nYou can set up the PUBLIC_URL, such as\uff1a\n\n```json\n...\n"build": "PUBLIC_URL=https://your.url.com/sub node scripts/build.js",\n"build-windows": "set PUBLIC_URL=https://your.url.com/sub&& node scripts/build.js",\n...\n```\n\n### Switch omi and omio\n\nAdd or remove the alias config in package.json to switch omi and omio\uff1a\n\n```js\n ...\n "alias": {\n "omi": "omio"\n }\n ...\n```\n\n## Project Template\n\n| **Template Type**| **Command**| **Describe**|\n| ------------ | -----------| ----------------- |\n|Base Template(v3.3.0+)|`omi init my-app`| Basic omi or omio(IE8+) project template.|\n|\u5c0f\u7a0b\u5e8f\u6a21\u677f(v3.3.5+)|`omi init-p my-app`| Omi \u5f00\u53d1\u5c0f\u7a0b\u5e8f |\n|Base Template with snapshoot|`omi init-snap my-app`| Basic omi or omio(IE8+) project template with snapshoot prerendering.|\n|TypeScript Template(omi-cli v3.3.0+)|`omi init-ts my-app`|Basic template with typescript.|\n|Mobile Template|`omi init-weui my-app`| Mobile web app template with weui and omi-router.|\n|MVVM Template(omi-cli v3.0.22+)|`omi init-mvvm my-app` |MVVM template.|\n'}});
//# sourceMappingURL=29.bdde5e22.chunk.js.map
webpackJsonp([29],{43:function(n,i){n.exports='## Installation \n\nSimply download and include with `<script>`. Omi will be registered as a global variable.\n\n* [Omi Development Version](https://unpkg.com/omi@latest/dist/omi.js)\n* [Omi Production Version](https://unpkg.com/omi@latest/dist/omi.min.js)\n\nInstall via npm:\n\n```\nnpm i omi\n```\n\nIf you need to be compatible with IE8+, you can choose omio, which has almost the same API as omi, and Omi will be registered as a global variable.\n\n* [Omio Development Version](https://unpkg.com/omio@latest/dist/omi.js)\n* [Omio Production Version](https://unpkg.com/omi@latest/dist/omi.min.js)\n\nInstall via npm:\n\n```\nnpm i omio\n```\n\n## CLI\n\nOmi provides the official CLI. You don\'t need to learn how to configure webpack, Babel or TypeScript. CLI helps you configure everything and provides various templates for different project types.\n\n```bash\n$ npm i omi-cli -g # install cli\n$ omi init my-app # init project\n$ cd my-app \n$ npm start # develop\n$ npm run build # release\n```\n\n> `npx omi-cli init my-app` is also supported(npm v5.2.0+).\n\nDirectory description:\n\n```\n\u251c\u2500 config\n\u251c\u2500 public\n\u251c\u2500 scripts\n\u251c\u2500 src\n\u2502 \u251c\u2500 assets\n\u2502 \u251c\u2500 elements //Store all custom elements\n\u2502 \u251c\u2500 store //Store all this store of pages\n\u2502 \u251c\u2500 admin.js //Entry js of compiler\uff0cwill build to admin.html\n\u2502 \u2514\u2500 index.js //Entry js of compiler\uff0cwill build to index.html\n```\n\n\n### Scripts\n\n```json\n"scripts": {\n "start": "node scripts/start.js",\n "build": "PUBLIC_URL=. node scripts/build.js",\n "build-windows": "set PUBLIC_URL=.&& node scripts/build.js",\n "fix": "eslint src --fix"\n}\n```\n\nYou can set up the PUBLIC_URL, such as\uff1a\n\n```json\n...\n"build": "PUBLIC_URL=https://your.url.com/sub node scripts/build.js",\n"build-windows": "set PUBLIC_URL=https://your.url.com/sub&& node scripts/build.js",\n...\n```\n\n### Switch omi and omio\n\nAdd or remove the alias config in package.json to switch omi and omio\uff1a\n\n```js\n ...\n "alias": {\n "omi": "omio"\n }\n ...\n```\n\n## Project Template\n\n| **Template Type**| **Command**| **Describe**|\n| ------------ | -----------| ----------------- |\n|Base Template(v3.3.0+)|`omi init my-app`| Basic omi or omio(IE8+) project template.|\n|Kbone Template|`omi init-kbone my-app` |Developing mini program or web using omi.|\n|\u5c0f\u7a0b\u5e8f\u6a21\u677f(v3.3.5+)|`omi init-p my-app`| Omi \u5f00\u53d1\u5c0f\u7a0b\u5e8f |\n|Base Template with snapshoot|`omi init-snap my-app`| Basic omi or omio(IE8+) project template with snapshoot prerendering.|\n|TypeScript Template(omi-cli v3.3.0+)|`omi init-ts my-app`|Basic template with typescript.|\n|Mobile Template|`omi init-weui my-app`| Mobile web app template with weui and omi-router.|\n\n'}});
//# sourceMappingURL=29.4ab54b26.chunk.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
webpackJsonp([3],{69:function(n,e){n.exports="# omi-router\n\nomi-router \u662f [Omi](https://tencent.github.io/omi/) \u4e13\u5c5e\u7684router\u63d2\u4ef6\uff0c\u6587\u4ef6\u5c3a\u5bf8\u8f7b\u91cf\uff0c\u4f7f\u7528\u7b80\u4fbf\uff0c\u529f\u80fd\u5f3a\u5927\u3002\u7528\u4e8eOmi\u5236\u4f5cWeb\u5355\u9875\u5e94\u7528\u7684\u9996\u9009\u89e3\u51b3\u65b9\u6848\u3002\n\n[\u2192 DEMO](https://tencent.github.io/omi/packages/omi-router/examples/spa/build/)\n\n\u5355\u9875\u7684\u597d\u5904\u4e5f\u662f\u975e\u5e38\u660e\u663e:\n\n* \u65e0\u5237\u65b0\u52a0\u8f7d\u9875\u9762\u5185\u5bb9\n* \u65e0\u5237\u65b0\u524d\u8fdb\u548c\u540e\u9000\u9875\u9762\n* \u8def\u7531\u4e2d\u7684\u67d0\u4e2a\u94fe\u63a5\u7684\u4f20\u64ad\u548c\u5206\u4eab\uff08\u522b\u4eba\u770b\u5230\u7684\u548c\u4f60\u4e00\u6837\u7684\u72b6\u6001\uff09\n* \u8f6c\u573a\u52a8\u753b\uff08a\u6807\u7b7e\u8df3\u8f6c\u4e0d\u4ec5\u8981\u767d\u5c4f\uff0c\u800c\u4e14\u6ca1\u6709\u8f6c\u573a\u52a8\u753b\uff09\n* \u8d44\u6e90\u590d\u7528\uff08\u5355\u9875\u4e2d\u7684\u8bb8\u591a\u8d44\u6e90\u4e00\u5b9a\u662f\u53ef\u4ee5\u5171\u7528\u7684\uff0c\u6700\u5178\u578b\u7684\u6bd4\u5982omi.js\uff0c\u5982\u679c\u4e0d\u662f\u5355\u9875\u7684\u8bdd\uff0c\u4f60\u9700\u8981\u52a0\u8f7d\u591a\u6b21\uff09\n\n\u597d\u4e86\uff0c\u597d\u5904\u8fd9\u4e48\u591a\uff0c\u770b\u770b\u600e\u4e48\u5b89\u88c5\u4f7f\u7528\u5427~~\n\n## \u5b89\u88c5\n\n### NPM\n\n```js\nnpm install omi-router\n```\n\n## \u5f00\u59cb\n\n```js\n//\u4f60\u53ef\u4ee5\u5728\u5168\u5c40\u8bbf\u95ee\u5230 route\nimport 'omi-router'\nimport { define, WeElement, render } from 'omi'\nimport './about'\nimport './home'\nimport './user'\nimport './user-list'\n\ndefine('my-app', class extends WeElement {\n\n data = { tag: 'my-home' }\n\n install() {\n\n route('/', () => {\n this.data.tag = 'my-home'\n this.update()\n })\n\n route('/about', (evt) => {\n console.log(evt.query)\n this.data.tag = 'my-about'\n this.update()\n })\n\n route('/user-list', () => {\n this.data.tag = 'user-list'\n this.update()\n })\n\n route('/user/:name/category/:category', (evt) => {\n this.data.tag = 'my-user'\n this.data.params = evt.params\n this.update()\n })\n\n route('*', function () {\n console.log('not found')\n })\n\n route.before = (evt) => {\n console.log('before')\n //prevent route when return false\n //return false\n }\n\n route.after = (evt) => {\n console.log('after')\n }\n }\n\n onClick = () => {\n route.to('/user/vorshen/category/html')\n }\n\n render(props, data) {\n return (\n <div>\n <ul>\n <li><a href=\"#/\" >Home</a></li>\n <li><a href=\"#/about\" >About</a></li>\n <li><a href=\"#/user-list\" >UserList</a></li>\n <li><a href=\"#/about?name=dntzhang&age=18\" >About Dntzhang</a></li>\n </ul>\n <div id=\"view\">\n <data.tag params={data.params} />\n </div>\n <div><button onClick={this.onClick}>Test route.to</button></div>\n </div>\n )\n }\n})\n\nrender(<my-app />, \"#container\")\n```\n\n## \u52a8\u6001\u5339\u914d\n\n| \u6a21\u5f0f | \u5339\u914d\u8def\u5f84 | route.params |\n|---------|------|--------|\n| /user/:name | /user/dntzhang | `{ name: 'dntzhang' }` |\n| /user/:name/category/:category | /user/dntzhang/category/js | `{ name: 'dntzhang', category: 'js' }` |\n\n\u6ce8\u610f\uff1a \u5982\u679c hash \u4e3a\u7a7a\uff0c\u4f1a\u81ea\u52a8\u88ab\u8bc6\u522b\u4e3a `/`\u3002\n\n## \u53e6\u4e00\u79cd\u643a\u5e26\u67e5\u8be2\u53c2\u6570\u65b9\u6cd5\n\n```html\n<li><a href=\"#/about?name=dntzhang&age=18\" >About</a></li>\n```\n\n```js\nroute('/about', (evt) => {\n //\u70b9\u51fb\u4e0a\u9762\u7684\u6807\u7b7e\u4f1a\u8f93\u51fa { name: 'dntzhang', age : '18' } \n console.log(evt.query)\n})\n```\n\n## \u643a\u5e26 JSON Data\n\n```js\nroute.to('/about',(evt) => {\n //{ a: 1 }\n console.log(evt.data)\n})\nroute.to('/about', { a: 1 })\n```\n\n### \u5730\u5740\n\n* [\u5728\u7ebf\u6f14\u793a\u5730\u5740](https://tencent.github.io/omi/packages/omi-router/examples/simple/)\n* [\u6e90\u7801\u5730\u5740](https://github.com/Tencent/omi/tree/master/packages/omi-router/examples/simple)\n\n## License\nThis content is released under the [MIT](http://opensource.org/licenses/MIT) License.\n"}});
//# sourceMappingURL=3.5c65f2d1.chunk.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
webpackJsonp([3],{69:function(n,e){n.exports="# omi-router\n\nomi-router \u662f [Omi](https://tencent.github.io/omi/) \u4e13\u5c5e\u7684router\u63d2\u4ef6\uff0c\u6587\u4ef6\u5c3a\u5bf8\u8f7b\u91cf\uff0c\u4f7f\u7528\u7b80\u4fbf\uff0c\u529f\u80fd\u5f3a\u5927\u3002\u7528\u4e8eOmi\u5236\u4f5cWeb\u5355\u9875\u5e94\u7528\u7684\u9996\u9009\u89e3\u51b3\u65b9\u6848\u3002\n\n[\u2192 DEMO](https://tencent.github.io/omi/packages/omi-router/examples/spa/build/)\n\n\u5355\u9875\u7684\u597d\u5904\u4e5f\u662f\u975e\u5e38\u660e\u663e:\n\n* \u65e0\u5237\u65b0\u52a0\u8f7d\u9875\u9762\u5185\u5bb9\n* \u65e0\u5237\u65b0\u524d\u8fdb\u548c\u540e\u9000\u9875\u9762\n* \u8def\u7531\u4e2d\u7684\u67d0\u4e2a\u94fe\u63a5\u7684\u4f20\u64ad\u548c\u5206\u4eab\uff08\u522b\u4eba\u770b\u5230\u7684\u548c\u4f60\u4e00\u6837\u7684\u72b6\u6001\uff09\n* \u8f6c\u573a\u52a8\u753b\uff08a\u6807\u7b7e\u8df3\u8f6c\u4e0d\u4ec5\u8981\u767d\u5c4f\uff0c\u800c\u4e14\u6ca1\u6709\u8f6c\u573a\u52a8\u753b\uff09\n* \u8d44\u6e90\u590d\u7528\uff08\u5355\u9875\u4e2d\u7684\u8bb8\u591a\u8d44\u6e90\u4e00\u5b9a\u662f\u53ef\u4ee5\u5171\u7528\u7684\uff0c\u6700\u5178\u578b\u7684\u6bd4\u5982omi.js\uff0c\u5982\u679c\u4e0d\u662f\u5355\u9875\u7684\u8bdd\uff0c\u4f60\u9700\u8981\u52a0\u8f7d\u591a\u6b21\uff09\n\n\u597d\u4e86\uff0c\u597d\u5904\u8fd9\u4e48\u591a\uff0c\u770b\u770b\u600e\u4e48\u5b89\u88c5\u4f7f\u7528\u5427~~\n\n## \u5b89\u88c5\n\n### NPM\n\n```js\nnpm install omi-router\n```\n\n## \u5f00\u59cb\n\n```js\n//\u4f60\u53ef\u4ee5\u5728\u5168\u5c40\u8bbf\u95ee\u5230 route\nimport 'omi-router'\nimport { define, WeElement, render } from 'omi'\nimport './about'\nimport './home'\nimport './user'\nimport './user-list'\n\ndefine('my-app', class extends WeElement {\n static observe = true\n\n data = { tag: 'my-home' }\n\n install() {\n\n route('/', () => {\n this.data.tag = 'my-home'\n })\n\n route('/about', (evt) => {\n console.log(evt.query)\n this.data.tag = 'my-about'\n })\n\n route('/user-list', () => {\n this.data.tag = 'user-list'\n })\n\n route('/user/:name/category/:category', (evt) => {\n this.data.tag = 'my-user'\n this.data.params = evt.params\n })\n\n route('*', function () {\n console.log('not found')\n })\n\n route.before = (evt) => {\n console.log('before')\n //prevent route when return false\n //return false\n }\n\n route.after = (evt) => {\n console.log('after')\n }\n }\n\n onClick = () => {\n route.to('/user/vorshen/category/html')\n }\n\n render(props, data) {\n return (\n <div>\n <ul>\n <li><a href=\"#/\" >Home</a></li>\n <li><a href=\"#/about\" >About</a></li>\n <li><a href=\"#/user-list\" >UserList</a></li>\n <li><a href=\"#/about?name=dntzhang&age=18\" >About Dntzhang</a></li>\n </ul>\n <div id=\"view\">\n <data.tag params={data.params} />\n </div>\n <div><button onClick={this.onClick}>Test route.to</button></div>\n </div>\n )\n }\n})\n\nrender(<my-app />, \"#container\")\n```\n\n## \u52a8\u6001\u5339\u914d\n\n| \u6a21\u5f0f | \u5339\u914d\u8def\u5f84 | route.params |\n|---------|------|--------|\n| /user/:name | /user/dntzhang | `{ name: 'dntzhang' }` |\n| /user/:name/category/:category | /user/dntzhang/category/js | `{ name: 'dntzhang', category: 'js' }` |\n\n\u6ce8\u610f\uff1a \u5982\u679c hash \u4e3a\u7a7a\uff0c\u4f1a\u81ea\u52a8\u88ab\u8bc6\u522b\u4e3a `/`\u3002\n\n## \u53e6\u4e00\u79cd\u643a\u5e26\u67e5\u8be2\u53c2\u6570\u65b9\u6cd5\n\n```html\n<li><a href=\"#/about?name=dntzhang&age=18\" >About</a></li>\n```\n\n```js\nroute('/about', (evt) => {\n //\u70b9\u51fb\u4e0a\u9762\u7684\u6807\u7b7e\u4f1a\u8f93\u51fa { name: 'dntzhang', age : '18' } \n console.log(evt.query)\n})\n```\n\n## \u643a\u5e26 JSON Data\n\n```js\nroute.to('/about',(evt) => {\n //{ a: 1 }\n console.log(evt.data)\n})\nroute.to('/about', { a: 1 })\n```\n\n### \u5730\u5740\n\n* [\u5728\u7ebf\u6f14\u793a\u5730\u5740](https://tencent.github.io/omi/packages/omi-router/examples/simple/)\n* [\u6e90\u7801\u5730\u5740](https://github.com/Tencent/omi/tree/master/packages/omi-router/examples/simple)\n\n## License\nThis content is released under the [MIT](http://opensource.org/licenses/MIT) License.\n"}});
//# sourceMappingURL=3.95dc6d3d.chunk.js.map

File diff suppressed because one or more lines are too long

2
site/docs/static/js/cn.a3027e17.js vendored Normal file

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

2
site/docs/static/js/index.1911ef3f.js vendored Normal file

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

View File

@ -88,8 +88,9 @@ Add or remove the alias config in package.json to switch omi and omio
| **Template Type**| **Command**| **Describe**|
| ------------ | -----------| ----------------- |
|Base Template(v3.3.0+)|`omi init my-app`| Basic omi or omio(IE8+) project template.|
|Kbone Template|`omi init-kbone my-app` |Developing mini program or web using omi.|
|小程序模板(v3.3.5+)|`omi init-p my-app`| Omi 开发小程序 |
|Base Template with snapshoot|`omi init-snap my-app`| Basic omi or omio(IE8+) project template with snapshoot prerendering.|
|TypeScript Template(omi-cli v3.3.0+)|`omi init-ts my-app`|Basic template with typescript.|
|Mobile Template|`omi init-weui my-app`| Mobile web app template with weui and omi-router.|
|MVVM Template(omi-cli v3.0.22+)|`omi init-mvvm my-app` |MVVM template.|

View File

@ -89,6 +89,7 @@ $ npm run build # release
| **Template Type**| **Command**| **Describe**|
| ------------ | -----------| ----------------- |
|基础模板(v3.3.0+)|`omi init my-app`| 基础模板,支持 omi 和 omio(IE8+)|
|Kbone Template|`omi init-kbone my-app` | 使用 omi 开发小程序或者 Web|
|小程序模板(v3.3.5+)|`omi init-p my-app`| Omi 开发小程序 |
|mps|`omi init-mps my-app`| 原生小程序增强框架(JSX + Less 输出 WXML + WXSS) |
|mps ts 版本|`omi init-mps-ts my-app`| 原生小程序增强框架(JSX + Less 输出 WXML + WXSS) |
@ -98,4 +99,3 @@ $ npm run build # release
|TypeScript 模板(omi-cli v3.3.0+)|`omi init-ts my-app`|使用 TypeScript 的模板|
|Mobile 模板|`omi init-weui my-app`| 使用 weui 和 omi-router 的模板|
|omi-mp 模板(omi-cli v3.0.13+)|`omi init-mp my-app` |使用微信小程序开发 H5|
|MVVM 模板(omi-cli v3.0.22+)|`omi init-mvvm my-app` |MVVM 模板|