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 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 `lw-input:`
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leanweb",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Builds framework agnostic web components.",
5
5
  "bin": {
6
6
  "leanweb": "leanweb.js",
@@ -97,6 +97,7 @@ const nextAllSiblings = (el, selector) => {
97
97
  };
98
98
 
99
99
  export default class LWElement extends HTMLElement {
100
+ me = self;
100
101
  constructor(ast) {
101
102
  super();
102
103
  this.ast = ast;