Skip to content

Instantly share code, notes, and snippets.

@mardix
Last active April 19, 2019 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mardix/eb3d611c3306f32bc45f51fedfa6b7ac to your computer and use it in GitHub Desktop.
Save mardix/eb3d611c3306f32bc45f51fedfa6b7ac to your computer and use it in GitHub Desktop.
relift-example-counter.html
<div>
<div class="column center" id="counterWidget">
<div><h4>${this.count}</h4></div>
<div>
<button @click="down" class="button-outline">DOWN</button>
<button @click="up" class="button-outline">UP</button>
</div>
</div>
</div>
<script type="module">
import reLift from '../src/index.js';
reLift({
el: '#counterWidget',
data: {
count: 0,
},
up() {
this.data.count++;
},
down() {
this.data.count--;
},
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment