|
|
@ -1,5 +1,5 @@ |
|
|
|
import { IMovie } from "@autoplex-api/request"; |
|
|
|
import { Mutation } from "../../store"; |
|
|
|
import { Action, Mutation } from "../../store"; |
|
|
|
import { defineComponent } from "vue"; |
|
|
|
|
|
|
|
export default defineComponent({ |
|
|
@ -20,12 +20,7 @@ export default defineComponent({ |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
movies(newValue, oldValue) { |
|
|
|
if (newValue.length > 0) { |
|
|
|
this.$store.commit(Mutation.StoreMovies, newValue); |
|
|
|
} |
|
|
|
if (oldValue.length > 0) { |
|
|
|
this.$store.commit(Mutation.FreeMovies, oldValue); |
|
|
|
} |
|
|
|
this.$store.dispatch(Action.UpdateMovies, { newValue, oldValue }); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |