Vue globally defined scss variables such as $red:-sharpf00, cannot be directly referenced in components such as background: $red

common.scss is introduced globally in vue projects, and globally defined scss variables and mixin cannot be used in header components
common.csss:

$color_active:-sharp4381E6;

header.vue:

.cp_header{
    background: $color_active;
}
Mar.09,2021

style tag scoped this problem occurs


you need to configure sass-resources-loader
npm install sass-resources-loader-- save-dev

if you want to use it globally.

utils.js

scss: generateLoaders('sass').concat(
      {
        loader: 'sass-resources-loader',
        options: {
          resources: path.resolve(__dirname, '../src/assets/xxxx.scss')
        }
      }
    )
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37207-2c086.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37207-2c086.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?