ekwoka / alpine-plugins

Mono repo for various Alpine plugin packages
8 stars 2 forks source link

Can't access data from parent component when using a base href #23

Open simonferndriger opened 1 month ago

simonferndriger commented 1 month ago

When I use <base href="../"> in the file where I include html files with x-ajax, the base href is used (surprisingly) for the include path (which is cool), but also additionally somehow which messes the include up, because the included file loses somehow access to the data from the parent component in that case.

ekwoka commented 1 month ago

Can you show some code and context for what you mean?

How do you mean it loses access to the parent scope?

simonferndriger commented 1 month ago

Sure, but for now I only know that the include can't access "page" anymore, which is defined in the <html x-data="$"> component and works well in the include, if there is no base href used in the index.html including the include.

Example:

Does this help?