mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
28 lines
626 B
TypeScript
28 lines
626 B
TypeScript
import { CustomNavbarItem } from './custom-navbar-item'
|
|
|
|
export const popperMixin = Vue.extend({
|
|
props: {
|
|
item: {
|
|
type: CustomNavbarItem,
|
|
required: true,
|
|
},
|
|
container: {
|
|
type: HTMLElement,
|
|
required: true,
|
|
},
|
|
},
|
|
mounted() {
|
|
const navBarItem = this.item as CustomNavbarItem
|
|
const containerElement = this.container as HTMLElement
|
|
if (containerElement) {
|
|
navBarItem?.usePopper(containerElement, this.$el.parentElement)
|
|
}
|
|
},
|
|
methods: {
|
|
popupShow() {
|
|
const navBarItem = this.item as CustomNavbarItem
|
|
navBarItem?.popper?.update()
|
|
},
|
|
},
|
|
})
|