码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 一、vue介绍


    一、介绍

    vue式前端框架,是一套用于构建用户界面的渐进式框架

    1、安装vue

    安装node.js(配置环境变量)
    https://nodejs.org/en/download/
    更换镜像
    npm config set registry https://registry.npm.taobao.org
    查看镜像
    npm config get registry
    安装cnpm
    npm install -g cnpm
    配置cnpm镜像
    cnpm config set registry http://registry.npm.taobao.org
    安装vue脚手架
    cnpm install -g @vue/cli
    查看版本信息
    vue --version
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14

    问题记录:

    vue : 无法加载文件 D:\node-v18.14.2-win-x64\node_global\vue.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com
    /fwlink/?LinkID=135170 中的 about_Execution_Policies。
    
    解决(修改命令行安全策略):
    get-ExecutionPolicy
    # 显示Restricted (禁用)
    set-ExecutionPolicy RemoteSigned
    get-ExecutionPolicy
    #显示RemoteSigned
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    2、创建项目

    (1)创建工程

    # 项目名称中不可以有大写字母
    vue create vue-demo
    
    Vue CLI v5.0.8
    ? Please pick a preset: (Use arrow keys)
     Default ([Vue 3] babel, eslint)       默认3的版本
     Default ([Vue 2] babel, eslint)       默认2的版本
    >  Manually select features			   手动选择
    选择手动选择(使用上下切换,使用回车选择)
    
    Vue CLI v5.0.8
    ? Please pick a preset: Manually select features
    ? Check the features needed for your project: (Press  to select,  to toggle all,  to invert selection, and  to proceed)
    >(*) Babel
     ( ) TypeScript	
     (*) Progressive Web App (PWA) Support
     ( ) Router	路由(导航)
     ( ) Vuex	数据管理
     ( ) CSS Pre-processors
     () Linter / Formatter	代码规范化(代码格式严格,取消勾选防止误报)
     ( ) Unit Testing
     ( ) E2E Testing
     使用空格勾选
    
    Vue CLI v5.0.8
    ? Please pick a preset: Manually select features
    ? Check the features needed for your project: (Press  to select,  to toggle all,  to invert selection, and 
    ? Check the features needed for your project: Babel, PWA
    ? Choose a version of Vue.js that you want to start the project with (Use arrow keys)
    > 3.x
      2.x
      选择版本
    
    Vue CLI v5.0.8
    ? Please pick a preset: Manually select features
    ? Check the features needed for your project: (Press  to select,  to toggle all,  to invert selection, and 
    ? Check the features needed for your project: Babel, PWA
    ? Choose a version of Vue.js that you want to start the project with 3.x      
    ? Where do you prefer placing config for Babel, ESLint, etc.? (Use arrow keys)
    > In dedicated config files
      In package.json
     配置存放位置
    
    Vue CLI v5.0.8
    ? Please pick a preset: Manually select features
    ? Check the features needed for your project: (Press  to select,  to toggle all,  to invert selection, and 
    ? Check the features needed for your project: Babel, PWA
    ? Choose a version of Vue.js that you want to start the project with 3.x      
    ? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files
    ? Save this as a preset for future projects? (y/N) n
    是否将选项设置为下次预设
    
    Vue CLI v5.0.8
    ✨  Creating project in E:\vsCode\vue\vue-demo.
    ⚙️  Installing CLI plugins. This might take a while...
    
    
    added 968 packages in 3m
    �🚀  Invoking generators...
    �📦  Installing additional dependencies...
    
    
    added 18 packages in 2m
    ⚓  Running completion hooks...
    
    �📄  Generating README.md...
    
    �🎉  Successfully created project vue-demo.
    �👉  Get started with the following command
    
     $ cd vue-demo
     $ npm run serve
    已经创建成功
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73

    (2)运行项目

    进入目录
    cd vue-demo
    执行项目
    npm run serve
    
     DONE  Compiled successfully in 6817ms                                                                                                          22:09:17
      App running at:
      - Local:   http://localhost:8080/
      - Network: http://192.168.1.8:8080/
      Note that the development build is not optimized.
      To create a production build, run npm run build.
     成功运行
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12

    二、vscode安装插件

    插件插件名称:Vue Language Features (Volar)

  • 相关阅读:
    Linux 中的 cron 命令及示例
    HazelEngine 学习记录 - Shader Asset Files
    Docker Compose
    C++多态(个人笔记)
    【斗破年番】谣言不攻自破,萧潇造型曝光,制作进度已达中州,风尊者帅翻
    SQL查询本年每月的数据
    专题一:递归【递归、搜索、回溯】
    关于element-ui中,页面上有多个el-table并通过v-if、v-else等控制是否显示时,type=selection勾选框失效或不显示的问题
    安卓恶意应用识别(二)(安卓APK反编译)
    Tomcat的动静分离
  • 原文地址:https://blog.csdn.net/liutit/article/details/133934276
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号