Props
import { alwaysInvalidateWithWarning } from '@bbc/front-end-kit/vue/utils/props.js'
Utility functions for Vue component prop definitions.
API
alwaysInvalidateWithWarning (v, message)
Prop validator that logs a console warning when the prop has a value, but always returns true to keep the prop valid. Contrary to its name, it never actually invalidates.
Useful for deprecating props while maintaining backwards compatibility.
Parameters:
v:any— The prop value to check. Warning is logged only when truthy.message:String— The warning message to display in the console.
Returns: Boolean — always true
Tips
deprecatedProp: {
type: String,
default: null,
validator: (v) => alwaysInvalidateWithWarning(v, '"deprecated" prop is deprecated, use "X" instead.')
},