Compare commits
2 Commits
59b138be5e
...
20069bfe84
Author | SHA1 | Date | |
---|---|---|---|
|
20069bfe84 | ||
|
8c4f036431 |
@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<div class="panel-block" v-bind:class="{'disabled': element.loading}">
|
||||
<span class="icon is-pulled-left" v-if="canMove">
|
||||
<span class="icon is-pulled-left handle" v-if="canMove">
|
||||
<ion-icon name="move-outline"></ion-icon>
|
||||
</span>
|
||||
|
||||
<input type="checkbox" v-model="element.checked" v-on:change="updateItem(element)">
|
||||
<input type="checkbox" v-model="element.checked" v-on:change="updateCheckbox(element)">
|
||||
<div class="field is-horizontal has-addons">
|
||||
<div class="control">
|
||||
<input class="input" type="text" v-bind:disabled="element.checked" v-model="element.content"
|
||||
v-on:blur="updateItem(element)">
|
||||
v-on:blur="updateContent(element)">
|
||||
</div>
|
||||
<div class="control">
|
||||
<a class="button is-danger" v-on:click="deleteElement(element)">
|
||||
@ -29,9 +29,12 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateItem: function () {
|
||||
updateCheckbox: function () {
|
||||
this.$emit('updateItem', {id: this.element.id, checked: this.element.checked}, true)
|
||||
},
|
||||
updateContent: function () {
|
||||
this.$emit('updateItem', {id: this.element.id, content: this.element.content}, true)
|
||||
},
|
||||
deleteElement: function () {
|
||||
this.$emit('deleteElement', this.element.id)
|
||||
}
|
||||
|
@ -29,7 +29,8 @@
|
||||
v-model="searchResults"
|
||||
group="listItems"
|
||||
@change="onChange"
|
||||
item-key="id" v-if="searchQ.length <= 0">
|
||||
item-key="id" v-if="searchQ.length <= 0"
|
||||
handle=".handle">
|
||||
<template #item="{element}">
|
||||
<ListItem v-bind:item="element" v-bind:can-move="!element.checked" v-on:updateItem="updateItem" v-on:deleteElement="deleteElement"></ListItem>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user