Commit d1a2dbeb authored by 何虹's avatar 何虹 💬

优化

parent d2901c7e
......@@ -31,6 +31,7 @@
"script-loader": "^0.7.2",
"sortablejs": "^1.12.0",
"vue": "^2.6.11",
"vue-click-outside": "^1.1.0",
"vue-codemirror": "^4.0.6",
"vue-qr": "^2.3.0",
"vue-video-player": "^5.0.2",
......
......@@ -25,7 +25,7 @@
<template v-else-if="item.type==='elDatePicker'">
<el-date-picker
ref='currentDom'
v-clickoutside="hidePicker"
v-click-outside="hidePicker"
clearable
style="width:100%"
size='mini'
......@@ -42,7 +42,6 @@
<template v-else-if="item.type==='elDatePickerDatetime'">
<el-date-picker
ref='currentDom'
v-clickoutside="hidePicker"
clearable
style="width:100%"
size='mini'
......@@ -56,7 +55,7 @@
<template v-else-if="item.type==='elDatePickerDate'">
<el-date-picker
ref='currentDom'
v-clickoutside="hidePicker"
v-click-outside="hidePicker"
clearable
style="width:100%"
size='mini'
......@@ -70,7 +69,7 @@
<template v-else-if="item.type==='elDatePickerMonth'">
<el-date-picker
ref='currentDom'
v-clickoutside="hidePicker"
v-click-outside="hidePicker"
clearable
style="width:100%"
size='mini'
......@@ -84,7 +83,7 @@
<template v-else-if="item.type==='elDatePickerMonthRange'">
<el-date-picker
ref='currentDom'
v-clickoutside="hidePicker"
v-click-outside="hidePicker"
clearable
style="width:100%"
size='mini'
......@@ -394,12 +393,13 @@
</template>
<script>
// import elementUiMinins from '../../ucClass/elementUiMinins'
import clickOutSide from '../../ucClass/click-out-side'
// import clickOutSide from '../../ucClass/click-out-side'
import ClickOutside from 'vue-click-outside'
export default {
// mixins: [elementUiMinins],
name: 'dyncFormItemComponentChild',
directives: {
clickoutside: clickOutSide
ClickOutside
},
props: {
type: {},
......@@ -407,6 +407,9 @@ export default {
formParms: {}
},
methods: {
hidePicker1() {
this.$refs.currentDom.hidePicker()
},
hidePicker() {
this.$refs.currentDom.hidePicker()
},
......
export default {
bind(el, binding, vnode) {
el.handler = function(e) {
if (el.contains(e.target)) {
return false
}
// vnode.context[binding.expression] = false
binding.value()
}
el.stopProp = function(event) {
event.stopPropagation()
}
el.addEventListener('click', el.stopProp)
document.body.addEventListener('click', el.handler)
},
unbind(el, binding) {
el.removeEventListener('click', el.stopProp)
document.body.removeEventListener('click', el.handler)
},
install(Vue) {
Vue.directive('clickoutside', {
bind: this.bind,
unbind: this.unbind
})
}
}
......@@ -6,17 +6,18 @@ export default {
return false
}
// vnode.context[binding.expression] = false
binding.value()
}
el.stopProp = function(event) {
event.stopPropagation()
}
el.addEventListener('click', el.stopProp)
document.body.addEventListener('click', el.handler, false)
document.body.addEventListener('click', el.handler)
},
unbind(el, binding) {
el.removeEventListener('click', el.stopProp)
document.body.removeEventListener('click', el.handler, false)
document.body.removeEventListener('click', el.handler)
},
install(Vue) {
Vue.directive('clickoutside', {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment