abautista
4/26/2018 - 5:19 AM

container compnents

const ServiceDetailContainer = {
    created() {
        const id = Number(this.$route.params.id, 10)
        store.dispatch("getService", id).then(() => {
            this.service = store.getters.service_detail()
        })
    },

    data() {
        return {
            service: null
        }
    },

    render(h) {
        if (!this.service) {
            return h(PlaceholderComponent)
        }
        return h(ServiceDetail, {
            props: {
                service: this.service
            }
        })
    }
}

export default ServiceDetailContainer