leanweb 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/package.json +1 -1
- package/templates/lib/lw-element.js +1 -0
package/README.md
CHANGED
|
@@ -259,6 +259,7 @@ items = ["one", "two", "three"];
|
|
|
259
259
|
<br />
|
|
260
260
|
<button lw-on:click="resetName()">Reset Name</button>
|
|
261
261
|
```
|
|
262
|
+
|
|
262
263
|
You could bind multiple events like `lw-on:click,change=handler($event, $node)`.
|
|
263
264
|
|
|
264
265
|
```javascript
|
|
@@ -318,24 +319,26 @@ imageWidth = 400;
|
|
|
318
319
|
`demo-parent.html`
|
|
319
320
|
|
|
320
321
|
```html
|
|
321
|
-
<demo-child lw-input:userData="user"></demo-child>
|
|
322
|
+
<demo-child lw-input:parent="self" lw-input:userData="user"></demo-child>
|
|
322
323
|
```
|
|
323
324
|
|
|
324
325
|
`demo-parent.js`
|
|
325
326
|
|
|
326
327
|
```javascript
|
|
327
328
|
// ...
|
|
329
|
+
// self is defined in LWElement as `self = this`;
|
|
328
330
|
user = { firstname: "Qian", lastname: "Chen" };
|
|
329
331
|
// ...
|
|
330
332
|
```
|
|
331
333
|
|
|
332
|
-
The child is able to access the `user` object passed in with
|
|
333
|
-
directive from `inputReady()` method.
|
|
334
|
+
The child is able to access the `parent` and `user` object passed in with
|
|
335
|
+
`lw-input:` directive from `inputReady()` method.
|
|
334
336
|
`demo-child.js`
|
|
335
337
|
|
|
336
338
|
```javascript
|
|
337
339
|
// ...
|
|
338
340
|
inputReady() {
|
|
341
|
+
console.log(this.parent);
|
|
339
342
|
console.log(this.userData);
|
|
340
343
|
}
|
|
341
344
|
// ...
|
package/package.json
CHANGED