在SCSS(SASS)变量VUEJS中使用V-Bind
我正在研究Vuejs中的一个组件,我想制作一个颜色属性,该属性采用十六进制的颜色,并使用SASS的RGBA功能转换为RGB颜色并与之合作。
props: {
color: {
type: String,
default: '#195cff'
}
}
我试图这样做:
$color: v-bind(color);
input {
background: rgba($color, 0.5);
}
但是我认为在SASS变量中无法访问V-Bind。我该如何完成这项工作。
I'm working on a component in VueJs and I want to make a color attribute that take hexadecimal color and convert into rgb color with rgba function of sass and work with it.
props: {
color: {
type: String,
default: '#195cff'
}
}
I tried to do it like this:
$color: v-bind(color);
input {
background: rgba($color, 0.5);
}
But I think v-bind is not accessible in sass variable. How can I do this work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这绝对是不可能的,但是我找到了一种获得类似结果的方法。
和在CSS中
That's strictly impossible but I found a way to have a similar result.
And in css