上一页 1 2 3 4 5 6 ··· 28 下一页
摘要: 在书写petite-vue和Vue最舒服的莫过于通过@click绑定事件,而且在移除元素时框架会帮我们自动解除绑定。省去了过去通过jQuery的累赘。而事件绑定在petite-vue中就是一个指令(directive),和其他指令类似。 深入v-on的工作原理 walk方法在解析模板时会遍历元素的特 阅读全文
posted @ 2022-03-11 09:54 ^_^肥仔John 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 在《petite-vue源码剖析-v-if和v-for的工作原理》我们了解到v-for在静态视图中的工作原理,而这里我们将深入了解在更新渲染时v-for是如何运作的。 逐行解析 // 文件 ./src/directives/for.ts /* [\s\S]*表示识别空格字符和非空格字符若干个,默认为 阅读全文
posted @ 2022-03-10 16:03 ^_^肥仔John 阅读(469) 评论(0) 推荐(1) 编辑
摘要: 关于指令(directive) 属性绑定、事件绑定和v-modal底层都是通过指令(directive)实现的,那么什么是指令呢?我们一起看看Directive的定义吧。 //文件 ./src/directives/index.ts export interface Directive<T = El 阅读全文
posted @ 2022-03-08 17:32 ^_^肥仔John 阅读(623) 评论(0) 推荐(0) 编辑
摘要: 深入v-if的工作原理 <div v-scope="App"></div> <script type="module"> import { createApp } from 'https://unpkg.com/petite-vue?module' createApp({ App: { $templ 阅读全文
posted @ 2022-03-07 14:22 ^_^肥仔John 阅读(597) 评论(0) 推荐(0) 编辑
摘要: 代码库结构介绍 examples 各种使用示例 scripts 打包发布脚本 tests 测试用例 src directives v-if等内置指令的实现 app.ts createApp函数 block.ts 块对象 context.ts 上下文对象 eval.ts 提供v-if="count 1 阅读全文
posted @ 2022-03-04 14:53 ^_^肥仔John 阅读(468) 评论(0) 推荐(0) 编辑
摘要: 什么是petite-vue? 根据官方解释,petite-vue是专门为非前后端分离的历史项目提供和Vue相近的响应式开发模式。 与完整的Vue相比最大的特点是,面对数据的变化petite-vue采取直接操作DOM的方式重新渲染。 具体的使用方式请参考GitHub,在这里我想展示两个示例: 示例1 阅读全文
posted @ 2022-03-03 14:34 ^_^肥仔John 阅读(499) 评论(0) 推荐(0) 编辑
摘要: Cookies are strings of data that are stored directly in the browser. They are a part of HTTP protocol, defined by RFC 6265 specification. Cookies are 阅读全文
posted @ 2021-12-14 07:00 ^_^肥仔John 阅读(59) 评论(0) 推荐(0) 编辑
摘要: First of all, symbol is a built-in primitive type. And it's guaranteed to be unique. Symbols are often used to add unique property keys to an object w 阅读全文
posted @ 2021-11-27 21:56 ^_^肥仔John 阅读(37) 评论(0) 推荐(0) 编辑
摘要: There is no other great moment to head into the world of TypeScript instead of right now. Angular is in TypeScript, React is in TypeScript, and even V 阅读全文
posted @ 2021-11-27 21:56 ^_^肥仔John 阅读(36) 评论(0) 推荐(0) 编辑
摘要: Hey, guys! The next generation of Vue has released already. There are not only the brand new composition API, much more powerful and flexible reactivi 阅读全文
posted @ 2021-11-09 23:29 ^_^肥仔John 阅读(108) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 28 下一页