Eslint Babel-Eslint will be put together
npm install eslint babel-eslint -g
or
npm install eslint babel-eslint -D
Eslint Babel-Eslint will be put together
npm install eslint babel-eslint -g
or
npm install eslint babel-eslint -D
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>