Webpack、Vue、Element UI基础工程构建
来源:互联网 发布:json.parse解析不了 编辑:程序博客网 时间:2024/05/29 18:38
npm安装webpack,用于将工程的js、css、png等文件打包
安装vue-cli脚手架,如果没装成功,可能npm版本太低
跑完用vue -V查看Vue是否成功全局引入,注意这里的用大写的V
有了这两个就可以构建基本工程,这里将工程命名为lindl-blog-web
将下载好的工程导入idea,如果本地启动的服务太多,避免冲突,可以修改config下的index.js修改服务启动的端口
用npm run dev启动服务
服务启动完会自动打开vue官方示例首页说明工程构建完成
引入Element UI
或在package.json的dependencies配置
src/components/hello.vue
<template> <div class="hello"> <h1>{{ msg }}</h1> <el-button>默认按钮</el-button> <el-button type="primary">主要按钮</el-button> <el-button type="text">文字按钮</el-button> </div></template><script> export default { name: 'hello', data () { return { msg: 'Welcome to LinDL Blog' } } }</script><style scoped> h1, h2 { font-weight: normal; } ul { list-style-type: none; padding: 0; } li { display: inline-block; margin: 0 10px; } a { color: #42b983; }</style>
main.js
import Vue from 'vue'import ElementUI from 'element-ui'import 'element-ui/lib/theme-default/index.css'Vue.config.productionTip=falseVue.use(ElementUI)new Vue({ el:'#app', router, template:'<App/>', components:{App}})
引入echart.js
主要用于绘制统计图,哪个页面用到就在哪个页面引
import echarts from 'echarts'
引入axios用于处理http请求
如果用ajax,需单独引入jquery
阅读全文
0 0
- Webpack、Vue、Element UI基础工程构建
- Webpack构建React基础工程
- webpack+vue 在使用element-ui时import 'element-ui/lib/theme-chalk/index.css‘失败
- 用Webpack构建Vue
- 用Webpack构建Vue
- webpack 构建Vue项目
- vue + webpack 构建项目
- vue + webpack 构建项目
- 搭建element-ui的Vue前端工程操作
- webpack---webpack构建vue多页面框架(一、工程布局)
- 从零开始,教你用Webpack构建React基础工程
- 从零开始,教你用Webpack构建React基础工程
- vue+webpack构建项目过程
- vue+webpack构建项目过程
- 浅谈用webpack构建Vue
- webpack构建vue-cli环境
- 使用webpack打包Vue工程
- 使用webpack打包vue工程
- 面试题:题目: 链表翻转。给出一个链表和一个数k,比如链表1→2→3→4→5→6,k=2,翻转后2→1→4→3→6→5
- 欧几里得小游戏
- C语言--数组(二)
- [Leetcode/Javascript] 461.Hamming Distance
- Centos7安装详解以及克隆配置
- Webpack、Vue、Element UI基础工程构建
- MYSQL中触发器
- Hibernate(三):三种实例状态
- python datetime的使用
- Quartz时间表达式备忘
- 低功耗蓝牙cc2541学习笔记之UART-2-驱动uart
- C++ Socket编程(二) send与recv 缓冲区与阻塞
- 面向对象思想
- XYNU OJ 1060—1069基础题(适合于C语言初学者)