File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 3
3
import menuMixin from ' ./menu-mixin' ;
4
4
import Emitter from ' element-ui/src/mixins/emitter' ;
5
5
import Popper from ' element-ui/src/utils/vue-popper' ;
6
+ import Clickoutside from ' element-ui/src/utils/clickoutside' ;
6
7
7
8
const poperMixins = {
8
9
props: {
29
30
30
31
components: { ElCollapseTransition },
31
32
33
+ directives: { Clickoutside },
34
+
32
35
props: {
33
36
index: {
34
37
type: String ,
226
229
this .referenceElm = this .$el ;
227
230
this .popperElm = this .$refs .menu ;
228
231
this .updatePlacement ();
232
+ },
233
+ close () {
234
+ this .$nextTick (() => {
235
+ if (this .opened ) this .rootMenu .closeMenu (this .index );
236
+ });
229
237
}
230
238
},
231
239
created () {
315
323
on- mouseenter= {this .handleMouseenter }
316
324
on- mouseleave= {this .handleMouseleave }
317
325
on- focus= {this .handleMouseenter }
326
+ v- clickoutside= {this .close }
318
327
>
319
328
< div
320
329
class = " el-submenu__title"
You can’t perform that action at this time.
0 commit comments