|
@@ -18,7 +18,9 @@
|
|
|
<slot>{{ content }}</slot>
|
|
|
</div>
|
|
|
</transition>
|
|
|
- <slot name="reference"></slot>
|
|
|
+ <span class="el-popover__reference-wrapper" ref="wrapper" >
|
|
|
+ <slot name="reference"></slot>
|
|
|
+ </span>
|
|
|
</span>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -87,8 +89,8 @@ export default {
|
|
|
let reference = this.referenceElm = this.reference || this.$refs.reference;
|
|
|
const popper = this.popper || this.$refs.popper;
|
|
|
|
|
|
- if (!reference && this.$slots.reference && this.$slots.reference[0]) {
|
|
|
- reference = this.referenceElm = this.$slots.reference[0].elm;
|
|
|
+ if (!reference && this.$refs.wrapper.children) {
|
|
|
+ reference = this.referenceElm = this.$refs.wrapper.children[0];
|
|
|
}
|
|
|
// 可访问性
|
|
|
if (reference) {
|
|
@@ -192,8 +194,8 @@ export default {
|
|
|
let reference = this.reference || this.$refs.reference;
|
|
|
const popper = this.popper || this.$refs.popper;
|
|
|
|
|
|
- if (!reference && this.$slots.reference && this.$slots.reference[0]) {
|
|
|
- reference = this.referenceElm = this.$slots.reference[0].elm;
|
|
|
+ if (!reference && this.$refs.wrapper.children) {
|
|
|
+ reference = this.referenceElm = this.$refs.wrapper.children[0];
|
|
|
}
|
|
|
if (!this.$el ||
|
|
|
!reference ||
|