四时宝库

程序员的知识宝库

Vite+Vue3+TS(1)项目初始化(vue-cli初始化项目)

最近计划使用 Vite + Vue3 + TS + VueRouter + Pinia + Axiso + Vue-Design-Vue 完成一个前端项目,接下来会通过一个系列文章记录整个过程以及过程中遇到的问题

环境

  • 安装 nodejs
  • 安装 yarn
npm install -g yarn

创建项目

一、创建

yarn create vite myApp --template vue-ts

项目目录如下

二、运行项目

cd myApp
yarn
yarn dev

访问 localhost:3000 即可看到 Vue 的第一个页面

设置启动端口号

vite.config.ts 文件中,配置如下内容

export default defineConfig({
    plugins: [vue()],
    server: {
        port: 3000
    }
})

参考文档:

  • Vite3开发文档:https://vitejs.cn/guide/why.html
  • Vue3 开发文档:https://v3.cn.vuejs.org/guide/introduction.html
  • Vue-Route 开发文档:https://router.vuejs.org/zh/introduction.html
  • Pinia 开发文档:https://pinia.vuejs.org/introduction.html
  • Axios 开发文档:http://www.axios-js.com/zh-cn/docs/
  • Ant-Design-Vue:https://antdv.com/components/overview
  • Less 开发文档:https://less.bootcss.com/

发表评论:

控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言
    友情链接