Releases: mtsgi/kafjs
Releases · mtsgi/kafjs
kaf.js v0.1.2
v0.1.2
What's new
Support expression in kit:if
The following attributes have been added that can be used within an attribute.
-
==operator- By passing a JavaScript expression or kaf data name on the right side, the element will be displayed only if the kaf data and the expression (or value of the kaf data) are equivalent.
- Example:
<div kit:if="name == 'John'"></div>
-
!=operator- Passing a JavaScript expression or kaf data name on the right side will only display that element if the kaf data and the expression (or value of the kaf data) are not equivalent.
- Example:
<div kit:if="number ! = 0"></div>
-
===operator- Passing a JavaScript expression or kaf data name on the right-hand side will only display that element if the kaf data and the expression (or value of the kaf data) are strictly equivalent.
- Example:
<div kit:if="number === 100"></div>(this element is not displayed if the value is a string"100")
-
!==operator- Passing a JavaScript expression or kaf data name on the right-hand side will only display that element if the kaf data and the expression (or value of the kaf data) are not strictly equivalent.
- Example:
<div kit:if="password ! == password_confirm"></div>(this element is not displayed when the values of the two KAF data are strictly equivalent)
-
??operator- Only if the kaf data is not
nullandundefinedwill the element be displayed. - Example:
<p kit:if="mydata.address.pref ??" ></p>
- Only if the kaf data is not
-
&&operator- Passing a kaf data name on the right-hand side will only display that element if the two kaf data are both values that are truthy.
- Example:
<p kit:if="first_name && last_name"></p>
-
||operator- Passing a kaf data name on the right-hand side will display the element if either of the two kaf data is a value that are trythy.
- Example:
<p kit:if="mydata.height || mydata.width"></p>
You can use the kaf-data name that has already been defined by data of kaf-option, and that will be set as initial value of the form.
Support default value
- Support for optional argument options with data names already defined in
kit:bind
kaf.js v0.1.1
- Support expressions in a kit:if attribute.
- Add error handling.
kaf.js v0.1
This is first release of kafjs beta.