在app.vue 里面定义了一个变量
<style lang="less">
@baseBackGroundColor : #409EFF;
@baseBackColor :#F8F8F8;
</style>
然后我在登录页面调用:
.portrait-row text:nth-child(2){
float: right;
color: @baseBackGroundColor;
}
编译后报错:
13:25:56.371 Module build failed:
13:25:56.371 border-radius: 8rpx;
13:25:56.371 background:@baseBackGroundColor;
13:25:56.372 ^
13:25:56.372 Variable @baseBackGroundColor is undefined
13:25:56.372 in D:\php\HB_aisuizhou_app\APP\pages\ucenter\login.vue (line 177, column 12)
13:25:56.372 Module build failed: ModuleBuildError: Module build failed:
13:25:56.372 border-radius: 8rpx;
13:25:56.373 background:@baseBackGroundColor;
13:25:56.374 ^
13:25:56.374 Variable @baseBackGroundColor is undefined
13:25:56.374 in D:\php\HB_aisuizhou_app\APP\pages\ucenter\login.vue (line 177, column 12)
13:25:56.374 at runLoaders (D:\php\HBuilderX\plugins\uniapp\node_modules\webpack\lib\NormalModule.js:192:19)
13:25:56.375 at D:\php\HBuilderX\plugins\uniapp\node_modules\loader-runner\lib\LoaderRunner.js:364:11
13:25:56.375 at D:\php\HBuilderX\plugins\uniapp\node_modules\loader-runner\lib\LoaderRunner.js:230:18
13:25:56.375 at context.callback (D:\php\HBuilderX\plugins\uniapp\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
13:25:56.375 at <anonymous>
13:25:56.376 at runMicrotasksCallback (internal/process/next_tick.js:121:5)
13:25:56.376 at _combinedTickCallback (internal/process/next_tick.js:131:7)
13:25:56.376 at process._tickCallback (internal/process/next_tick.js:180:9)
SimpleJalon (作者)
哦,不能支持下 一次性直接引入吗?每次引入好麻烦的样子.
2018-08-24 11:46
1***@qq.com
还有,单独放在一个文件里面修改后不会自动编译相关引用的文件
2018-10-20 11:29
1***@qq.com
回复 SimpleJalon:解决了吗?
2019-03-28 11:10