Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Last active January 26, 2019 14:18
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 uno-de-piera/80aa0c651716c344db62c19ace1c1571 to your computer and use it in GitHub Desktop.
Save uno-de-piera/80aa0c651716c344db62c19ace1c1571 to your computer and use it in GitHub Desktop.
<template>
<b-container>
<render-less-list-todos v-model="todos">
<div slot-scope="{ todos, removeTodo, inputAttributes, inputEvents }">
<b-list-group>
<b-list-group-item v-for="todo in todos">
{{ todo }} <b-btn variant="danger" class="float-right" @click="removeTodo(todo)">Eliminar</b-btn>
</b-list-group-item>
</b-list-group>
<b-form-input
placeholder="Añade una nueva tarea"
@input.native="inputEvents.input"
@keydown.native="inputEvents.keydown"
v-bind="inputAttributes"
></b-form-input>
</div>
</render-less-list-todos>
</b-container>
</template>
<script>
import RenderLessListTodos from '@/components/RenderLessListTodos.vue'
export default {
components: {
RenderLessListTodos
},
data () {
return {
todos: ['todo 1']
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment