vue-element-extends
Advanced tools
Comparing version 1.2.0 to 1.2.1
{ | ||
"name": "vue-element-extends", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Extension component based on ElementUI 2.x", | ||
@@ -14,3 +14,4 @@ "scripts": { | ||
"packages", | ||
"style" | ||
"style", | ||
"types" | ||
], | ||
@@ -21,2 +22,3 @@ "main": "lib/index.common.js", | ||
"jsdelivr": "lib/index.umd.js", | ||
"typings": "types/index.d.ts", | ||
"devDependencies": { | ||
@@ -27,2 +29,3 @@ "@vue/cli-plugin-babel": "^3.4.0", | ||
"babel-eslint": "^10.0.1", | ||
"babel-plugin-component": "^1.1.1", | ||
"element-ui": "^2.7.2", | ||
@@ -43,2 +46,3 @@ "eslint": "^5.8.0", | ||
"vue": "^2.6.10", | ||
"vue-cli-plugin-element": "^1.0.1", | ||
"vue-router": "^3.0.1", | ||
@@ -45,0 +49,0 @@ "vue-template-compiler": "^2.6.10", |
import XEUtils from 'xe-utils' | ||
import UtilHandle from './util' | ||
// 监听全局事件 | ||
var eventStore = [] | ||
var GlobalEvent = { | ||
const wheelName = UtilHandle.getWheelName() | ||
const eventStore = [] | ||
const GlobalEvent = { | ||
on (comp, type, cb) { | ||
@@ -14,3 +16,3 @@ eventStore.push({ comp, type, cb }) | ||
eventStore.forEach(({ comp, type, cb }) => { | ||
if (type === evnt.type || (evnt.type === 'wheel' && type === 'mousewheel')) { | ||
if (type === evnt.type || (type === 'mousewheel' && evnt.type === wheelName)) { | ||
cb.call(comp, evnt) | ||
@@ -22,7 +24,7 @@ } | ||
window.addEventListener('click', GlobalEvent.trigger, false) | ||
document.addEventListener('keydown', GlobalEvent.trigger, false) | ||
document.addEventListener('contextmenu', GlobalEvent.trigger, false) | ||
window.addEventListener(document.onmousewheel === undefined ? 'wheel' : 'mousewheel', GlobalEvent.trigger, false) | ||
window.addEventListener('click', GlobalEvent.trigger, false) | ||
window.addEventListener(wheelName, GlobalEvent.trigger, false) | ||
export default GlobalEvent |
@@ -5,2 +5,6 @@ import XEUtils from 'xe-utils' | ||
const UtilHandle = { | ||
browse, | ||
getWheelName () { | ||
return /Firefox/i.test(navigator.userAgent) ? 'DOMMouseScroll' : 'mousewheel' | ||
}, | ||
addClass (cell, clss) { | ||
@@ -7,0 +11,0 @@ let classList = cell.className.split(' ') |
@@ -13,2 +13,3 @@ # vue-element-extends | ||
* 支持自定义显示、隐藏列 | ||
* 支持滚动渲染、海量数据 | ||
* 支持导出 .csv 文件 | ||
@@ -29,2 +30,3 @@ * 支持原 ElTable 的所有功能、参数、方法、插槽 | ||
* 支持自定义显示、隐藏列 | ||
* 支持滚动渲染、海量数据 | ||
* 支持导出 .csv 文件 | ||
@@ -58,6 +60,10 @@ * 支持原 ElTable 的所有功能、参数、方法、插槽 | ||
import Vue from 'vue' | ||
import VueElementExtends from 'vue-element-extends' | ||
import { | ||
Editable, | ||
EditableColumn | ||
} from 'vue-element-extends' | ||
import 'vue-element-extends/lib/index.css' | ||
Vue.use(VueElementExtends) | ||
Vue.use(Editable) | ||
Vue.use(EditableColumn) | ||
``` | ||
@@ -70,5 +76,4 @@ | ||
<div> | ||
<el-button @click="$refs.editable.insert({name: 'Name'})">New</el-button> | ||
<el-button @click="$refs.editable.removeSelecteds()">Delete selecteds</el-button> | ||
<el-button @click="$refs.editable.clear()">Clear</el-button> | ||
<el-button @click="$refs.elxEditable.insert()">New</el-button> | ||
<el-button @click="$refs.elxEditable.removeSelecteds()">Delete selecteds</el-button> | ||
@@ -75,0 +80,0 @@ <elx-editable ref="editable" :data.sync="tableData"> |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
807380
24
15305
125
28