4 ms·
This the same as in standard JavaScript DOM event call. If you want to call a returned function in JS, you can do: <button onclick="getFunction()()">. Similar b
by tipiirai 3y ago
This the same as in standard JavaScript DOM event call. If you want to call a returned function in JS, you can do: <button onclick="getFunction()()">. Similar behaviour in Vue (and Nue)
- orangepanda 3y agoIts a typo then? onclick="addFruit" is not the same as onclick="addFruit()"
- tipiirai 3y agoThe onclick="addFruit" calls an instance method between the inner script tags. Similar to how JS would call a global window.addFruit with a similar syntax.
- orangepanda 3y agoKeyword being "similar", as in, not the same. Its neither the behaviour of html onclick attribute, nor dom onclick attribute.