A Roadmap
  • Introduction
  • Roadmap
  • Basics
    • Basic Terminal Usage
      • Shell
        • 基本
        • 变量
        • 传递参数
        • 运算符
        • 命令
        • 流程控制
        • 函数
        • 输入输出重定向
    • Character Encoding
      • 字符编码
    • Data Structures & algorithms
    • Network
      • TCP/IP
      • Http/Https
        • 浏览器缓存
        • Status Code
        • GET & POST
        • HTTPS 握手过程
        • HostOnly Cookie
      • CDN
        • CDN 工作原理
    • Version Control
      • git message format
      • git commands
    • Principles
    • Design Patterns
    • Others
      • JSON
      • 正则表达式
  • Front End
    • Web Standard
      • Html
      • CSS
        • font-face 小记
        • Grid 布局简易笔记
      • Javascript
        • Ajax
          • Fetch
          • XMLHttpRequest
        • DOM
          • Selection
          • 常用 DOM 操作
          • script 标签的几个属性
        • Ecmascript
          • this 关键字
          • Event Loop
          • 隐式转换
          • Date
        • Event
          • 模拟事件
          • Others
    • Development
      • Package Management
        • npm
      • Modulization
        • 模块化机制
        • webpack 打包解析
      • Architecture
      • Build Tools
        • 如何编写一个自定义的 eslint 规则?
      • Debug
        • 移动端调试 web
      • Pre/Post Processors
      • Test
        • Jest Snapshot 使用指南
      • Type Checkers
        • TS 中 enum 的编译结果
    • Libs & frameworks
    • Platforms
      • Browser
        • Basics
          • 从输入 URL 到页面加载完成都发生了什么事情?
          • HTML 加载的过程示意图
          • 为什么读取某些属性,也会导致回流?
          • Chrome 进程模型
        • PWA
        • Compatible
        • Cross Origin
        • Performance
          • 性能检测:performance 对象
          • 性能指标
        • Others
          • 移动端 web 开发笔记
      • Server
      • Desktop Applications
      • Mobile Applications
        • Flutter 在移动端和 Web 端的技术实现
  • Back End
    • outline
    • Languages
      • Node
        • Event Loop
        • NodeJS 中的进程与线程
        • NodeJS 中的 esModule 与 commonJS
  • Clients
    • outline
    • 安装 IPA 包
  • DevOps
    • Languages
    • OS Concepts
    • Servers & terminal
  • UI & UX
    • outline
  • Others
    • Posts
      • 使用 node 爬取数据并导出到 excel
      • antd 1.x datepicker 时区问题
      • babel-transform-runtime 踩坑记录
      • lodash 按需加载注意事项
      • 记一次项目迁移的踩坑记录
      • 时区与JS中的Date对象
      • 记一次 vue + ts 开发踩坑
    • Tools
      • 个人常用的工具分享
      • tmux 简要笔记
Powered by GitBook
On this page
  • 遇到的问题
  • 配置相关
  • 开发相关
  • 如何构建 https 服务
  • mongodb 如何备份数据
  • github + jenkins 持续构建
  • 使用docker容器集成 server 服务
  • 推荐的库类

Was this helpful?

  1. Others
  2. Posts

记一次 vue + ts 开发踩坑

Previous时区与JS中的Date对象NextTools

Last updated 5 years ago

Was this helpful?

本次项目开发,使用了 vue-cli + ts + eslint + prettier + vs-code + vetur,

遇到的问题

配置相关

  • vscode eslint 不能在在*.vue或*.ts 中正常工作

    • 需要为eslint.options.validateLanguage添加 vue 和ts 的支持

  • vscode prettier不能在*.vue或*.ts 中正常工作

    • 需要修改prettier-eslint的源码

  • eslint 提示 import 的模块 unsused

    • 手动安装eslint eslint-plugin-typescript 并设置unsed-var规则

  • vscode始终提示装饰器的警告无法找到

    • vue配合tsconfig时,需要将tsconfig所在的文件作为单独的workspace打开

  • 在style less中使用alias路径

    • 使用 ~@/xxx/xxx

  • 在vue中使用jsx

    • tsconfig.json:jsx:preserve, jsxRefactor: h

      • Warning: 不应该让ts对jsx进行处理; 需要声明额外的d.ts,让ts知道jsx的类型

    • use .tsx

  • 多个export * from './model' 提示undefined

    • 每个export之间需要换行

开发相关

  • koa使用 axios 转发请求,并转发:

    如果需要使用koa转发二进制资源,需要设置responseType: 'arraybuffer'

    const res = await axios({...})
    ctx.set(res.headers);
    ctx.status = res.status;
    ctx.body = res.data;

如何构建 https 服务

  1. 准备一台服务器,准备一个域名

  2. 构建node server

  3. 证书

    • 格式说明

    • 获得自签名证书

    • 获得正式证书(阿里云 赛门铁克)

  4. node server use https server & certificates

  5. http-server use certificates

mongodb 如何备份数据

  1. atlas 云服务,实时备份,定时备份

  2. cp

    • 适合轻量数据

    • 不会备份索引,需要restore之后重新构建

    • 不会备份 local db

github + jenkins 持续构建

  • 安装jenkins

  • 任务相关

      • 不允许在jenkins的主进程中修改 working dir

      • 只能在jenkins的容器里执行操作

      • 指定 branch为空

      • 或者指定 refspec

使用docker容器集成 server 服务

推荐的库类

  • 项目中使用的库类

    • pinyin 中文拼音分词,获取拼音、多音字

    • dayjs 类moment api的时间库

    • node-cache node memory内存

    • consolidate 模版引擎渲染

&

参考()

jenkins安装失败(

nodejsonwebtoken 接口安全校验

issue 地址
https://www.jianshu.com/p/901c7eaed40f
参考 medium
参考 用jsx写vue组件 alloy team
Mongdodump
mongorestore
Mongo ops
手把手教你搭建Jenkins+Github持续集成环境.md
https://jenkins.io/doc/book/installing/
https://stackoverflow.com/questions/19457867/problems-installing-latest-version-of-jenkins)
不能在shell里执行cd操作
git revision issue
example