Skip to content
Advertisement

Vue pass arrow function for input rules to Stancil component

I’m trying to pass arrow function which will work as input rules like in Vuetify https://vuetifyjs.com/en/api/v-input/#rules. So I’m passing rules in array with code:

JavaScript

Then I want to check It in Stencil component with console log via watcher but It returns undefined:

JavaScript

Advertisement

Answer

When you want to pass a rules prop which can be an array or object then you need to pass it as :rules.prop="[array]"

In your case, it should be something like

JavaScript
Advertisement