Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法自定义 scss 变量 #2622

Open
1 task done
jinmarcus opened this issue Nov 2, 2024 · 1 comment
Open
1 task done

无法自定义 scss 变量 #2622

jinmarcus opened this issue Nov 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jinmarcus
Copy link

可复现的链接(包含复现链接与示例代码):

https://github.com/x-extends/vxe-table/blob/master/styles/variable.scss

问题描述与截图:

使用范例修改变量报错

@use 'vxe-table/styles/variable.scss' with (
     $vxe-ui-font-color: #999999,
     $vxe-ui-font-primary-color: #ff0000
 );
@use 'vxe-table/styles/all.scss';

报错内容如下:

[plugin:vite:css] [sass] This variable was not declared with !default in the @used module.
  ╷
4 │               $vxe-ui-font-color: #999999,
  │               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵

vite 配置如下

css: {
     preprocessorOptions: {
          scss: {
               api: 'modern-compiler',
                    additionalData: `@use "@/assets/style/variables.scss" as *;`,
               },
          },
}

如果将 vxe-table/styles/variable.scss 中的变量修改成以下,则正常:

$vxe-ui-font-color: #999999 !default;
$vxe-ui-font-primary-color: #ff0000 !default;

期望的结果:

No response

操作系统:

window 10

浏览器版本:

chrome

vue 版本:

3.5.12

vxe-pc-ui 版本:

4.2.37

vxe-table 版本:

4.7.97

是否使用当前最新版本?

  • 我已确认是使用当前的最新版本并已按要求提供复现链接与示例代码。
@jinmarcus jinmarcus added the bug Something isn't working label Nov 2, 2024
@wangxuefei95
Copy link

wangxuefei95 commented Nov 12, 2024

image
image
版本4.8.10 同样的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants