父view
mounted() {
window.addEventListener('popstate', (obj) => {
if (obj && obj.state && obj.state.comp) {
this[obj.state.comp] = true
}
})
}
显示子view的地方:
history.pushState({ comp: 'showPickCarDateView' }, '')
回调的地方:
history.back();
子view
mounted() {
window.addEventListener('popstate', () => this.$emit('update:visible', false))
}