[Vuejs]-VueJs add non-reactive prop from parent to custom component?

0👍

To get a non-reactive field, use a regular HTML attribute instead of a declared property, and access it via the component $attrs object.

I would go with the Vue property though. It is typesafe, validated, and the overhead is insignificant.

<my-element currency='12' />
const currency = parseFloat(this.$attrs.currency)

Leave a comment