<style lang="stylus" scoped>
$width = 30px
.input {
.input_default {
outline none
border none
width $width
}
.input_border{
border 1px solid #ddd
}
}
</style>
打算封装一个input组件,然后input的宽度可以动态可配置,由父组件传入,stylus里面的$width = 30px 这里的30px 可以做成动态可配置的么?
不可以。通过
:style
来搞吧。