在 Livewire 中使用 AlpineJS 的 floating-ui
首先安装 <https://github.com/awcodes/alpine floating ui 这个包。 app.css app.js 这样使用即可。 我查了一下,发现比起 popper.js,大家更推荐使用 floating ui……
GGAMI
首先安装 <https://github.com/awcodes/alpine floating ui 这个包。 app.css app.js 这样使用即可。 我查了一下,发现比起 popper.js,大家更推荐使用 floating ui……
首先安装 https://github.com/awcodes/alpine-floating-ui 这个包。
.panel {
display: none;
}
.arrow {
position: absolute;
background-color: inherit;
width: 8px;
height: 8px;
transform: rotate(45deg);
}import "./bootstrap";
import { Alpine, Livewire } from "../../vendor/livewire/livewire/dist/livewire.esm";
import focus from "@alpinejs/focus";
<div x-data="floatingUI({
offset: 8,
placement: 'bottom',
arrow: {
element: $refs.arrow
}
})" @mouseenter="show()" @mouseleave="hide()">
这样使用即可。
我查了一下,发现比起 popper.js,大家更推荐使用 floating-ui……