-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Open
Labels
✨ feature requestNew feature or requestNew feature or request
Description
What problem does this feature solve?
Reading the documentation, searching the web and the issues list here, it seems prop validator for 'Array Of Type' dont exist.
This feature enables the following things:
- Vue out-of-box validation array of types
- Allow PyCharm and other IDE vendors to easily create type hinting based on prop type
- Allow linters to easily validate vue template according to prop type
I understand the answer might be "you should use TypeScript", but I have a fairly decently typed javascript project, and would like to try to keep it that way while praying js types will be approved in the future.
What does the proposed API look like?
Constrained by the javascript language, and your current design, these are my suggestions
import { ArrayOf, Of } from 'vue'
export default {
props: {
suggestionA: {
type: ArrayOf,
of: SomeClass
},
suggestionB: {
type: Array,
of: SomeClass
},
suggestionC: {
type: Array,
arrayOf: SomeClass
},
suggestionD: [Array, Of, SomeClass],
suggestionE: ArrayOf(SomeClass)
}
}
adamreisnzadamreisnz
Metadata
Metadata
Assignees
Labels
✨ feature requestNew feature or requestNew feature or request