摘要: Vue3 中的setup 一种是setup函数,一种是script setup setup函数 setup函数原理说明 由于setup 是在beforeCreate 和 create 生命周期阶段,组件还没有创建,即还没有进入 data 方法 阶段。 setup 返回的结果集 作为 (传统写法)da 阅读全文
posted @ 2021-10-12 07:07 攀登高山 阅读(13352) 评论(0) 推荐(5) 编辑
摘要: ref 接受一个值,返回一个响应式并且可变的 ref 对象。ref 对象具有指向值的单个属性的值。 ref数据发生改变,界面会自动更新。 实例 <template> <div class="container"> {{ count }} <br> <button @click="add"> 点击 < 阅读全文
posted @ 2021-09-29 16:13 攀登高山 阅读(865) 评论(0) 推荐(0) 编辑
摘要: 简介 provide可以向所有子孙组件提供数据以及提供修改数据的方法,子孙组件用inject使用数据。 使用方法 我们用一个例子来介绍provide, inject的使用。父组件的info, data数据传递给子组件以及孙子组件,同时父组件传递一个可以更新数据的方法。 父组件: <template> 阅读全文
posted @ 2021-09-29 15:06 攀登高山 阅读(2176) 评论(0) 推荐(1) 编辑
摘要: 核心概念 Store Store就是一个仓库,它存储了所有的状态(State)。 State state 就是一个普通的对象(plain object)。 { todos: [{ text: 'Eat food', completed: true }, { text: 'Exercise', com 阅读全文
posted @ 2021-08-28 07:46 攀登高山 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Router 的 类型 BrowserRouter, HashRouter : https://reactrouter.com/web/example/basic MemoryRouter:https://reactrouter.com/web/api/MemoryRouter StaticRout 阅读全文
posted @ 2021-08-06 12:39 攀登高山 阅读(107) 评论(0) 推荐(0) 编辑
摘要: [] 什么是React Hook? Hook 是一个特殊的函数,它可以让你”钩入”React state及生命周期等特性的函数。例如,useState是允许你在React函数组件中添加state的Hook。 使用React Hook的目的是什么? 使用Hook其中一个目的就是要解决class中生命周 阅读全文
posted @ 2021-03-01 22:45 攀登高山 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 安装nginx brew install nginx 启动nginx nginx 停止nginx nginx -s stop 配置nginx vim /opt/homebrew/etc/nginx/nginx.conf #user nobody; worker_processes 1; #error 阅读全文
posted @ 2022-07-04 10:18 攀登高山 阅读(788) 评论(0) 推荐(0) 编辑
摘要: Monaco Editor 与VS Code 一样强大,但是Monaco Editor是网页版的code editor。下面我们介绍一下Monaco Editor的简单用法。 安装包 monaco-editor: 0.21.2 monaco-editor-webpack-plugin: 2.1.0 阅读全文
posted @ 2022-04-18 15:44 攀登高山 阅读(531) 评论(0) 推荐(0) 编辑
摘要: 最近拿nest js 重构了之前拿egg.js写的一个项目,所以想在团队中分享nest js。在分享之前先做个各个框架的对比。 首先大家对koa, express比较了解的。 Express Express 是一个保持最小规模的灵活的 Node.js Web 应用程序开发框架,为 Web 和移动应用 阅读全文
posted @ 2021-12-21 17:51 攀登高山 阅读(669) 评论(0) 推荐(0) 编辑
摘要: 初始化本地文件 git init 将文件夹中代码添加到本地仓库 git add . 提交文件 git commit -m "提交说明" 建立本地分支 git branch newbranch 切换到新建分支 newbranch git checkout newbranch 将本地仓库与远程仓库建立联 阅读全文
posted @ 2021-12-18 08:04 攀登高山 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 数组去重的方式 1、forEach, indexof let arr = [1, 2, 3, 22, 233, 22, 2, 233, 'a', 3, 'b', 'a']; // forEach, indexOf Array.prototype.unique = function () { cons 阅读全文
posted @ 2021-11-23 10:14 攀登高山 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 用法 directives 文件 export const focus = { // 指令的定义 mounted (el: any) { el.focus() } } main.ts 文件 import { createApp } from 'vue' import router from '@/r 阅读全文
posted @ 2021-11-16 19:24 攀登高山 阅读(533) 评论(0) 推荐(0) 编辑
摘要: 1、git 地址:git clone https://github.com/vuejs/vue-next.git 2、npm install 或者yarn install(npm install -g yarn) 3、安装完yarn和依赖后,在vue-next项目中找到rollup.config.j 阅读全文
posted @ 2021-11-03 11:26 攀登高山 阅读(362) 评论(0) 推荐(0) 编辑
摘要: git merge git-merge - Join two or more development histories together 把其他分支的代码合并到当前分支上,会记住以前分支的所有提交信息。 git rebase git-rebase - Reapply commits on top 阅读全文
posted @ 2021-10-01 10:31 攀登高山 阅读(168) 评论(0) 推荐(0) 编辑