用过 v e 三的同学经常用 if reality 这两块片,看他的官方文档的时候,他会有这样的片,就会在这个前面加上 c 楼,那么咱们今天看看他到底是干嘛的, 直接来看代码,这个地方是我定了一个对象,这是他的一些属性,那么我在这个对象我定义的是 cello realtale, 在这个模板里面做了显示,点击这个名字的时候,他后面给我加上聊前端, 我点击年龄的时候,他会加一,那么我点击这个运动,修改运动的时候,他会在后面加三个感叹号,包括这个水果也是加三个感叹号,那么咱们看一下效果。注意这地方是定义的是 cello realtale, 修改名字的时候,那么他会加上要前端,那么我修改年龄的时候他会加一, 那么我点修改运动看到没有,他没有任何变化,包括修改水果也没有任何变化,我就可以断定这个的片是它的作用。把纸对最外层的这个数据属性定义成象形式的,如果有一个对象,你的成绩结构比较深, 但他变化的只是这个外层的属性,就第一层属性他的使用场景呢?给大家分析一下。正常的话,咱们的数据是通过阿联克斯 从后端获取的,如果这个时候后端反复的数据结果他是这样的,比如 a 里面包对象, b 里面也包对象, c 里面也包对象,那么这个时候成绩是比较深的。 你要知道就 vie 的,它的响应是,它默认是深度的,如果是数据量巨大的时候,深度的响应就会导致有不少的这种性能。 如果我访问每一个属性,我访问 a 点 b 点 c, 那么都将触发代理的疑点,最终他的应用场景其实是在处理这种大型输出或成绩比较深的这种对象时。比如说你如果一次性渲染需要访问一万个或者十二个属性时,那么他的效果才比较明显。 因此其实这种影响只有在少数的这种特定场景下。所以说 vue 他提供了一种这个方案,就是提供了这两个 sedim reheartal 和 sedim i f 来绕开这种深度的响应, 对所有深层次的对象诉苦,不会做任何处理,在深层次的访问的时候,速度就会变得非常快。但是有一个前提,也就是说我们这种深层次的对象,你确定他视为这种不可变的?同时这个也是一个面试题,因为简单的这样的 我相信大家都会使用,也就是说你面试的时候啊,如果面试官问这样这种项目当中经常用的 api, 我相信四个前端大家都能打上来,那么你怎么样和别人拉开差距?可能面试官就会出于这种特定的场景,我可能会问你,像他的使用场景, 或者说他有可能反过来问你,如果这个时候后端的数据量比较大,而且这种对象速度的升级比较深,你有没有其他的解决思路,解决方案?所以说我们要灵活的去学习掌握 vivo e 官网的每一个 api, 它的使用场景。
粉丝5.2万获赞45.7万


同学们好,今天我们来学习如何跑起来,我们的第一个 vivo 项目,首先第一步呢,我们就是先安装,这里呢是官方的下载地址 啊,我这里呢已经安装过了,小伙伴们可以去官网自己去下载。然后先先说一下 vv 的兼容性, vivo 呢,不支持 i 一八以下的版本,因为 vivo 使用了 i 一八无法模仿的 es 五的特性,但是他支持所有兼容 es 五的浏览器。 我们下载之后就可以直接用 suvpe 的标签引入,不用呢就会被注册为一个全局闭眼量,类似于几块锐的刀刃。我们下载 成之后呢,这里有一个呃小小的呆萌,这是 vivo 的基础使用方法。这是一个小呆萌啊,大家可以看到红色的字体 啊。首先第一个 vym 等于六六,这个是什么呢?这个就是,嗯, 每个 vivo 应用都是通过 vivo 函数创建了一个新的根实力开始的。然后这个 el 呢,是一个挂载点,表示 vivo 实力接管了对 id 等于 a p p 这个 div 这个元素的一个控制。 这个呢是数据,这个是用来存放数据的一个地方。而这个红色的 mac 机呢,就是模,就类似于模板的呃, 语法在这里是模,模板中的文本差值表示此处插入的 mac 机变料所储存的数据。那我们把这个单某复制一下啊,放到编辑器里面来跑一下 啊。这里就是刚才我下载好的 vivo e g s, 我们把它呃靠配进去,然后去 去跑起来哦。大家可以看到这里, 你的 hello word 已经在呃页面上展示出来了,也就是说,我们的第一个 vivo 项目的就已经算是跑起来了。但是呢,有些小伙伴可能想想把这个,觉得这个 helloword 觉得不好不好,想换一个啊,想叫一个什么呢? hello vivo e, 那么我们就可以直接在这个 mac 机里啊啊,改成 hellobue, 然后我们保存一下,你看页面就已经就是 变成了 hello bue 了,然后为什么会这样子呢?让大家看啊,对他的数据呢,他是响应式的,在代码中呢,或者控制台改变,就刚才那个麦 cg 的值,你就会发现呢,试图他会重新渲染,也就是说呢,当一个没有实力被创建之后, 创建时,他向 vivo 的响应是系统加入了其贝的对象能够找到的所有属性,当这些属性的值发生改变的时候呢,试图就会产生响应及匹配更新为新的值 啊。我们今天的课程就到这里,然后感谢大家的观看,我们下个视频再见。

来写这个 a p i 的这个方法, 我们数数 a p i 吧, 使用的时候需要返回这么几个参数,第一个就是返回来我们的这个提示信息,就 msd, 那我们就可以定义一个得了。 msd 等于先默认为空,然后还有里面有一个 数据,那我们同样到这一场等于空,数组还有个扣的,这个扣的的话我们默认为两百,他是状态码,状态码的话我们可以 呃,是两百呀,四零四呀这一类的,同样我们可以再设置一个错误码, 就是有可能我们报错了,我先试一下三个九吧,四个九,有可能,我们有可能我们报错了,我们需要去怎么去调整来,现在我我们来 reten 使用性 pp 里面封装好的这个 jason 的这个数组就可以,它这个里面前面是一个 数据,后面是一个状态,这个状态的话我们就可以把扣子传进去,这数据的话我们可以传上一个 result, 那这个 result 没有定义,我们需要去定义一下,到了 result 等于我们这个数组 出组的情况下,我们需要去怎么去操作呢?我们首先它里面有个其实信息,我们使用常过来的 mse, 同样数据我们推过来, 这样我们就会返回来一个 jason 的一个数据,那我们, 嗯,我们可以直接访问一下,访问一下这个 重启哈, jason 收 a p i, 看,这样就返回来我们需要的这个 jason 的这个格式,那同样我们返回到 我们这边的数据,我们可以 return 一下, return, 你前面的验证是要加啊,你们加完验证之后,错误码的话,你可以指定一个对应的错误码,然后呃错误信息你也可以自己去指定,也可以是后台,就是呃 validit 里面你可以自定义的这些错误信息, 我们直接就可以 dollar this, 我们这个方法里面呢收 api, 我们现在需要去传这个参数了, 这就是,嗯, a d d, 我们就说插入成功, 当然这个是要跟模型去关联的,关联之后模型那边返回来,如果成功的话,我们再去调用这个 ap 的这个接口,那数据的话我们就到了这个传过去, 然后 code 那肯定就是两百,错误码的话,我们就我们不填了, 默认,因为我们正常返回了吗?然后我们再去在这这个里面去调用的时候,看一下我们这边的代码, 我们打印一下,我们就知道我们返回来了没有, 我们先看一下控制台啊,刷新一下一二三,一二三,看到没有插入成功。迪塔,迪塔也有,迪塔里面数据是内蒙一二三,遇到内蒙 一二三,这,这就是我们需要拿到的这个结果,我们拿到这个结果就可以做相应的事情。像一般情况下我们可以来判断一下 a f, 判断 r e s, 点 c o d 等于两百,那就证明我们请求成功了。请求成功之后我们可以呃打印一下这个 提示信息,我们把下面这个删掉,让他老是碍事,我们刷新一下,刷新完成之后我们就可以看到我们登录上号密码, 我们拿到数据了,然后我们还可以对应的提示信息告诉我们这个动作完成之后,我们就可以做相应的这个跳转呀,或者是怎么回事,当然你从这个 那我们去请求这个 a、 d、 p 的接口,我们可以看一下删掉,那我现在给加上一个。

哈喽,同学们好,这个节我们来讲一下我们的 watch 函数,那提到 watch 话,大家应该不陌生,对不对?用来干嘛的呀?哎,今天数据变化的,比如说我们下面这样的一个小案例, 咱们需要根据用户的一个输入关键词去后端呢拉取我们的数据,只要他输入的数据已变化,咱们就不断的从后端拉取不同的数据,你看这个小案例是不是就可以用我的 watch 去做一个实现呀? 哎, ok, 好,那在 vivo 三这边呢, watch 的一个基本的作用跟之前呢 vo 二呢是非常相似的,它依旧是用来征听一个或者多个数据的变化。在数据变化的时候呢,咱们可以执行一个回调函数, 同样的话,两个额外的参数他依然是保持的,一个是我们的立即执行,一个是我们的深度聆听,哎, ok, 好,那接下来呢,咱们就按照这样的顺序,我们先去实现他的 一个基本使用,真听一个或者多个。然后呢,咱们再给大家开启两个额外的参数,一个呢叫做立刻执行,一个叫做深度真听。好,我们先过来看一下如何去真听一个数据的变化好过来, 那如果我们想真听单个数据的变化的话,他的语法呢,大概这样来写两个步骤,第一步呢,咱们需要先导入这个函数啊,叫做 watch, 用谁导谁?第二步呢,你需要去执行这个函数,然后传过来一个要真听的显示数据,哎,以及一个回掉函数。 好,我们看他下面一个写法,大家看这里哦,第一步先导进来,哎,导入这个函数。第二步呢,你需要去调用这个函数,调他的时候呢,我们传过来两个参数,第一个参数要真听谁,你就把那个响音师的数据啊,把它放过来,这里呢, 咱们是一个 ref 哎,由它来产生的一个显示数据。那第二个参数呢,是一个回调函数,这个函数的意识呢,就是说当你监听的 count 发生变化的时候,这个回调函数呢,会不断的进行执行。 那这里边还有两个他自动给咱引入的参数,一个呢是变化之前的老值 oww, 一个是咱们变化之后的新值,叫做 newww。 好,那看完他的一个大概语法之后呢,接下来呢,咱们去打开我们的大码,咱给大家落地一下,好,回到我们的大码区域。 左边呢依旧是我们跑起来的一个项目,这里呢,我们打开它的一个跟组键,我们在这里边呢开始编码的动作。好,右边呢是它的一个预览的一个结果。好,这里呢我们准备了一些样板大码哈,大家看一个 count 数据,它呢是由 ref 产生的一个响应式的数据,一个修改它的方法叫做 set count。 那下面呢,我们用一个按钮绑定一下一个事件,然后这个地方呢实现的效果呢,其实就是大家熟悉那个点击自增,打开右边哈点它, 哎, ok, 就这样一个小效果。咱们这样做的目的呢,是为了用 watch 去征听一下我们 count 的一个变化。好,咱们过来写吧, 咋写来着,哎,写一个 watch 函数,上面呢会自动给咱导入。第一个函数呢是我们要真听的数据,我们要真听的不就是我们 com 的吗,对吧? 那第二个参数呢,是一个回调函数,代表 com 的变化时要执行的那个回调函数。那看到这里大家可能会疑惑哈,哎,这里怎么不加 点 value 呢?咱之前学过,不是要讲加吗?对吧?哎,这里注意哈,我们的 watch 里边呢,第一个参数 ref 呢,是不需要 加我们的点 y 六属性的哎,它会自动帮我们去处理哈,哎,这是一个需要注意的事项。好了,在里边呢,我们先简单的打一个 log, 咱们叫它 count 变化了,好保存一下。哎,过来,我现在要点击它了啊,大家注意观察一下,当 count 的变化时,这个地方呢,有没有打印出来,如果有的话,那证明是不是已经生效了呀?好,我们过来点击哦,大家注意观察 点。哎,这里变成一看变化了。点,变成二,这里变化了,那证明咱对于 com 的一个真听是不是就已经深造了呀?哎, ok, 好,那除了基本那个真心之外呢,他还给咱传过来两个参数,一个是变化之后的新值,我们叫他 new value。 一个呢是变化之前的老值,我们叫他 old value。 好,咱们尝试呢,把他俩呢都打印一下过来看哈,好,放过来。 好,我们重新一下,再次点击点走,你看这里,前面是星值一,后面是变化之前老值零看零变成了一,对吧,我们再点一次, 大家说,如果我再点一次的话,这个地方的性质和老师变成啥了呀?哎,聪明,是不是二和一啊?好,我们点一下纵听,哎,你看是不是二和一,哎, ok, 好了,那到此呢,咱用 watch 去征听单个响应 数据变化呢,他的写法,那么就写好了,只需要呢,你传过来一个要正听的数据,然后传过来一个毁掉是不就可以了?哎, ok, 那有些时候呢,咱的需求里边呀,除了征听单个数据源,有些时候呢,咱们还需要去征听多个啊,那接下来呢,咱们再看一下如何去征听多个数据的变化。好,我们回来。 哎,那什么是真听多个数据的变化呢?哎,也就是啊,同时真听多个数据的变化,不管哪个数据变化,咱都需要去执行这个回调。哎,举个例子啊,咱们看下面这个, 比如说呢,我们现在呢有两个数据,一个呢叫做 count, 一个叫做 name, 不管这两个响应数据哪个发生变化,我们都想之前一个毁掉。那这个时候怎么写呢?哎,我们看 下面哈,它的写法上呢,只有一处需要发生一些变化。看这儿我们真听的数据由之前的单一的一个 count 变成一个数组的格式, 然后在数组里边呢,把你想要粘贴的数据呢都给他放过来就可以了。这有一个顺序需要注意一下哈,前面的数组里边呢都是我们的新值,后面这个数组里边呢都是老值,他们的顺序呢且是对应的。你看这里哈, a new count, new name, old count, 然后是一个 old name, 是一个对应的关系。好了,那这个语法知道以后呢,咱们过来呢做一个测试,回到我们的代码区。好,回来 咱把上面这个呢先给他注掉。哎,这个模板呢,先注掉,咱把下面这个打开。哎,这是我们 听多个数据式的一个模板。好,把它打开。打开以后呢,咱们先过来看一下我们做了哪些准备工作啊?看这里准备了一个响应数据 count, 一个修改它的方法。准备了一个响应数据 name, 一个修改它的方法,哎,两个数据都有了, 有了以后呢,咱们在下面呀,用两个按钮分别绑定了两个点击事件,目的是为了修改我们这两个,哎,响应式的数据,看右边一个效果哈,看这里,点第一个按钮可以修改我们 com 点看把它改了,改成一了,对吧? 那点第二按钮呢,可以修改我们的 name, 点看是变成 pc 了呀,哎, ok, 好了,知道我们做了哪些事以后呢,接下来咱们就用 watch 呀,监听一下我们的 count 和 name 的两个数据的变化,注意哦,是两个数据的变化, 好了,咱们过来写呗。 watch 第一个参数怎么变来着?哎,很好,是不是数组了?你要真听谁就把他俩呀都放过来,好, cont 和我们的 name 都放过来, 好,第二个参数呢,是不是一个回调呀?哎,咱们给他整个行吧,好看一些哈,那第二个参数呢,是一个回调函数, 再回到里边的参数是不是也变了呀?它变成了两个数组,好,一个是我们的, 放我们的新值了,对吧,哎,注意顺序哈, new count 和我们的 new name。 okay, 好,第二个参数是啥呀?老值呗,一个是我们的 old count, 一个是我们的 old name。 好了,那它的呢?都写好了?写好以后呢,咱们在这里呢打印一下呗。好, blog 一下, 这一次呢,咱们叫它 count, 哎,或者我们的 name 变化了,好,然后在后面呢,咱们把这两个数据呢都给它打印一下。一个是我们的新职,一个是我们的老职,好,把太太呢都扔过来。 ok, 好了,到这里呢,我们又写完了过来,那我们刷新一下哈,接下来我们要去修改我们的 cond 和我们的内幕, 我们不是说了吗,这样写好的一个效果呢,就是说这两个数据呢,不管哪个变,是不是都可以执行回调呀?来,我们过来呢,验证一下哈,我们先点一下我们的 com, 走,你走。哎,看,这里打印出来了,那注意观察 我们新值和老值的变化,我们这一次改的是 count, 你会发现一和这个零是不是变了呀?看这个地方,一是一个新值,零是一个老值,而后面这个呢, cp 呢,其实是我们这个 name, 他还是个 cp, 因为我没有没有动他们。 好,打完这个以后呢,我们再修改一下我们的 name, 看看呢,还会不会打印出来哈,点它走。哎,果然又打印了,这次呢,轮到我们的后面这个数据,你看,从我们之前的老值 cp 是变成现在的新值 pc 呀, 哎,那证明确实不管这两个数据呢,你修改哪一个都会执行我们的回调函数,对吧?哎,这是所谓的真听多个数据好了,那到此呢,真听多个数据的写法呢,咱们也验证过了,哎,其实呢,只需要把参数的位置 从之前的单一参数变成数组的一个多个参数是不就可以了,哎, ok, 好了,那到这里呢,我们就说完了我们关于 watch 的一个基本监听, 那它是不是还有两个额外的参数呀?叫啥来着诶,一个呢叫做 immediate, 是立即执行。一个呢是我们的叫 deep 深度,真听对不对?好,那接下来呢,咱们先过来看一下我们的立即执行。好,过来, 那立即执行呢?它的意思是说在征听器创建时,立即就触发我们的回调,对吧?哎,想认识数据变化的时候呢,继续执行回调,比如说呢,还是有我们这个需求,这一次呀,大家看这里,当用户呢什么都没有输入的时候,咱们以上来 先从后端先把这个数据呢给他拉过来。哎,这不就是一上来就先执行吗?你看在这个需求如果再增加这么一个小需求的话,他就需要用到我们的 emitter 参数了。好,那接下来看看呢,我们的 emitter 该如何来写啊? 它的语法呢,非常简单,我们只需要呢在它的最后再补充一个参数,大家注意哦,前面两个参数保持不变,最后呢再补充一个对向格式的参数,在这个参数里边呢,我们增加一个选项叫做 immediate, 开启为处就可以啦。 哎,真的是这样吗?我们过来呢测试一下哈。好,回到我们的代数区,咱们呀再把我们上面这个呢给他注掉。好,先把它呢注掉好,合起来 把咱们第三块模板呢再给它打开。好,还是先过来看一下我们做哪些事啊?大家看这里,我们有小型数据,是个 count, 下面呢有修改它的一个方法啊,你看 点击还是那个 g u c 案例,我们呢通过它呢演示一下我们的立即执行好了,那咱们在下面呢执行一下我们的 watch 函数调它呗。 好,第一个参数是不变呀,依旧是我们的显示数据 count, 第二参数也不变,依旧是我们的数据变化时要直行的回掉 count 变化了, 这时候是不是需要增加第三个参数了,格式是什么样格式哎,对了,是不是一个对象呀?好,加个逗号。后面呢,加一个对象哦, 注意设置三个参数哦,别写错,尤其这个嵌套结构哈,不要写错在里边呢,我们可以添加一个叫做隐秘第二特的选项处。好,大家注意啊,我要保存了,看这个地方的变化,我要保存喽, 走你。哎,大家看,这里,一上来是不是先执行了一次呀?当我们点击时,我们再看哈点,你看点击时候呢,又执行了一次, 好了, so easy, 对吧?好了,这是我们的 in media 的参数啊,它可以在我们 watch 在 第一次真听的时候啊,就先执行一次,就是把这个回掉函数先执行一次,等到数据变化时,他会再次执行,哎,这是他的一个执行逻辑。好了,那关于 deep 呢,我们下一小节再说啊。这一小节呢,我们就 先讲到这里,我们讲了 watch 的基本使用,哎,它既支持单一参数,也支持多个参数。右脚了一下,我们的 in mediat 额外开启这个选项,它可以做到立刻执行,对不对?哎, ok。

what's going on guys? so today we'll be learning how we can make use of axiosapi to get data from a markup database so i have this simple application here which is a boss booking up so you can select your route and then the date then it will show you the available trips and then you can select the particular trip so the data for the available trips is actually in address and file if we look at our folder here, so the dvd adjacent file here this is where we are getting all the data and we're showing in the trips section? so this is actually in our asset for that the moment so what we want to do so blow this db file into us onto to a sava and then get all the data from this file using the axiosapi so first of all if we look which sava will be using here we'll be using this magic and sava which is a where you can make fake online souther just for testing purpose so it's very simple you just create a repo and then you add deeply the jason five i have the repo here and i have the jason five there i've uploaded it already so next what you need to do is to immediately when you do that you will find a simple page? like this that shows the annotation of the data available in that jason file so to do what we want to do is to get all the data from that five using axios? so how do we do that if we look at our up here we are actually making use of the raw data which we already have in our asset folder so what we want to do is to actually request this data directly using the axiosapi so first of all we need to do some refactor in here so in our sauce folder we can simply create a new folder let's call that services and then inside of our services folder we can then do the creator file the boss data api file so let's call it boss data api this is where we'll be writing our our axios request so in order to do that we first need to input axios and you must make sure axios is also installed i've already installed it so you say axios input axios from axius just like that and then we can write our simple function so constant let's call this an api client since where this is a client api call so then we make use of axios access dot create which is a function that will be using an inside of it takes in an object and this object in this object we write we just write some definitions for example the url for this are summer so we have a base url a bass url and then in that bass url is going to let me put this in all cops so that base url as i've mentioned before is what we are getting here from our jason sava so this is currently located here so you can just copy that url and then if we go back to all and then you paste it there so put the forward slash because it will be going into this directory very soon and then next what we want to define is the credentials with sorry with credentials oh, i may spells access okay because they should be auto so with credentials and then we just set that to false because we don't want any authentication for this one and then the head is we can just define just link this in lower case heathers we have to write just simple values accept value which would be our application and then what we want the type of fire we want to access is adjacent file and here we can the final content type but this is optional so content ty content type and in that content type we can also put can also assign it to adjacent file application yeah so this is how we initiate or instantiate the axis api let me just wrap this quickly so it's tan shaded now what we want to do is to export this entire function so we say export default and inside of that so what we want to get because if you look at the up here we have locations like for example in our jason file if we look at the jason file, let's look at it and see what the data in there, so our jason file as you can see here we have these furious keywords like locations trips and then the last one is seat so we will be making requests for each of these key key values and then we will use those values in our application so we'll have three requests to the first one will be get location let's collect get location and in this one we'll just be returning the api client thought we get the location so we go into the auditabase or into our savifi logice and five and then we look for locations we get all the data that is under the category locations and next up we want to get trips and the same thing retiring api clans that get in bracket treats so this time around we want just treats mind you this should be in quotation it should be a string the get function takes in a string argument so yeah just like that tricks and then our last get request will be get seat that is their village seat on the boss and we will be returning the same forward slash seats so what we're doing win here is actually concatenating this path to our base url here so for example this get location will go into this path and then on to get locations in order to access the data on the locations just like that the same for the rest of the data so now now that we have created our api call what we want to do now is to just insert this in our application so for example first we need to import that fun that is the boss data api what did we name it again? boss data api so we import it to start where is it again yeah, so let's call this tv cups boss data api we're important it from the boss data api orgs file so we need to import that and then inside of our created method as you can see this is where we are making requests for our data initially it was from the db, so now what we want to do is to write some methods to define to define to get it using axios, so since we've created the api call in our boss data api file and so what we want to do is to reflect to this code? so how we do that first what we want to do is to make use of the boss data api file that we just imported so we say boss data api dot now inside of this boss data api if you remember we have the first one which is get location right get locations it should actually be locations yeah locations so get locations and then inside of that that you reconsider with the function so then we can make these of the then argument then argument takes a response, a response and what we want to return immediately when this happens is to get the locations right we want to get the data from locations so these stud locations these stud locations must be equal to here is db but now we're going to change it to what we're going to change it to response instead of locations we change it to respond to the data that we've just requested on the get locations so that's how we change it just like that and then we will write a catch this is not required but it's very nice it's very standard to write a catch requests as you know that then and then catch so inside of that what we will be doing is returning the arrow so it takes in arrow argument and will be console login console logged any arrow that calls if that data is not fetched, so just like that so we can do the same thing for the trips as you can see here the next one is a trip so we make use of the same boss data api that we created and then it say that get trips don't know why this thing is so get trips and this one also we do the same, so we have response response and we all want to get the trips here like this one so instead of db that we make use of the response the data as well response the data then we can write also the same catch function or catch method and inside of that will be returned in the arrow and all we want to do is to just console the law area so as you can see we are making use of the ball statorapi, we just created here we festival imported it in our in our view which is this one and then we then reflected our created method so here we are calling on the get locations and here we are calling on the get trips so i think they should walk now let's try and see if there are any errors okay, we are getting some error here oh yeah, so they should be a coma and not a semicolon okay, so that was a quick fix so now let's just try and see for example that refresh, let's refresh the page again and you can see the data is actually been shown because this list of locations these are the list of locations so if we click that and then for example today we don't have any so to show no trips available, please check your inputs so the one that we have data on is on the seventh, so think this one okay, let's check and see what's the the arrow here can make use of that the console, oh yeah! there's a jump double g boss data api yeah this double g is given the issues okay, yeah this one my keyboard actually to have in this issue whenever, i press the g, it gives me two g's, so i think that should fix it and let me see try again see, if we try on the seven yeah our data is shine up so this is just basically how powerful access is so for example you don't want all your data to be to be stored on the application because most of these apps they are just lightweight apps so you might want to put that on a server so as you can see here we are getting the data live from that so if we want to check how this data is coming from from our server we can simply just console log the data for example in the response section, so we can just see console dot log and we just console that log the response here for such trips yeah, so if we go again on the seventh yeah, so what we want to do is to check let's inspect this and see and see the response on the our console um console yeah, let's check info so if we go on that info you can see here we have an object file let me just adjusties and the data inside of that object vine is actually retaining, retaining the values yeah, so that's how we make the call request using axiosapi? let me check it in i think i made another double g double gate okay, it's okay yeah, it should be okay now yeah, so that's all for today, so what we blend is very important so i'm actually going to finish up this up and i will try to upload the code so that you guys can access it to very simple up it's similar to the up we're using in school the boss, so i've already finished some views i just need to finish the last few now and then i'll post the code so thank you see you next time。


制高标签打印软件,通用的打印机开发接口, c c p i p i 它可以通过 ip 的调用来进行文本的打印,条码的打印,二维码的打印以及图片的打印。那么通过大量的工业场景以及物流仓储的使用,那么 c c p i p i 它具有清亮简洁、稳定可靠, 支持近百个品牌等数千个型号的打印机。他不光支持我们的标签打印机,他同时也支持单据打印机,真实的单据打印机和商业的小票打印机, 包括我们的半勾打印机, s 的半勾打印机。假如你在一个系统里面需要集成各种打印机来应对不同的使用场景,比如说我们在打印标签的时候可能需要标签打印机,我们在打印票据的时候可能需要用真实打印机, 那么我们在打印报表的时候,可能又要用到我们的这个激光打印机, s 的激光打印机,那么你使用 c c p i 啊这一个 ipad 接口就帮你把这些实验都可以去 做了,那么它所以它在你在这个系统集成及部署上面来给你提供了极大的便利。哎, 它是一个通用的开发接口,那么它也支持我们的主流的开发语言,比如说我们前端的常用常用的这个开发语言,比如说加法思维啊被,那么这个在前端的开发也是非常方便的,比如说我们的假瓦语言,还点代的语言,点代语言,你把 c 下部啊,未必点代的都可以, 包括我们点开的最新的五点零、六点零、七点零,那都都是支持。那么帕森调用接口也是非常简洁, 我们最老的语言支持,比如说这个 v b 六点零,嗯,它也是很好的。那比如说 v b s, 那么我们在这个 excel 里面脚本里面进行 excel 内部的一些系统的一些开发,可以用 v b s 来做,那么用我们 ipi 接口也都是,嗯,能够很好支持的。你像我们一些用户,他们在做一些 些其他的一些财务系统的一个插件的集成,那么他就通过 vbs 直接调用我们的 pr 接口,那么包括这个 c c 加加那些场景也需要使用,所以他对不同的语言支持,他,那么的这个开发的这个接口调用的方法也是几乎一致的。嗯, 我们看一下这个 vivo 的一个基本的一个用的流程,那么那么首先,嗯打印的话,嗯肯定是要先设计一个打印模板,不管我们是在做这个标签的打印,还是做这个呃,商业小票还是单据爆表的打印,我们首先通过我们那个设计器来设计一个模板, 我们把这个模板把它存到我们的服务端或者是客户端都,这个都可以是根据你系统的部署的特性去去决定。那我们的 ipi 给你提供灵活的这个配置方法,那么在微游这个项目当中,我们引入我们提供的这个微库啊, 然后呢就是可以通过这个获取打印机的这个方法,这个里面我们提供这个方法来获取打印机,获取打印机以后我们可以给它显示出来,然后跟我用户在打印的时候进行选择,选择使用哪一台打印机去打印。 那么当然如果你这个打印机的名称是固定的,你这一步的方法完全可以省略,可以忽略,你可以不用打,那么我们可以直接在打印的方法当中去配置打印机。哎,我就直接把名称写死,这我这个名称是固定的,那么这个一些简单的项目,这个也是可以这样去做的。 那么这个第三个方法,那么就是啊,我们就是传,哎通过 ipa 来传给打印机, ipa 打印,那么它主要就是三个,一个就是指定打印机,然后配置模板,然后传递打印数据,那这里面我们就指定了打印机,我们这个打印机是通过这个下拉框来选择的,这个就是我们这一步通过下拉框来选择,那么然后通过这两个属性来配置模板。 哎,我们这边你看这个是存在服务端的,我们通过远程来调用,那么这个是我们存在客户端的,就是我们存在一个本地的一个文件夹,那么这个是我们的模板的文件名, 那么这个是打印数据,我们这个这个打印数据我们也提供多种的这个数据的传递方式,那么这个里面我们是通过一个接送数据来传递这个打印数据啊。最后通过这个这个 excuse 这个这个方法来进行打印打印,不管他是成功与失败,那么他都会有一个回调,我们只要检测这个回调就可以了,在这个回调里面来进行一个呃,我们打印后的一个处理, 我们看到我们这个打印方法调用的是非常简洁的,嗯,所以经过大量场景的应用,嗯在系统集成上面他是非常便捷的,就是几乎没有什么那个需要特别去说的地方,就是你用起来也非常方便。也部署的话,我们用完 pr api 的话,那个安卓帽也是非常小, 对,不像一些设计器可能有几百兆,我们也就几兆,就是非常,嗯,那个清亮的,嗯,这个就是治国表现大专阶 cc 跟 dnpr 的一个基本的一个介绍。


我之前在介绍我由于户口的时候,那很多朋友留言人说为什么管他叫户口?人家官网给的明明是组合,是 api, 我看到这个问题的时候,我也是疑惑了一下, 是呢,我又去多找了一些关联性来看一下为什么大家把它叫成户口。首先这个组合式 api 啊,从他的编码逻辑上跟 rex 的户口是非常的相似,那 rex 我们在他的中文网站上看到他明显的就叫库克。 还有一点,你看瑞瑞克的户口,他所有的 api 都是以柚子开头,这是人家的规则,但是没有也没有这样的一个前缀的规则。但是我们来看两个业界比较常用的户,首先是瑞瑞克这个库,我工作当中也会用到,叫 ahops, 这里边都是基于瑞瑞克的户口封装的,一堆户口 都是自建议户口啊,有非常多的功能。然后我们再看无忧易的这个无忧易柚子,咱们就从这个命名上来看,是不是有一些共性,我们把他的 前缀都命名成了跟 reax 的一样的命名规则。那最后我还发现在 reax 的官网上面,我们在这里搜索户口,他会有一个文章叫和 reax 的户口的比对,他也是和 reax 的户口进行了一个比对,这里分析了他的一些区别,基于以上三点同时期命名雷同, 再加上官网也有进行比对,所以我们把这个组合式 api 叫成户口,在工作当中也是比较常见的,好像也不会引起什么奇异,是吧?大家都懂。