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

[Bug Report] Inline JavaScript is not enabled #82

Open
stonemakers opened this issue Apr 22, 2019 · 1 comment
Open

[Bug Report] Inline JavaScript is not enabled #82

stonemakers opened this issue Apr 22, 2019 · 1 comment

Comments

@stonemakers
Copy link

vux-loader version

1.2.9

OS/Browsers version

Google Chrome 已是最新版本 版本 73.0.3683.103(正式版本) (64 位)

Vue version

2.5.20

Code

在less文件中用该方式动态改变less中的变量
@color-theme: `document.getElementById("color-theme")`;

报错内容:
Module build failed: 
// @color-theme: #5A9267;
@color-theme: `document.getElementById("color-theme")`;
            ^
Inline JavaScript is not enabled. Is it set in your options?




网上给的解决方案是修改webpack,添加如下行
{ loader: 'less-loader', options: { javascriptEnabled: true } }
但是不知道vux该如何修改?

Steps to reproduce

在less文件中用该方式动态改变less中的变量
@color-theme: document.getElementById("color-theme");

What is Expected?

期望不会报错,并且可以通过js的方式进行动态更改less

What is actually happening?

编译失败

@stonemakers
Copy link
Author

@airyland

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant