fix: popup clickoutside

This commit is contained in:
JiwenBai 2019-07-01 16:19:21 +08:00
parent 65d29a774a
commit 96f78c9ee3
3 changed files with 13 additions and 4 deletions

View File

@ -7,7 +7,7 @@ import WithPadding from './packages/common/WithPadding'
import WithMargin from './packages/common/WithMargin'
import MasonryGroup from './packages/common/MasonryGroup'
import Table from './packages/common/Table'
import AdvanceTable from './packages/common/AdvanceTable'
// import AdvanceTable from './packages/common/AdvanceTable'
import CheckBox from './packages/common/Checkbox'
import RoundButton from './packages/common/Button'
import Switch from './packages/common/Switch'
@ -40,7 +40,7 @@ function install (Vue) {
ServiceCard.install(Vue)
MasonryGroup.install(Vue)
Table.install(Vue)
AdvanceTable.install(Vue)
// AdvanceTable.install(Vue)
WithMargin.install(Vue)
CheckBox.install(Vue)
RoundButton.install(Vue)

View File

@ -59,7 +59,6 @@
"karma-spec-reporter": "0.0.32",
"karma-webpack": "^3.0.5",
"mocha": "^6.1.4",
"popper.js": "^1.15.0",
"prettier-eslint": "^9.0.0",
"progress-bar-webpack-plugin": "^1.12.1",
"sinon": "^7.3.2",
@ -68,7 +67,6 @@
"stylelint-config-recommended-scss": "^3.3.0",
"stylelint-scss": "^3.8.0",
"url-loader": "^1.1.2",
"v-click-outside-x": "^4.0.5",
"vue": "^2.6.10",
"vue-loader": "^15.7.0",
"vue-router": "^3.0.6",
@ -78,6 +76,8 @@
"webpack-dev-server": "^3.4.1"
},
"dependencies": {
"popper.js": "^1.15.0",
"v-click-outside-x": "^4.0.5",
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"@vue/babel-preset-jsx": "^1.0.0",
"ionicons": "^4.5.8",

View File

@ -10,6 +10,7 @@
</div>
<transition name="fade">
<div
@click="handleContentClick"
@mouseenter="handleMouseEnter"
@mouseleave="handleMouseLeave"
v-show="visible"
@ -92,7 +93,15 @@ export default {
this.show()
}
},
handleContentClick (e) {
if (this.transfer) {
e.stopPropagation()
}
},
handleClickOut () {
if (this.trigger !== 'click') {
return
}
this.hide()
},
hide () {