Skip to main content

6 posts tagged with "Vue"

View All Tags

· 5 min read
LIU

1. IndexedDB

IndexedDB 是一个强大的浏览器内置数据库,具有以下优势:

  • 支持存储大量结构化数据
  • 支持索引,便于快速检索
  • 支持事务,保证数据一致性
  • 异步 API,不会阻塞主线程

2. 数据加密:jsencrypt

· 4 min read
LIU

Vue.js 是一个渐进式 JavaScript 框架,其源码设计精巧,包含了响应式系统、虚拟 DOM、模板编译等核心功能。

· 9 min read
LIU

1.元素挂载顺序

vue 元素挂载的顺序之分

  1. 如果存在 render 函数,就用 render 函数渲染组件;
  2. 如果没有 render 函数,但是存在 template,就将 template 中的内容编译成 render 函数,最后做渲染;
  3. 如果既没有 render 函数也没有 template 函数,就获取 el 里的内容作为 template,同样编译成 render 函数。
Vue.prototype.$mount = function (el) {
// 挂载
const vm = this;
const options = vm.$options;
el = document.querySelector(el);
vm.$el = el;
if (!options.render) {
// 没有render方法
let template = options.template;
if (!template && el) {
// 没有template 但是有el 获取el中的内容
template = el.outerHTML;
}
// 将模板编译成render函数
const render = compileToFunctions(template);
options.render = render;
}
// 渲染时用的都是render函数
// 挂载组件
mountComponent(vm, el);
};

· 12 min read
LIU

1.开始

Node.js 是一个开源和跨平台的 JavaScript 运行时环境。它几乎是任何类型项目的流行工具

Node.js 应用程序在单个进程中运行,无需为每个请求创建新的线程。Node.js 在其标准库中提供了一组异步的I/O原语,以防止 JavaScript 代码阻塞,通常,Node.js 中的库是使用非阻塞范式编写的

2.非阻塞

node 核心运行机制,node应用运行在单个进程中,node是单线程的(意思是node中只有一个线程用于处理 javascript),一个进程包含多个线程

image-20220613120754407

· 4 min read
LIU

一个是定义属性,一个是代理

Object.defineProperty()

define 定义 property 属性

(obj , prop , descriptor)
description 叙述、表述
descript 动词
descriptor 描述项集合