Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<div class="column" id="todoAppWidget" style="display:none">
<div class="center">
<div>Enter your item</div>
<input type="text" id="todo-input" />
<button @click="add">Save</button>
<li r-for="item,i in this.todos">
${item} <a @click="remove" data-index="${i}">Remove</a>
<script type="module">
import reLift from '../src/index.js';
el: '#todoAppWidget',
data: {
todos: [
'Take dog to school',
'Eat dinner',
'Code more'
add() {
const input = this.el.querySelector('#todo-input');
if (input.value) {;
remove(e) {
const index = parseInt('data-index'));, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment