代码如下
`
import { _decorator, Component, Node } from ‘cc’;
const { ccclass, property } = _decorator;
@ccclass(‘Test’)
export class Test extends Component {
@property
showKey: boolean = false
@property({
visible(this: Test) {
return this.showKey;
}
})
key: number = 1
}`
在编辑器里将showKey的值切换两次之后,key属性在编辑器里再也不显示了,reset组件也不行。
不知道3.x怎么用Editor.log来调试visible函数,不知道是哪里出了问题,求官方大大看看