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

请问图片怎么引入 #6

Open
l511407563 opened this issue Apr 2, 2019 · 0 comments
Open

请问图片怎么引入 #6

l511407563 opened this issue Apr 2, 2019 · 0 comments

Comments

@l511407563
Copy link

你好,请问有没有图片的例子
vars.less
@import "antd/lib/style/themes/default.less";
@link-color: #00375B;
@primary-color: #00375B;
@images: url('
@/assets/images/bg1.png'); // @ 是设置的 src目录
:root {
--image: @images;
--primary-color: @primary-color; //color.less中加入css原生变量:--PC
}

调用的less
.home {
// background-color: var(--primary-color); // 这么调用颜色成功了
background-image: var(--image); // 这么调用图片返回 background-image: url(http://localhost:3000/~@/assets/images/bg1.png);
background-position: 100% 100%;
background-repeat: no-repeat;
}

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