//引入main.ts
import Directives from "@/utils//drag";
createApp(App).use(Directives)
//直接再页面里使用
//dialog_wrap这个可以自定义 不过在下载的js里改下就好了
// 整个固定区块
<div class="dialog_wrap" v-dialogDrag="true">
// 可按下拖动的位置
<div class="dialog_content">
<div class="dialog_header">
//...
</div>
// 其他
</div>
</div>
//样式
.dialog_content {
position: fixed;
right: 0;
bottom: 0;
width: 392Px;
height: 580Px;
}
.dialog_header {
height: 50Px;
width: 100%;
}
vue3 拖拽效果
最新推荐文章于 2024-05-26 16:32:00 发布