当前位置: 首页 > news >正文

Vue2 学习记录

一、创建项目

1、vscode打开目录:D:\vueCode\test\hi

2、vue create hi01

3、选手手动配置( Manually select features)

4、按空格选中

5、回车,选择 Vue2

6、 Use history mode for router? no

7、 Pick a CSS pre-processor: less

完成项目创建

二、测试创建的项目

1、cd hi01

2、npm run serve

稍侯,一段时间后出现: http://localhost:8080/,看见vue经典界面表示项目创建成功。

三、element-ui 测试

1、进入官网地址:组件 | Element

2、npm i element-ui -S

3、main.js 引入:

......

import ElementUI from 'element-ui';

import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);

......

main.js详细代码如下所示。

import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';Vue.use(ElementUI);Vue.config.productionTip = falsenew Vue({router,store,render: h => h(App)
}).$mount('#app')

4、App.vue 引入

App.vue加入element测试组件(我这里使用button)

......

<el-row>

  <el-button icon="el-icon-search" circle></el-button>

......

</el-row>

......

App.vue代码如下所示。

<template><div id="app">
<el-row><el-button icon="el-icon-search" circle></el-button><el-button type="primary" icon="el-icon-edit" circle></el-button><el-button type="success" icon="el-icon-check" circle></el-button><el-button type="info" icon="el-icon-message" circle></el-button><el-button type="warning" icon="el-icon-star-off" circle></el-button><el-button type="danger" icon="el-icon-delete" circle></el-button>
</el-row><nav><router-link to="/">Home</router-link> |<router-link to="/about">About</router-link></nav><router-view/></div>
</template><style lang="less">
#app {font-family: Avenir, Helvetica, Arial, sans-serif;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;text-align: center;color: #2c3e50;
}nav {padding: 30px;a {font-weight: bold;color: #2c3e50;&.router-link-exact-active {color: #42b983;}}
}
</style>

5、测试

1、npm run serve

2、http://localhost:8080, 看见按钮

http://www.dtcms.com/a/431425.html

相关文章:

  • 手写MyBatis第87弹:从SqlNode树到可执行SQL的转换奥秘
  • Hot100——普通数组
  • Linux 软件安装和进程管理
  • [创业之路-645]:手机属于通信?还是属于消费类电子?还是移动互联网?
  • 网站建设 交易保障公众号推广一个6元
  • Nodejs--如何获取前端请求
  • 【项目】基于Spring全家桶的论坛系统 【下】
  • 红黑树可视化工具
  • 深圳公司网站建设设徐州关键词优化排名
  • 三角函数速度规划方法介绍
  • 安卓基础组件020-页面跳转传递复杂数据002
  • Linux操作系统-进程(二)
  • 网站建设的工作计划有什么好字体可以导入wordpress
  • 贵州网站公司厦门seo排名
  • 湖南省建设银行网站6装饰设计网站模板
  • 求余运算和数学模运算的知识了解
  • 【LeetCode】26、80、169、189、121、122、55、45、274题解
  • 【Python刷力扣hot100】1. Two Sum
  • 网站建设属于什么行业类别wordpress数据库文件在哪里设置
  • CCF-CSP认证考试 202309-3 梯度求解
  • JavaScript 保留关键字详解
  • 赣州那里有做网站的公司中国最新军事新闻最新消息2023
  • 使用 Python 将文件上传到 Supabase Storage 并记录元数据
  • 测试报告——“问卷考试系统”项目
  • 网站开发者常见问题网站建设 010
  • Digi-Star精准饲喂系统:牧场收益提升的利器,把Digi XBee模块应用到了极致
  • LED点阵屏
  • 图片方向矫正工具,批量处理超高效
  • 网站开发系统源代码模板兔自用主题WordPress
  • 鄢陵县网站wordpress编辑器器更换