Lines Matching refs:null
105 ## cl.arkui.2 AppStorage,LocalStorage,PersistentStorage支持undefined和null
113 …torage,PersistentStorage的API方法支持null和undefined作为入参。@StorageLink,@StorageProp,@LocalStorageLink,@Lo…
115 …torageLink为例,当前应用存在误用null和undefined作为初始值或目标值在AppStorage中保存的情况。在更改前的语义中,null和undefined作为初始值或目标值的调用并…
124 AppStorage.setOrCreate("PropA", null);
125 AppStorage.has("PropA");// 不支持设置null或undefined,会返回false
147 AppStorage.setOrCreate("PropA", null);
148 AppStorage.has("PropA");// 支持设置null或undefined,会返回true
157 Text(this.propA.num.toString()) //使用AppStorage初始化的值 ‘null’ ,调用时触发JsCrash
206 1、在初始化值的时候不使用null或者undefined的值来初始化,使用有意义的值来初始化。
208 2、将原有的值改为null或undefined会触发UI刷新。
217 AppStorage.setOrCreate("PropA", null);
218 AppStorage.has("PropA"); // 支持设置null或undefined,会返回true
223 @StorageLink('PropA') propA: PropA | null | undefined = new PropA();
227 Text(this.propA?.num.toString())//使用时进行判空,防止调用时为null和undefined的情况造成crash。
229 Button("Set propA to null")
232 this.propA = null;