Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check for if _Ctor is object #354

Merged
merged 1 commit into from
Apr 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/@averjs/vue-app/templates/entry-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,15 @@ import { applyAsyncData, composeComponentOptions, sanitizeComponent } from './ut
deepMapChildren(children, components, routes) {
for (const child of children) {
// Compare the components ctor to find only router components
const isRoute = routes.find(r => r === child.$options._Ctor[0]);
const isRoute = routes.find(r => {
let found = false;
for (const ctor of Object.keys(child.$options._Ctor || {})) {
if (r === child.$options._Ctor[ctor]) {
found = true;
}
}
return found;
});
if (isRoute) components.push(child);
// If App.vue component has no asyncData, push it anyway so that hmr works if it gets added later.
// Because the App.vue component always is the entry point we check if the parent is the root instance.
Expand Down