update site

This commit is contained in:
dntzhang 2019-04-20 17:36:21 +08:00
parent 5bc2bd8da6
commit ad4d447355
2 changed files with 34 additions and 0 deletions

View File

@ -186,3 +186,20 @@ define('my-sidebar', class extends WeElement {
```
Here is an example of using the ES2015+ Grammar `const [xx, xxx] = xxxx` for fast assignment.
## initUse
If you don't want the same components to have the same dependencies, you can use `initUse' to achieve dynamic use:
```js
initUse() {
return [
'a.b',
'c[1].d',
`e.f.${xxx}.d[${index}]`
]
}
```
Very flexible!

View File

@ -187,3 +187,20 @@ define('my-sidebar', class extends WeElement {
```
这里举了个例子使用 ES2015+ 语法 `const [xx, xxx] = xxxx` 的语法快速赋值。
## 动态 use
如果你不希望同样的组件拥有同样的依赖,可以使用动态的 use
```js
initUse() {
return [
'a.b',
'c[1].d',
`e.f.${xxx}.d[${index}]`
]
}
```
非常灵活!