有你在真好 的个人博客
Vue+Element环境搭建
阅读:2199 添加日期:2021/3/30 17:42:57

环境搭建

Node.js

Node.js是一个事件驱动I/O服务端JavaScript环境,基于Google的V8引擎,V8引擎执行Javascript的速度非常快,性能非常好, Node.js 就是运行在服务端的 JavaScript。

node -vv12.16.1

NPM

NPM是随同NodeJS一起安装的包管理工具,能解决NodeJS代码部署上的很多问题;

npm -v6.13.4

国内用户建议采用cnpm

$ npm install -g cnpm --registry=https://registry.npm.taobao.org

VUE

Vue.js(读音 /vjuː/, 类似于 view) 是一套构建用户界面的渐进式框架。

Vue 只关注视图层, 采用自底向上增量开发的设计。

Vue 的目标是通过尽可能简单的 API 实现响应的数据绑定和组合的视图组件。

#安装vue脚手架cnpm install -g @vue/cli#安装完成后查看版本>vue -V@vue/cli 4.2.3# 错误处理#先卸载再安装:npm uninstall vue —Scnpm install vue -S#缺什么安装什么cnpm install  vue@^2.5.16 -S

Element

Element,一套为开发者、设计师和产品经理准备的基于 Vue 2.0 的桌面端组件库.

#安装cnpm i element-ui -S

vue验证

验证环境

vue create moke-admin#项目创建完成$ cd moke-admin$ npm run serve
<template>  <h1>验证</h1></template>
Vue+Element环境搭建

Element验证

//引入 mian.jsimport ElementUI from 'element-ui';import 'element-ui/lib/theme-chalk/index.css';import App from './App.vue';//使用Vue.use(ElementUI);
<div>  <h1>验证</h1>  <el-row>  <el-button>默认按钮</el-button>  <el-button type="primary">主要按钮</el-button>  <el-button type="success">成功按钮</el-button>  <el-button type="info">信息按钮</el-button>  <el-button type="warning">警告按钮</el-button>  <el-button type="danger">危险按钮</el-button></el-row></div>


Vue+Element环境搭建

感谢阅读,欢迎交流!

ICP备案号:苏ICP备14035786号-1 苏公网安备 32050502001014号