when writing props to the vue component, set the default value as follows, and an eslint syntax error appears: error: Type of the default value for ‘tableData’ prop must be a function (the default value for the tableData property must be a function).
props: {
tableData: {
type: Array,
default: [],
}
},
How does
change?Use Array/Object in props as default value.
props: {
tableData: {
type: Array,
default: () => [],
// 或者 default: function () { return [] }
}
},
div>
Read More:
- nvalid default value for prop “params“: Props with type Object/Array must use a factory function to
- [Vue warn]: Invalid prop: type check failed for prop “disabled“
- Type definition error – one of the causes of type definition errors is WM in Oracle_ Concat function usage
- Default constructor cannot handle exception type FileNotFoundException thrown by implicit super cons
- Solve the problem of using the default content type of JMeter
- error C4996: ‘scanf‘: This function or variable may be unsafe.Visual Studio Series compilers report errors using scanf function
- Front end project runtime prompts syntax error: typeerror: token.type.endswith is not a function solution
- After introducing sass into Vue project, start to report error typeerror [err]_ INVALID_ ARG_ Type]: the “path” argument must be of type string
- TypeError: object of type ‘builtin_function_or_method’ has no len()
- Type error: object (…) is not a function
- Tensorflow image random_ There seems to be something wrong with the shift function
- The browser requires that samesite by default cookies be disabled
- Please transfer a valid prop path to form item!
- Property or field ‘Title‘ cannot be found on object of type
- type of the byte recordError: webpackMerge is not a function
- Gulp error report, assertionerror [err_ ASSERTION]: Task function must be specified
- R language error in hist.default ():’x’must be a value
- RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the
- [C + +] C + + overload operator = must be a nonstatic member function?
- mysql workbench Error Code: 1046. No database selected Select the default DB to be used