vuecli3集成easyui
思路是这样的,首先要将jquery设置成全局,然后就可以正常使用easyUI了。
jquery安装命令:
npm install --save jquery
jquery-easyui安装命令:
npm install --save jquery-easyui
然后,重点是项目中的各个环节。
首先,在根目录(package.json目录)下新建两个文件,babel.config.js和vue.config.js
babel.config.js
module.exports = {
presets: [
'@vue/app'
]
}
vue.config.js
var webpack = require("webpack");
const Timestamp = new Date().getTime();
module.exports = {
configureWebpack: { // webpack 配置
output: { // 输出重构 打包编译后的 文件名称 【模块名称.版本号.时间戳】
filename: `[name].${process.env.VUE_APP_Version}.${Timestamp}.js`,
chunkFilename: `[name].${process.env.VUE_APP_Version}.${Timestamp}.js`
},
resolve: {
alias: {
'jquery': 'jquery'
} // 别名配置
},
plugins: [
new webpack.ProvidePlugin({
$:"jquery",
jQuery:"jquery",
"windows.jQuery":"jquery"
})
]
},
devServer: {
overlay: {
warnings: false,
errors: false
}
}
}
这两个文件完成之后,需要再main.js中引入jquery。
main.js
import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import VueResource from 'vue-resource'
import router from './router'
import App from './App.vue'
import store from './store/store.js'
import Cookie from "js-cookie"
import iView from 'iview';
import 'iview/dist/styles/iview.css';
import VueClipboards from 'vue-clipboards';
import 'vue-easytable/libs/themes-base/index.css'
import {VTable,VPagination} from 'vue-easytable'
import $ from 'jquery'
import easyui from 'jquery-easyui/js/jquery.easyui.min.js'
import 'jquery-easyui/css/easyui.css' Vue.config.productionTip = false;
Vue.prototype.$ = $;
Vue.prototype.jQuery = $; Vue.use(ElementUI)
Vue.use(VueResource)
Vue.use(iView)
Vue.use(VueClipboards)
Vue.use(easyui) Vue.component(VTable.name, VTable)
Vue.component(VPagination.name, VPagination) router.beforeEach(function(to, from, next){
if(to.name != null && to.name != 'Login'){
var uuid = Cookie.get("uuid");
if(uuid != undefined && uuid != null && uuid != ''){
next()
}else{
next({
path: '/login',
name: 'Login',
query: { redirect: to.fullPath }
})
}
}
next()
}) new Vue({
render: h => h(App),
router,
store
}).$mount('#app')
至此,就可以像jquery项目一样的在vuecli中使用easyui了,完美!
vuecli3集成easyui的更多相关文章
- Vue 集成easyUI
原 Vue 集成easyUI https://blog.csdn.net/m0_37948170/article/details/84960320 参考vue官网用cli创建了Vue项目之后: n ...
- SSM集成Easyui框架及多模块开发的认识
首先我们需要建立好一个emaven项目,并且在pom.xml中导入响应的jar包, <?xml version="1.0" encoding="UTF-8" ...
- struts2 集成 easyui
关键点: json数据格式 获取json数据 输出json 分页 #json数据格式# datagrid: {"total":1,"rows":[{" ...
- easyui实现分页
主要参考官方的文档,欢迎评论 1.集成easyui,下面是我的引入方式,我引入到了head.html 每次只要引入该页面就可以了. <!-- easyui样式支持 --><link ...
- jQuery EasyUI学习二
1. 课程介绍 1. Datagrid组件(掌握) 2. Dialog.form组件(掌握) 3. Layout.Tabs;(掌握) Datagrid组件 2.1. 部署运行pss启动无错 ...
- 【原】EasyUI ComboGrid 集成分页、按键示例
需求: 1.下拉框下拉时出现表格: 2.表格带分页功能: 3.可以使用向上键.向下键在表格中移动选择行数据: 4.可以使用回车键在表格中选中行数据: 5.在下拉框的文本框中输入内容,能查询表格: 6. ...
- SSM框架搭建(Spring+SpringMVC+MyBatis)与easyui集成并实现增删改查实现
一.用myEclipse初始化Web项目 新建一个web project: 二.创建包 controller //控制类 service //服务接口 service.impl //服务 ...
- Spring+SpringMVC+MyBatis+easyUI整合进阶篇(十二)Spring集成Redis缓存
作者:13 GitHub:https://github.com/ZHENFENG13 版权声明:本文为原创文章,未经允许不得转载. 整合Redis 本来以为类似的Redis教程和整合代码应该会很多,因 ...
- Atitit easyui翻页组件与vue的集成解决方案attilax总结
Atitit easyui翻页组件与vue的集成解决方案attilax总结 ===============使用1 ===========\paggingUtil_easyui_vue.js2 C:\U ...
随机推荐
- Qt中C++与QML交互
###main.c部分int main(int argc, char *argv[]){ QString info1 = "xxxxxxxxxxx"; QString ...
- [nginx] nginx使用SNI功能的方法
SNI是什么 在使用TLS的时候,http server希望根据HTTP请求中HOST的不同,来决定使用不同的证书. SNI细节 由于HTTP的HOST字段在HTTP GET中.而TLS的握手以及证书 ...
- Innodb关键特性之自适用Hash索引
一.索引的资源消耗分析 1.索引三大特点 1.小:只在一个到多个列建立索引 2.有序:可以快速定位终点 3.有棵树:可以定位起点,树高一般小于等于3 2.索引的资源消耗点 1.树的高度,顺序访问索引的 ...
- JIT优化的小问题
同事问了个问题,挺有意思的,代码: public class TestJIT{ private static boolean sss; public static void main(String[] ...
- pandas里面过滤列出现ValueError: cannot index with vector containing NA / NaN values错误的解决方法(转)
###df_18的字段fuek是否包含 / df_18[df_18['fuel'].str.contains('/')] 报错: ValueError Traceback (most recent c ...
- 集合(python)
# -*- coding: utf-8 -*- class Array(object): def __init__(self, size=32, init=None): self._size = si ...
- 遍历SQL SERVER中所有存储过程和触发器
如果需要查找某个存储过程或触发器中是否含有某段文本(比如:你想知道有哪些存储过程操作了某个表) 可以这么写 select name from sysobjects o, syscomments s w ...
- U盘损坏?
- feign.RetryableException: Read timed out executing xxx
feign.RetryableException: Read timed out executing GET http://common-item/service/item/selectTbItemA ...
- POJ-2115-C Looooops(线性同余方程)
链接: https://vjudge.net/problem/POJ-2115 题意: A Compiler Mystery: We are given a C-language style for ...