function init(Vue, options) { const route = { data: null, id: null } function setData(data) { route.data = data route.id = String(Date.now()) return route.id } function getData(id) { return id === route.id ? route.data : null } Vue.prototype.$wxRouter = { setData: setData, getData: getData } Vue.prototype.$wxRoute = route } const vueWxRouter = { install: init } export default vueWxRouter