Element: [Feature Request] expects Popover to support multiple references

Created on 27 Sep 2017  ·  4Comments  ·  Source: ElemeFE/element

Existing Component

Component Name

popover

Description

<el-popover ref="popover1" placement="top-start" title="标题" width="200" trigger="hover" content="this is content"></el-popover>

<button v-popover:popover1>btn1</button>

<button v-popover:popover1>btn2</button>

只在第2个button上起作用

export default {

   bind(el, binding, vnode) {

          vnode.context.$refs[binding.arg].$refs.reference = el;

   }

};

reference 是否能够改为一个数组,而不是一个对象呢

Most helpful comment

A hack for future readers: https://jsfiddle.net/hsymu9bk/1/

All 4 comments

Translation of this issue:

Existing Component

yes

Component Name

Popover

Description


Only works on second button
Export default {

Bind (EL, binding, vnode) {
Vnode.context.$refs[binding.arg].$refs.reference = el;

}
};

Can reference be changed into an array instead of an object?

Sorry, we have no plan to support this.

A hack for future readers: https://jsfiddle.net/hsymu9bk/1/

@syn-zeta good job. thanks a lot

Was this page helpful?
0 / 5 - 0 ratings