Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Last active Jan 26, 2019
Embed
What would you like to do?
<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