demo.37e5e66a.js 1.6 KB

1
  1. import{c as t}from"./mobile.3062a9dc.js";import{A as e,B as a,r as o,o as r,c as l,f as p,z as d,j as i}from"./index.d870aa4d.js";const{createDemo:n}=t("drag");var s=n({setup:()=>({right:function(){return document.documentElement.clientWidth-300-9},bottom:function(){return document.documentElement.clientHeight-559}})});const u=d();e("data-v-7de0c5ea");const c={class:"demo full"},f=p("h2",null,"基础用法",-1),y=i("触摸移动"),m=p("h2",{style:{top:"30px",position:"relative"}},"限制拖拽方向",-1),x=i("只能X轴拖拽"),_=i("只能Y轴拖拽"),h=p("h2",{style:{top:"60px",position:"relative"}},"自动吸边",-1),b=i("拖动我"),g=p("h2",{style:{top:"90px",position:"relative"}},"限制拖动边界",-1),v=p("div",{class:"drag-boundary"},null,-1),j=i("限制拖拽边界");a();const E=u(((t,e,a,d,i,n)=>{const s=o("nut-button"),E=o("nut-drag");return r(),l("div",c,[f,p(E,{style:{top:"120px",left:"8px"}},{default:u((()=>[p(s,{type:"primary"},{default:u((()=>[y])),_:1})])),_:1}),m,p(E,{direction:"x",style:{top:"200px",left:"8px"}},{default:u((()=>[p(s,{type:"primary"},{default:u((()=>[x])),_:1})])),_:1}),p(E,{direction:"y",style:{top:"200px",right:"50px"}},{default:u((()=>[p(s,{type:"primary"},{default:u((()=>[_])),_:1})])),_:1}),h,p(E,{direction:"x",attract:!0,style:{top:"275px",left:"8px"}},{default:u((()=>[p(s,{type:"primary"},{default:u((()=>[b])),_:1})])),_:1}),g,v,p(E,{boundary:{top:361,left:9,bottom:t.bottom(),right:t.right()},style:{top:"400px",left:"50px"}},{default:u((()=>[p(s,{type:"primary"},{default:u((()=>[j])),_:1})])),_:1},8,["boundary"])])}));s.render=E,s.__scopeId="data-v-7de0c5ea";export default s;