Subscribe on changes!

props cannot be used in validator

avatar
Oct 21st 2020

Version

3.0.0

Reproduction link

https://codepen.io/pen/

Steps to reproduce

When a prop is used in another prop validator it throws this error. buttonIcon and buttonStyle are both props.

buttonIcon: { required: function() { if (this.buttonStyle.includes("icon")) { return true; } return false; }, type: String, default: false },

error: vueButton.vue?9d78:115 Uncaught TypeError: Cannot read property 'buttonStyle' of undefined at _default (vueButton.vue?9d78:115)

runtime-core.esm-bundler.js?5c40:38 [Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next at <VueButton buttopName="toggleNav" buttonStyle="icon" buttonIcon="fas fa-bars" ... > at at at

What is expected?

I should be able to use prop inside on other for a definition or within validator functions.

What is actually happening?

It throws an error with undefined

error: vueButton.vue?9d78:115 Uncaught TypeError: Cannot read property 'buttonStyle' of undefined at _default (vueButton.vue?9d78:115)

avatar
Oct 22nd 2020

incorrect reproduction link @HrishikeshKarale

avatar
Oct 22nd 2020

See https://github.com/vuejs/vue/issues/11445 Please don't open bug reports without reproductions