2024年6月3日

vue3全局状态和 define

摘要: vuex global 全局响应式ref provider inject 注入 defineEmit 定义事件 defineProps 定义属性 defineExpose 定义组件暴露的的东西 defineSlots 阅读全文

posted @ 2024-06-03 18:42 龍瀧尨呀 阅读(1) 评论(0) 推荐(0) 编辑

vue3异步组件

摘要: vue2 // 定义一个异步组件 const AsyncComponent = () => ({ // 需要加载的组件 (应该是一个 Promise) component: import('./MyComponent.vue'), // 加载中应当渲染的组件 loading: LoadingComp 阅读全文

posted @ 2024-06-03 11:26 龍瀧尨呀 阅读(1) 评论(0) 推荐(0) 编辑

2024年6月1日

创建项目

摘要: vue create vue3-app-name npm init vite-app vue3-app-name 阅读全文

posted @ 2024-06-01 19:46 龍瀧尨呀 阅读(2) 评论(0) 推荐(0) 编辑

API和数据响应式

摘要: 面试题 :1.为什么去掉了Vue构造函数 面试题 : 2.谈谈你对vue3数据响应式的理解 去掉了Vue构造函数 vue2中 Vue.use(...) //此代码会影响所有的vue应用 Vue.mixin(...) //此代码会影响所有的vue应用 Vue.component(...)//此代码会影 阅读全文

posted @ 2024-06-01 19:37 龍瀧尨呀 阅读(1) 评论(0) 推荐(0) 编辑

vue3随笔

摘要: vite: 相比webpack webpack先通过入口文件找依赖 然后打包bounder 然后启动devServer vite 直接启动devServer 然后找依赖模块 由浏览器去请求本地服务返回依赖模块 项目越多模块越大 vite越好 效率提升 静态提升 静态节点 没有动态绑定的内容会提升到r 阅读全文

posted @ 2024-06-01 18:54 龍瀧尨呀 阅读(1) 评论(0) 推荐(0) 编辑

2024年5月23日

nodeJS文件操作

摘要: const { log } = require("console"); const fs = require("fs"); const path = require("path"); const filename = path.resolve(__dirname, "./myfiles1.txt") 阅读全文

posted @ 2024-05-23 23:03 龍瀧尨呀 阅读(1) 评论(0) 推荐(0) 编辑

nodeJS 内置对象

摘要: // const { log } = require("console"); // const { argv } = require("process"); // log(__dirname) // setImmediate(()=>{ // log(__filename) // }) // con 阅读全文

posted @ 2024-05-23 19:50 龍瀧尨呀 阅读(3) 评论(0) 推荐(0) 编辑

关于模块和require,module,exports,module.exports的关系

摘要: require函数的伪代码: const result = require('.myModule') function require(modulePath) { // 1.modulePath转为绝对路径 // 2.判断是否该模块已有缓存 如果有则返回缓存 // 3.读取文件内容 // 4.包裹到 阅读全文

posted @ 2024-05-23 16:30 龍瀧尨呀 阅读(2) 评论(0) 推荐(0) 编辑

2024年2月28日

yield生成器

摘要: 在 JavaScript 中,yield 是一个关键字,用于生成器函数(Generator Function)中。生成器函数是一种特殊类型的函数,它可以在执行过程中暂停,并且可以多次从暂停的位置继续执行。 yield 关键字用于定义生成器函数中的一个暂停点,并返回一个生成器对象的值。每次调用生成器函 阅读全文

posted @ 2024-02-28 18:02 龍瀧尨呀 阅读(10) 评论(0) 推荐(0) 编辑

原型与原型链

摘要: 关键点: 1.函数是种特殊的对象,规范的说法是函数是可以被调用的对象,所以有函数的时候会跟随一个对象,也就是原型对象 2.const a = {}是 const a= new Object()的语法糖 3.const a = function(a,b){ return a + b} 等于 const 阅读全文

posted @ 2024-02-28 17:02 龍瀧尨呀 阅读(1) 评论(0) 推荐(0) 编辑

导航