"hidden" if the value returned by a callback
function is not empty.
function sayHi() {
return 'hi';
}
@onshow()
to know if the returned value returns a non-empty value. If a non-empty value is returned, then
the attribute "hidden" will be added to the html element. Since the function
A sample is shown below
<div @onshow('sayHi')>
some text here
</div>
<div hidden="hidden">
some text here
</div>
"hidden" attribute was added because the function returned a
value that is not empty. Empty values will return an empty string. In some cases where the function supplied
requires argument, we can supply the arguments after the first argument which is the function name. This is shown
below
function test($name){
if($name == 'foo') {
return 'some_value';
}
}
<div @onShow('test', 'foo')> text one </div>
<div @onShow('test', '')> text two </div>
<div hidden="hidden"> text one </div>
<div> text two </div>