Commit 4af97d30 authored by Evan You's avatar Evan You

fix state

parent 530a486c
......@@ -24,8 +24,6 @@ import Spinner from './Spinner.vue'
import Item from './Item.vue'
import { watchList } from '../store/api'
let isInitialRender = true
export default {
name: 'item-list',
......@@ -39,18 +37,12 @@ export default {
},
data () {
const data = {
return {
loading: false,
transition: 'slide-up',
// if this is the initial render, directly render with the store state
// otherwise this is a page switch, start with blank and wait for data load.
// we need these local state so that we can precisely control the timing
// of the transitions.
displayedPage: isInitialRender ? Number(this.$store.state.route.params.page) || 1 : -1,
displayedItems: isInitialRender ? this.$store.getters.activeItems : []
displayedPage: Number(this.$store.state.route.params.page) || 1,
displayedItems: this.$store.getters.activeItems
}
isInitialRender = false
return data
},
computed: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment