AlpineJS unresolved variables Max Alekseyev 创建于 2024年07月14日 14:15 Alpine.data - Alpine is missing import settingsthis.$root, this.$el, this.$refs - unresolved variablesHow to prevent this and may be color this values?AlpineJS plugin installedunresolved variables
Have you downloaded the Alpine library file using the suggested quick-fix? It might help.
You can check it in “External libraries” section under your project files in the project view.
Please note that the IDE doesn't provide any Alpine.js-specific support: https://youtrack.jetbrains.com/issue/WEB-45677/Alpine.js-syntax-support. If you use Alpine.js Support third-party plugin feel free to submit issues to the plugin's developers in https://github.com/inxilpro/IntellijAlpine/issues.
Thanks a lot for the answer. I downloaded library as you offered, that fixed Img #2 problem, but not the first one
Could you please provide a complete code sample?
Shorten it
<script>
document.addEventListener('alpine:init', () => {
Alpine.data('moduleMain', (attrs) => ({
init() {
console.log(this.$root, this.$el, this.$refs);
}
}));
});
</script>
Thanks! Installing `@types/alpinejs` package should help in this case.
Tried to find how to do that by myself, but no success )
Create a package.json (if there is none in the project) and in the terminal run `npm install @types/alpinejs` command.
npm install @types/alpinejs working well, thanks!