Closed
Description
I'm commonly using props start with data-
. data-*
is recommended to exchange proprietary information. Through this way, I don't need to worry about the attribute that I use to exchange data will cause any impact on dom.
props: {
"data-checked": {
type: Boolean
}
}
If hyphenated prop names have been deprecated, I wish I can use props start with 'data-' like this in future:
<my-component data-checked></my-component>
props: {
"checked": Boolean
}
this.checked //true
And
<my-component data-my-msg="something"></my-component>
props: {
"myMsg": String
}
this.myMsg //"something"
If not find properer attribute, then
<my-component my-msg="something"></my-component>
props: {
"myMsg": String
}
this.myMsg //"something"