We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, I would like to get some help understanding why my counter component is unresponsive.
You can see the source code here:
import { Slim } from 'slim-js'; const template = /*html*/` <style> * { font-size: 200%; } span { width: 4rem; display: inline-block; text-align: center; } button { width: 4rem; height: 4rem; border: none; border-radius: 10px; background-color: seagreen; color: white; } </style > <button @click="this.dec">-</button> <span>{{this.count}}</span> <button @click="this.count++">+</button> `; class MyCounter extends Slim { constructor() { super(); this.count = 0; } inc() { this.count++; } dec() { console.log('dec'); this.count--; } } Slim.element( 'my-counter', template, MyCounter );
Thanks in advance. Charlene
The text was updated successfully, but these errors were encountered:
Hi.
Simple changes would make it work...
import 'slim-js/directives';
<button @click="this.inc()">
this.inc
Hope this helps.
Full code below.
Closing the issue, please re-open if you have more questions/problems.
import { Slim } from 'slim-js'; import 'slim-js/directives'; const template = /*html*/` <style> * { font-size: 200%; } span { width: 4rem; display: inline-block; text-align: center; } button { width: 4rem; height: 4rem; border: none; border-radius: 10px; background-color: seagreen; color: white; } </style > <button @click="this.dec()">-</button> <span>{{this.count}}</span> <button @click="this.inc()">+</button> `; class MyCounter extends Slim { constructor() { super(); this.count = 0; } inc() { this.count++; } dec() { console.log('dec'); this.count--; } } Slim.element( 'my-counter', template, MyCounter );
Sorry, something went wrong.
Thank you very much for your answer.
No branches or pull requests
Hello,
I would like to get some help understanding why my counter component is unresponsive.
You can see the source code here:
Thanks in advance.
Charlene
The text was updated successfully, but these errors were encountered: