AlpineJS unresolved variables

Alpine.data - Alpine is missing import settings

this.$root, this.$el, this.$refs - unresolved variables

How to prevent this and may be color this values?

AlpineJS plugin installed

unresolved variables

0
8 comments

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. 

0

Thanks a lot for the answer. I downloaded library as you offered, that fixed Img #2 problem, but not the first one

0

Could you please provide a complete code sample?

0

Shorten it 

<script>
   document.addEventListener('alpine:init', () => {
       Alpine.data('moduleMain', (attrs) => ({

           init() {
               console.log(this.$root, this.$el, this.$refs);
           }

       }));
   });
</script>

0

Thanks! Installing `@types/alpinejs` package should help in this case.

0

Tried to find how to do that by myself, but no success )

0

Create a package.json (if there is none in the project) and in the terminal run `npm install @types/alpinejs` command.

0

npm install @types/alpinejs working well, thanks!

0

Please sign in to leave a comment.