const elStyle = document.documentElement.style
elStyle.setProperty('--popper-bottom', String(buttonRect.bottom) + 'px')
elStyle.setProperty('--popper-right', String(window.innerWidth - buttonRect.right) + 'px')
// popper.style.setProperty(
// 'inset',
// `${buttonRect.bottom}px ${window.innerWidth - buttonRect.right}px auto auto `,
// '!important',
// )
// popper.style.inset = `${buttonRect.bottom}px auto auto ${buttonRect.left}px !important`
colorPickerRef.value?.show()
:global(.color-popper) {
inset: var(--popper-bottom, 0px) var(--popper-right, 0px) auto auto !important;
// v-bind只作用于scope
// inset: v-bind(popperBottomRef) v-bind(popperRightRef) auto auto !important;
}
注释部分的方法不生效
发表回复