【发布时间】:2019-07-30 23:06:12
【问题描述】:
Vue css中是否有获取数据属性值的选项?
<template>
<p data-background="purple"> TEST </p>
</template>
<style lang="scss">
p {
background: attr(data-background); //error
&:after {
background: attr(data-background); //error
}
}
</style>
【问题讨论】:
标签: css vue.js sass styles custom-data-attribute