Created
July 26, 2021 12:03
-
-
Save zorca/99b030956092a434beb21649a4ea3649 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Vue({ | |
store, | |
render: h => | |
h(InertiaApp, { | |
props: { | |
initialPage: JSON.parse(app.dataset.page), | |
resolveComponent: component => { | |
let componentParts = component.split(":"); | |
let componentType = componentParts[0]; | |
let componentVendor = componentParts[1]; | |
let componentPackageName = componentParts[2]; | |
let componentName = componentParts[3]; | |
if (componentType === "packages") { | |
return require(`../../packages/${componentVendor}/${componentPackageName}/resources/js/${componentName}.vue`) | |
.default; | |
} | |
return require(`./${component}.vue`).default; | |
} | |
} | |
}) | |
}).$mount(app); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment