mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
improve properties declaration (#3842)
* improve properties declaration * cherry pick: CCClass: allow array type working togather with getter (#3545) Commit: 37f4f06419a7b6a68283a4d1e46ff937bdccb941 [37f4f064]
This commit is contained in:
@@ -18,7 +18,6 @@ export class RenderableComponent extends Component {
|
||||
}
|
||||
|
||||
@property({
|
||||
default: [],
|
||||
type: Material,
|
||||
displayName: 'Materials',
|
||||
})
|
||||
|
||||
@@ -136,9 +136,8 @@ function checkUrl (val, className, propName, url) {
|
||||
|
||||
function parseType (val, type, className, propName) {
|
||||
if (Array.isArray(type)) {
|
||||
if (CC_EDITOR) {
|
||||
var isArray = cc.Class.isArray; // require lazily to avoid circular require() calls
|
||||
if (!isArray(val.default)) {
|
||||
if (CC_EDITOR && 'default' in val) {
|
||||
if (!cc.Class.isArray(val.default)) {
|
||||
cc.warnID(5507, className, propName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user