update site

This commit is contained in:
dntzhang 2019-03-17 17:31:39 +08:00
parent 5a4164c7e1
commit 268dbb1b29
16 changed files with 87 additions and 25 deletions

View File

@ -1,18 +1,18 @@
{
"cn.css": "static/css/cn.fb9dfd08.css",
"cn.css.map": "static/css/cn.fb9dfd08.css.map",
"cn.js": "static/js/cn.05d9601f.js",
"cn.js.map": "static/js/cn.05d9601f.js.map",
"cn.js": "static/js/cn.d949f2b8.js",
"cn.js.map": "static/js/cn.d949f2b8.js.map",
"index.css": "static/css/index.fb9dfd08.css",
"index.css.map": "static/css/index.fb9dfd08.css.map",
"index.js": "static/js/index.3288619f.js",
"index.js.map": "static/js/index.3288619f.js.map",
"static/js/0.f567cc72.chunk.js": "static/js/0.f567cc72.chunk.js",
"static/js/0.f567cc72.chunk.js.map": "static/js/0.f567cc72.chunk.js.map",
"index.js": "static/js/index.1f7845e3.js",
"index.js.map": "static/js/index.1f7845e3.js.map",
"static/js/0.be39afbe.chunk.js": "static/js/0.be39afbe.chunk.js",
"static/js/0.be39afbe.chunk.js.map": "static/js/0.be39afbe.chunk.js.map",
"static/js/1.558ccb83.chunk.js": "static/js/1.558ccb83.chunk.js",
"static/js/1.558ccb83.chunk.js.map": "static/js/1.558ccb83.chunk.js.map",
"static/js/10.6fd7021c.chunk.js": "static/js/10.6fd7021c.chunk.js",
"static/js/10.6fd7021c.chunk.js.map": "static/js/10.6fd7021c.chunk.js.map",
"static/js/10.67de93c9.chunk.js": "static/js/10.67de93c9.chunk.js",
"static/js/10.67de93c9.chunk.js.map": "static/js/10.67de93c9.chunk.js.map",
"static/js/11.d89c3da3.chunk.js": "static/js/11.d89c3da3.chunk.js",
"static/js/11.d89c3da3.chunk.js.map": "static/js/11.d89c3da3.chunk.js.map",
"static/js/12.b315c503.chunk.js": "static/js/12.b315c503.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 - 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.05d9601f.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.d949f2b8.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 - 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.3288619f.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.1f7845e3.js"></script></body></html>

View File

@ -1 +1 @@
"use strict";var precacheConfig=[["./cn.html","085c04ddd9a5f595e173bd8af8b5967b"],["./index.html","36f480ff9826fa5463fb2ae48c8e0141"],["./static/css/cn.fb9dfd08.css","956b8f005795c2569d823cddbc15d24c"],["./static/css/index.fb9dfd08.css","414d16d757eb45e170251798229d649f"],["./static/js/0.f567cc72.chunk.js","f3202e1a07b69759148759bce73ac329"],["./static/js/1.558ccb83.chunk.js","c17437d453c11e5aa7814a224b2715f7"],["./static/js/10.6fd7021c.chunk.js","d051f9a9de83b89e089b7066c3eee0c5"],["./static/js/11.d89c3da3.chunk.js","64accb62577f5508865163be3b24921c"],["./static/js/12.b315c503.chunk.js","f7fc8c1d7275b1fad3a40ff24cd32dc7"],["./static/js/13.2d61bcaa.chunk.js","f705603af952b4c679483487dbe34789"],["./static/js/14.ffd1b762.chunk.js","b06a7acf615d915f918d8241cc2ea5d1"],["./static/js/15.96c68a2d.chunk.js","ae64a701e9362a6358295d5bb2c4acea"],["./static/js/16.adc3616f.chunk.js","f37fe4a4612da03454251b418b838b22"],["./static/js/17.eee2a496.chunk.js","0994932ab2707be5edddc2ac50eb154c"],["./static/js/18.78af457c.chunk.js","f9bc7539f5912d68ed3a6dbef2937b0c"],["./static/js/2.c1dc8aff.chunk.js","9b99e5879908c0c3dfbde3040a16fb06"],["./static/js/3.1911dfb9.chunk.js","92c988f90f94d11036b2d9a931cc5e0e"],["./static/js/4.0b40eebc.chunk.js","8c20bf08e38b0f10198ac6d95d17a618"],["./static/js/5.802e0a01.chunk.js","101998b1b594f61aff4fc980c3d5bfbb"],["./static/js/6.847b6a15.chunk.js","4b7137bf928b9afa5751311122f0ca3e"],["./static/js/7.e2e272f5.chunk.js","c0caf6afdff38e89be4438e2db19f963"],["./static/js/8.1a683bff.chunk.js","c53736ff86dfb46f374b3841f69e9ce4"],["./static/js/9.99421bc7.chunk.js","e4a3a356ebd29e2687d32f15136a7009"],["./static/js/cn.05d9601f.js","30c05fdafd4cff4b8f3ac6dfeb14a506"],["./static/js/index.3288619f.js","f35c3b94f6e183deed52644cd4641607"],["./static/media/omi-logo2019.923166c3.svg","923166c362dce831a15c447b19a622f9"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var c=new URL(e);return"/"===c.pathname.slice(-1)&&(c.pathname+=t),c.toString()},cleanResponse=function(t){return t.redirected?("body"in t?Promise.resolve(t.body):t.blob()).then(function(e){return new Response(e,{headers:t.headers,status:t.status,statusText:t.statusText})}):Promise.resolve(t)},createCacheKey=function(e,t,c,a){var n=new URL(e);return a&&n.pathname.match(a)||(n.search+=(n.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(c)),n.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var c=new URL(t).pathname;return e.some(function(e){return c.match(e)})},stripIgnoredUrlParameters=function(e,c){var t=new URL(e);return t.hash="",t.search=t.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(t){return c.every(function(e){return!e.test(t[0])})}).map(function(e){return e.join("=")}).join("&"),t.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],c=e[1],a=new URL(t,self.location),n=createCacheKey(a,hashParamName,c,/\.\w{8}\./);return[a.toString(),n]}));function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(a){return setOfCachedUrls(a).then(function(c){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(t){if(!c.has(t)){var e=new Request(t,{credentials:"same-origin"});return fetch(e).then(function(e){if(!e.ok)throw new Error("Request for "+t+" returned a response with status "+e.status);return cleanResponse(e).then(function(e){return a.put(t,e)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var c=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(t){return t.keys().then(function(e){return Promise.all(e.map(function(e){if(!c.has(e.url))return t.delete(e)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(t){if("GET"===t.request.method){var e,c=stripIgnoredUrlParameters(t.request.url,ignoreUrlParametersMatching),a="index.html";(e=urlsToCacheKeys.has(c))||(c=addDirectoryIndex(c,a),e=urlsToCacheKeys.has(c));var n="./index.html";!e&&"navigate"===t.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],t.request.url)&&(c=new URL(n,self.location).toString(),e=urlsToCacheKeys.has(c)),e&&t.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(c)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(e){return console.warn('Couldn\'t serve response for "%s" from cache: %O',t.request.url,e),fetch(t.request)}))}});
"use strict";var precacheConfig=[["./cn.html","7409f4cc1342dc8f364f6603f4877830"],["./index.html","74e2491147348b4827f10226b8674c54"],["./static/css/cn.fb9dfd08.css","956b8f005795c2569d823cddbc15d24c"],["./static/css/index.fb9dfd08.css","414d16d757eb45e170251798229d649f"],["./static/js/0.be39afbe.chunk.js","1e20f687a135f0a3381ca2f923c536c6"],["./static/js/1.558ccb83.chunk.js","c17437d453c11e5aa7814a224b2715f7"],["./static/js/10.67de93c9.chunk.js","80f2fde0d682aaafb19e8a6de240684d"],["./static/js/11.d89c3da3.chunk.js","64accb62577f5508865163be3b24921c"],["./static/js/12.b315c503.chunk.js","f7fc8c1d7275b1fad3a40ff24cd32dc7"],["./static/js/13.2d61bcaa.chunk.js","f705603af952b4c679483487dbe34789"],["./static/js/14.ffd1b762.chunk.js","b06a7acf615d915f918d8241cc2ea5d1"],["./static/js/15.96c68a2d.chunk.js","ae64a701e9362a6358295d5bb2c4acea"],["./static/js/16.adc3616f.chunk.js","f37fe4a4612da03454251b418b838b22"],["./static/js/17.eee2a496.chunk.js","0994932ab2707be5edddc2ac50eb154c"],["./static/js/18.78af457c.chunk.js","f9bc7539f5912d68ed3a6dbef2937b0c"],["./static/js/2.c1dc8aff.chunk.js","9b99e5879908c0c3dfbde3040a16fb06"],["./static/js/3.1911dfb9.chunk.js","92c988f90f94d11036b2d9a931cc5e0e"],["./static/js/4.0b40eebc.chunk.js","8c20bf08e38b0f10198ac6d95d17a618"],["./static/js/5.802e0a01.chunk.js","101998b1b594f61aff4fc980c3d5bfbb"],["./static/js/6.847b6a15.chunk.js","4b7137bf928b9afa5751311122f0ca3e"],["./static/js/7.e2e272f5.chunk.js","c0caf6afdff38e89be4438e2db19f963"],["./static/js/8.1a683bff.chunk.js","c53736ff86dfb46f374b3841f69e9ce4"],["./static/js/9.99421bc7.chunk.js","e4a3a356ebd29e2687d32f15136a7009"],["./static/js/cn.d949f2b8.js","3e1801c79476943df06cd0983af9f6f2"],["./static/js/index.1f7845e3.js","e40e70d9866eca450af1739a64edeaa9"],["./static/media/omi-logo2019.923166c3.svg","923166c362dce831a15c447b19a622f9"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var c=new URL(e);return"/"===c.pathname.slice(-1)&&(c.pathname+=t),c.toString()},cleanResponse=function(t){return t.redirected?("body"in t?Promise.resolve(t.body):t.blob()).then(function(e){return new Response(e,{headers:t.headers,status:t.status,statusText:t.statusText})}):Promise.resolve(t)},createCacheKey=function(e,t,c,a){var n=new URL(e);return a&&n.pathname.match(a)||(n.search+=(n.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(c)),n.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var c=new URL(t).pathname;return e.some(function(e){return c.match(e)})},stripIgnoredUrlParameters=function(e,c){var t=new URL(e);return t.hash="",t.search=t.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(t){return c.every(function(e){return!e.test(t[0])})}).map(function(e){return e.join("=")}).join("&"),t.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],c=e[1],a=new URL(t,self.location),n=createCacheKey(a,hashParamName,c,/\.\w{8}\./);return[a.toString(),n]}));function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(a){return setOfCachedUrls(a).then(function(c){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(t){if(!c.has(t)){var e=new Request(t,{credentials:"same-origin"});return fetch(e).then(function(e){if(!e.ok)throw new Error("Request for "+t+" returned a response with status "+e.status);return cleanResponse(e).then(function(e){return a.put(t,e)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var c=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(t){return t.keys().then(function(e){return Promise.all(e.map(function(e){if(!c.has(e.url))return t.delete(e)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(t){if("GET"===t.request.method){var e,c=stripIgnoredUrlParameters(t.request.url,ignoreUrlParametersMatching),a="index.html";(e=urlsToCacheKeys.has(c))||(c=addDirectoryIndex(c,a),e=urlsToCacheKeys.has(c));var n="./index.html";!e&&"navigate"===t.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],t.request.url)&&(c=new URL(n,self.location).toString(),e=urlsToCacheKeys.has(c)),e&&t.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(c)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(e){return console.warn('Couldn\'t serve response for "%s" from cache: %O',t.request.url,e),fetch(t.request)}))}});

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([10],{47:function(n,t){n.exports="## What's Store?\n\nStore is Omi's built-in centralized data warehouse, which solves and provides the following problems and capabilities:\n\n* Component Tree Data Sharing\n* Data Change Updates Dependent Components on Demand\n\n![](https://github.com/Tencent/omi/raw/master/assets/store.jpg)\n\n## A piece of code is completely ready for Store\n\n```jsx\nimport { render, WeElement, define } from '../../src/omi'\n\ndefine('my-counter', class extends WeElement {\n static use = [\n { count: 'count' }\n ]\n\n add = () => this.store.add()\n sub = () => this.store.sub()\n\n addIfOdd = () => {\n if (this.use.count % 2 !== 0) {\n this.store.add()\n }\n }\n\n addAsync = () => {\n setTimeout(() => this.store.add(), 1000)\n }\n\n render() {\n return (\n <p>\n Clicked: {this.use.count} times\n {' '}\n <button onClick={this.add}>+</button>\n {' '}\n <button onClick={this.sub}>-</button>\n {' '}\n <button onClick={this.addIfOdd}>\n Add if odd\n </button>\n {' '}\n <button onClick={this.addAsync}>\n Add async\n </button>\n </p>\n )\n }\n})\n\nrender(<my-counter />, 'body', {\n data: {\n count: 0\n },\n sub() {\n this.data.count--\n },\n add() {\n this.data.count++\n },\n})\n```\n\n* Declare a dependent path by `static use'.\n* `store` injects all components from the root node through the third parameter of render.\n\nHere is a complicated example of `use'.\n\nData of store:\n\n```json\n{\n count: 0,\n arr: ['china', 'tencent'],\n motto: 'I love omi.',\n userInfo: {\n firstName: 'dnt',\n lastName: 'zhang',\n age: 18\n }\n}\n```\n\nStatic use:\n\n```jsx\nstatic use = [\n 'count', //Direct string, accessible through this.use[0] \n 'arr[0]', //It also supports path, which is accessible through this.use[1]\n //Support JSON\n {\n //Alias, accessible through this.use.reverseMotto\n reverseMotto: [\n 'motto', //path\n target => target.split('').reverse().join('') //computed\n ]\n },\n { name: 'arr[1]' }, //{ alias: path }\uff0caccessible through this.use.name\n {\n //alias\uff0caccessible through this.use.fullName\n fullName: [\n ['userInfo.firstName', 'userInfo.lastName'], //path array\n (firstName, lastName) => firstName + lastName //computed\n ]\n },\n]\n```\n\nLet's look at the use of JSX:\n\n```jsx\n...\n...\nrender() {\n return (\n <div>\n <button onClick={this.sub}>-</button>\n <span>{this.use[0]}</span>\n <button onClick={this.add}>+</button>\n <div>\n <span>{this.use[1]}</span>\n <button onClick={this.rename}>rename</button>\n </div>\n <div>{this.use.reverseMotto}</div><button onClick={this.changeMotto}>change motto</button>\n <div>{this.use.name}</div>\n <div>{this.use[3]}</div>\n <div>\n {this.use.fullName}\n <button onClick={this.changeFirstName}>change first name</button>\n </div>\n </div>\n )\n}\n...\n...\n```\n\nWithout alias, you can also access it directly through `this.store.data.xxx'."}});
//# sourceMappingURL=10.6fd7021c.chunk.js.map
webpackJsonp([10],{47:function(n,t){n.exports="## What's Store?\n\nStore is Omi's built-in centralized data warehouse, which solves and provides the following problems and capabilities:\n\n* Component Tree Data Sharing\n* Data Change Updates Dependent Components on Demand\n\n![](https://github.com/Tencent/omi/raw/master/assets/store.jpg)\n\n## A piece of code is completely ready for Store\n\n```jsx\nimport { render, WeElement, define } from '../../src/omi'\n\ndefine('my-counter', class extends WeElement {\n static use = [\n { count: 'count' }\n ]\n\n add = () => this.store.add()\n sub = () => this.store.sub()\n\n addIfOdd = () => {\n if (this.use.count % 2 !== 0) {\n this.store.add()\n }\n }\n\n addAsync = () => {\n setTimeout(() => this.store.add(), 1000)\n }\n\n render() {\n return (\n <p>\n Clicked: {this.use.count} times\n {' '}\n <button onClick={this.add}>+</button>\n {' '}\n <button onClick={this.sub}>-</button>\n {' '}\n <button onClick={this.addIfOdd}>\n Add if odd\n </button>\n {' '}\n <button onClick={this.addAsync}>\n Add async\n </button>\n </p>\n )\n }\n})\n\nrender(<my-counter />, 'body', {\n data: {\n count: 0\n },\n sub() {\n this.data.count--\n },\n add() {\n this.data.count++\n },\n})\n```\n\n* Declare a dependent path by `static use'.\n* `store` injects all components from the root node through the third parameter of render.\n\nHere is a complicated example of `use'.\n\nData of store:\n\n```json\n{\n count: 0,\n arr: ['china', 'tencent'],\n motto: 'I love omi.',\n userInfo: {\n firstName: 'dnt',\n lastName: 'zhang',\n age: 18\n }\n}\n```\n\nStatic use:\n\n```jsx\nstatic use = [\n 'count', //Direct string, accessible through this.use[0] \n 'arr[0]', //It also supports path, which is accessible through this.use[1]\n //Support JSON\n {\n //Alias, accessible through this.use.reverseMotto\n reverseMotto: [\n 'motto', //path\n target => target.split('').reverse().join('') //computed\n ]\n },\n { name: 'arr[1]' }, //{ alias: path }\uff0caccessible through this.use.name\n {\n //alias\uff0caccessible through this.use.fullName\n fullName: [\n ['userInfo.firstName', 'userInfo.lastName'], //path array\n (firstName, lastName) => firstName + lastName //computed\n ]\n },\n]\n```\n\nLet's look at the use of JSX:\n\n```jsx\n...\n...\nrender() {\n return (\n <div>\n <button onClick={this.sub}>-</button>\n <span>{this.use[0]}</span>\n <button onClick={this.add}>+</button>\n <div>\n <span>{this.use[1]}</span>\n <button onClick={this.rename}>rename</button>\n </div>\n <div>{this.use.reverseMotto}</div><button onClick={this.changeMotto}>change motto</button>\n <div>{this.use.name}</div>\n <div>{this.use[3]}</div>\n <div>\n {this.use.fullName}\n <button onClick={this.changeFirstName}>change first name</button>\n </div>\n </div>\n )\n}\n...\n...\n```\n\nWithout alias, you can also access it directly through `this.store.data.xxx'.\n\n### Fast assignment\n\n```jsx\nimport { define, WeElement } from 'omi'\nimport '../my-list'\n\ndefine('my-sidebar', class extends WeElement {\n static css = require('./_index.css')\n\n static use = [\n 'menus',\n 'sideBarShow',\n 'lan'\n ]\n\n render() {\n const [menus, sideBarShow, lan] = this.use\n\n return (\n <div class={`list${sideBarShow ? ' show' : ''}`}>\n {menus[lan].map((menu, index) => (\n <my-list menu={menu} index={index} />\n ))}\n </div>\n )\n }\n})\n```\n\nHere is an example of using the ES2015+ Grammar `const [xx, xxx] = xxxx` for fast assignment.\n"}});
//# sourceMappingURL=10.67de93c9.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

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

@ -138,4 +138,35 @@ render() {
...
```
Without alias, you can also access it directly through `this.store.data.xxx'.
Without alias, you can also access it directly through `this.store.data.xxx'.
### Fast assignment
```jsx
import { define, WeElement } from 'omi'
import '../my-list'
define('my-sidebar', class extends WeElement {
static css = require('./_index.css')
static use = [
'menus',
'sideBarShow',
'lan'
]
render() {
const [menus, sideBarShow, lan] = this.use
return (
<div class={`list${sideBarShow ? ' show' : ''}`}>
{menus[lan].map((menu, index) => (
<my-list menu={menu} index={index} />
))}
</div>
)
}
})
```
Here is an example of using the ES2015+ Grammar `const [xx, xxx] = xxxx` for fast assignment.

View File

@ -155,4 +155,35 @@ render() {
以上只要命中一个条件就可以进行更新!
总结: 只要注入组件的 path 等于 use 里声明 或者在 use 里声明的其中 path 子节点下就会进行更新!
总结: 只要注入组件的 path 等于 use 里声明 或者在 use 里声明的其中 path 子节点下就会进行更新!
### 快速赋值
```jsx
import { define, WeElement } from 'omi'
import '../my-list'
define('my-sidebar', class extends WeElement {
static css = require('./_index.css')
static use = [
'menus',
'sideBarShow',
'lan'
]
render() {
const [menus, sideBarShow, lan] = this.use
return (
<div class={`list${sideBarShow ? ' show' : ''}`}>
{menus[lan].map((menu, index) => (
<my-list menu={menu} index={index} />
))}
</div>
)
}
})
```
这里举了个例子使用 ES2015+ 语法 `const [xx, xxx] = xxxx` 的语法快速赋值。