[vue3+vite+ts+element-plu+sass] uses bug records in sass

Problem Description

After following the online tutorial to build the system, I use sass because I like the bracket-free sass and stylus.
After using variables in the style tag in the .vue file later, $bgColor will report an error like Figure 1
figure 1

debug process

  1. I found a circle of tutorials on the Internet, and they all configured the vite.config.js file. The result is not applicable to the sass of this project, and an error is still reported:
    insert image description here
  2. I changed the configuration again, and still reported strange and hard-to-search errors T^T:
    insert image description here
  3. Then, as before, it was directly introduced in the style tag of the .vue file:
@import './style/xxxx'

Then it's all right - -, so far, I gave up the global introduction, and I will explore it later when I look back. I am tired, and the days when I can't find a solution are tired, and I am full of moving blogs.

  1. Attach the project to introduce dependencies
    insert image description here

Guess you like

Origin blog.csdn.net/qq_37291367/article/details/127670148