Skip to content

Not able to use variable declared in less file #3689

Discussion options

You must be logged in to vote

In a Vue file, when you add a pre-processor, each <style> block is compiled independently. Same with a .less import into the <script> block. These are two separate rendering processes which don't know about each other.

So, you need to move this to a native Less @import in the <style> block. Some loaders also allow you to "auto-inject" an import at the head of the <style> block, I think.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@HenriqueAurelio
Comment options

Answer selected by iChenLei
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants