使用idea创建第一个Vue项目

 更新时间:2022年03月24日 08:44:56   作者:东山富哥  
最近在学习vue,本文主要介绍了使用idea创建第一个Vue项目,文中根据图文介绍的十分详尽,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

创建项目

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

创建项目之后:自动编译

sr/local/bin/node /usr/local/lib/node_modules/npm/bin/npx-cli.js --yes --package @vue/cli vue create --default .
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated graphql-extensions@0.15.0: The `graphql-extensions` API has been removed from Apollo Server 3. Use the plugin API instead: https://www.apollographql.com/docs/apollo-server/integrations/plugins/
npm WARN deprecated apollo-tracing@0.15.0: The `apollo-tracing` package is no longer part of Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#tracing for details
npm WARN deprecated apollo-cache-control@0.14.0: The functionality provided by the `apollo-cache-control` package is built in to `apollo-server-core` starting with Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#cachecontrol for details.
npm WARN deprecated subscriptions-transport-ws@0.9.19: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws    For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
npm WARN deprecated graphql-tools@4.0.8: This package has been deprecated and now it only exports makeExecutableSchema.\nAnd it will no longer receive updates.\nWe recommend you to migrate to scoped packages such as @graphql-tools/schema, @graphql-tools/utils and etc.\nCheck out https://www.graphql-tools.com to learn what package you should use instead


Vue CLI v5.0.3
? Generate project in current directory? Yes


Vue CLI v5.0.3
✨  Creating project in /Users/gaoxinfu/Github/gaoxinfu/vue-sample.
🗃  Initializing git repository...
⚙️  Installing CLI plugins. This might take a while...


added 859 packages in 46s
🚀  Invoking generators...
📦  Installing additional dependencies...


added 97 packages in 12s
⚓  Running completion hooks...

📄  Generating README.md...

🎉  Successfully created project vue-sample.
👉  Get started with the following commands:

 $ npm run serve

Done

创建项目之后:初始项目架构

目录说明
node_modules依赖包文件夹
public 
src 
src/routes前端路由
src/assetscss、image、svg等资源
src/components编写vue代码的文件夹,具体vue的文件都放在这里一般
package.jsonnpm配置 参考 https://juejin.cn/post/6870426598605062152
pachage-lock.json1、锁定安装时的包的版本号,需要上传到git,保证大家的依赖包一致。2、package-lock.json 是在 npm install时候生成一份文件,用来记录当前状态下实际安装的各个npm package的具体来源和版本号。
babel.config.jsbabel配置 Babel 是一个工具链,主要用于将采用 ECMAScript 2015+ 语法编写的代码转换为向后兼容的 JavaScript 语法,以便能够运行在当前和旧版本的浏览器或其他环境中 ,可以参考label的介绍 https://www.babeljs.cn/docs/
jsconfig.json目录中出现 jsconfig.json 文件表明该目录是 JavaScript 项目的根目录 文件目录检索做智能提示
README.md项目介绍
index.html入口页面

在这里插入图片描述

项目启动

方式1

在这里插入图片描述

在这里插入图片描述

方式2:npm run serve

gaoxinfudeMacBook-Pro:vue-sample gaoxinfu$ npm run serve

> vue-sample@0.1.0 serve
> vue-cli-service serve

 INFO  Starting development server...


 DONE  Compiled successfully in 3048ms                                                                                                                            9:28:14 PM


  App running at:
  - Local:   http://localhost:8081/ 
  - Network: http://192.168.0.198:8081/

  Note that the development build is not optimized.
  To create a production build, run npm run build.

到此这篇关于使用idea创建第一个Vue项目的文章就介绍到这了,更多相关idea创建Vue项目内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

相关文章

  • Vue-不允许嵌套式的渲染方法

    Vue-不允许嵌套式的渲染方法

    今天小编就为大家分享一篇Vue-不允许嵌套式的渲染方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
    2018-09-09
  • vue中Vue.set()的使用以及对其进行深入解析

    vue中Vue.set()的使用以及对其进行深入解析

    vue不允许在已经创建的实例上动态添加新的根级响应式属性,不过可以使用Vue.set()方法将响应式属性添加到嵌套的对象上,下面这篇文章主要给大家介绍了关于vue中Vue.set()的使用以及对其进行深入解析的相关资料,需要的朋友可以参考下
    2023-01-01
  • vue使用exif获取图片经纬度的示例代码

    vue使用exif获取图片经纬度的示例代码

    这篇文章主要介绍了vue使用exif获取图片经纬度的示例代码,帮助大家更好的利用vue获取图片信息,感兴趣的朋友可以了解下
    2020-12-12
  • vue elementui异步给dom赋值无效问题

    vue elementui异步给dom赋值无效问题

    这篇文章主要介绍了vue elementui异步给dom赋值无效问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教
    2024-06-06
  • vue如何将style私有化

    vue如何将style私有化

    在 Vue.js 中,你可以通过多种方式将样式私有化,以确保样式只作用于特定的组件,避免全局污染,本文整理了一些常用的方法,希望对大家有所帮助
    2024-11-11
  • vue打包后dist文件在本地启动运行的步骤

    vue打包后dist文件在本地启动运行的步骤

    这篇文章主要给大家介绍了关于vue打包后dist文件在本地启动运行的简单步骤,文中通过代码示例以及图文介绍的非常详细,对大家学习或者使用vue具有一定的参考价值,需要的朋友可以参考下
    2023-09-09
  • Vue指令之v-for的使用说明

    Vue指令之v-for的使用说明

    这篇文章主要介绍了Vue指令之v-for的使用说明,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
    2022-04-04
  • Vue中key为index和id的区别示例详解

    Vue中key为index和id的区别示例详解

    这篇文章主要介绍了Vue中key为index和id的区别详解,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
    2023-06-06
  • vue实现GitHub的第三方授权方法示例

    vue实现GitHub的第三方授权方法示例

    本文主要介绍了vue实现GitHub的第三方授权,文中通过示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2021-11-11
  • Vue设置长时间未操作登录自动到期返回登录页

    Vue设置长时间未操作登录自动到期返回登录页

    这篇文章主要介绍了Vue设置长时间未操作登录以后自动到期返回登录页,本文通过实例代码给大家介绍的非常详细,需要的朋友可以参考下
    2020-01-01

最新评论