温馨提示:文本由机器自动转译,部分词句存在误差,以视频为准
00:00
来,我们再去写一下这几个方法啊,呃,这几个方法主要是判断当前想示的对象是属于通过什么方式来创建的,那ref呢?那就看看当前对象是不是通过ref的方式来创建的,或者说是不是一个ref对象啊,那依次往后类推,Is,还有is only,还有这个is proxy,看看他们是不是呃方式创建的对象,或者说read only创建对象,那如果is proxy的话,他要去检测当前对象是不是通过或者是read only的方式创建的对象。那这几个东西呢,咱们直接拿过来啊看一看。比较简单,所以说我在这边直接复制过来。然后把它们加上一个注释。哎,好放在这啊呃,来上一个setup就可以了,括号括号啊,Return一个对象,那我就在这里边去写代码啊,然后上面改一下,这个是响应式数据的判断,哎,并不复杂,直接拿过来用就行了啊。在这写啊,那cancel.log括号,那第一个呢,是判断当前这个对象是不是一个ref对象,那我怎么做呢?A ref回车一下啊,括号ref回车一下,括号里边我再来一个对象,那这样呢,它就是在判断。
01:13
咱们当前这个对象是不是一个ref对象。我们打开这个界面呢,现在来看一下,大家看一下结果是true,哎,说明当前这个对象呢,确实是属于一个if对象,好,那下一个。can.log括号is也是is reac回车括号reac。回车括号,我再来一个对象啊,那我就把它拿过来。好,放在这儿保存一下,我们再来看一下效果。大家看一下也是处啊,那为什么有两个处啊,因为这个没有刷新啊,刷新一下就好了啊,那是两个处,说明当前这个对象确实是通过的方式来创建的,好下一个。依次往后类推啊,我把这两个都拿过来。
02:01
咱们直接把它写完就OK了。好,cancel.log括号啊,Is read only,那我要看看它是不是通过read only的方式来创建的这么一个对象,好,那我就直接来一个is read read only回车括号,Read only。回车括号来一个对象啊,下边这个我也这么写了啊呃,pencil.log括号来一个什么呢?Is pro proxy proxy,回车括号再来一个什么呢?那这块啊,需要注意一下啊。那我这块可以直接看看他来一个read only也行,嗯。回车来一个对象,是不是因为这个is pro,它可以检测对象是否由read物的方法创建的,或者说是方法去创建的,当然我在这个位置写上一个R。啊,这也是可以的,然后现在我们做一个保存。已刷新。大家看一下都是处啊,那这有这么几个方法,好,那这块呢,咱们就演示完了啊,OK,先到这里。
我来说两句