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
- SQL Error: 0, SQLState: 08S01 & Communications link failure
- Solution to prompt “cannot find module ‘eslint config defaults / configurations / eslint’” when submitting with Git
- Use of HQL query.list () is a null pointer exception, but the database can find out the result
- Solution of “do not use ‘new’ for side effects” for eslint verification of Vue project
- Unknown custom element: <component> – did you register the component correctly
- Uncaught Error: _registerComponent(…): Target container is not a DOM element
- Array initializer is not allowed here
- JavaScript summary: the difference between typeof and instanceof, and Object.prototype.toString() method
- Expected indentation of 6 spaces but found 10
- C + +: error in X utility file
- org.apache.ibatis.type.TypeException: Error setting non null for parameter #4 with JdbcType null
- React bootstrap loading and how to use modules
- Higher order components in react
- Please transfer a valid prop path to form item!
- Exploring the streaming call of underscore
- Arrow function should not return assignment no-return-assign
- RuntimeError: each element in
- Front end project runtime prompts syntax error: typeerror: token.type.endswith is not a function solution
- Typeerror: UFUNC ‘isn’t supported for the input types