You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
588 B

import { IMovie } from "@autoplex-api/request";
import { Action, Mutation } from "../../store";
import { defineComponent } from "vue";
export default defineComponent({
computed: {
storedMovies(): IMovie[] {
return this.$store.getters.movies(this.movies);
}
},
unmounted() {
if (this.movies.length > 0) {
this.$store.dispatch(Action.UpdateMovies, { newValue: [], oldValue: this.movies });
}
},
props: {
movies: {
default: <IMovie[]>[]
}
},
watch: {
movies(newValue, oldValue) {
this.$store.dispatch(Action.UpdateMovies, { newValue, oldValue });
}
}
})