Skip to content

Commit

Permalink
Implement frame deletion funcitionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroldo de Oliveira Pinheiro committed Aug 19, 2021
1 parent 2620786 commit 1429aa2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/PlayerEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<v-card>
<v-card-title>Delete this frame?</v-card-title>
<v-list>
<v-list-item>
<v-list-item @click="handleDeleteFrame(animation, frame)">
<v-list-item-icon>
<v-icon>mdi-check</v-icon>
</v-list-item-icon>
Expand Down Expand Up @@ -180,14 +180,18 @@ export default defineComponent({
state.value.animations[0].frames.push(newFrame);
console.info('Added frame', state.value.animations[0].frames);
console.info('Blah', state.value);
handleChildChange();
instance.proxy.$forceUpdate();
};
const handleDeleteFrame = (animation, frame) => {
animation.frames = animation.frames.filter(({id}) => id != frame.id);
console.info('Deleted ', frame);
handleChildChange();
instance.proxy.$forceUpdate();
};
return {state, handleChildChange, handleAddFrame, props};
return {state, handleChildChange, handleAddFrame, handleDeleteFrame, props};
},
});
</script>
Expand Down

0 comments on commit 1429aa2

Please sign in to comment.