mirror of
https://github.com/imezx/Warp.git
synced 2025-04-24 15:10:03 +00:00
2 lines
2.4 KiB
JavaScript
2 lines
2.4 KiB
JavaScript
|
var VueDemi=function(n,t,a){if(n.install)return n;if(!t)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(t.version.slice(0,4)==="2.7."){let e=function(o,f){var i,r={},l={config:t.config,use:t.use.bind(t),mixin:t.mixin.bind(t),component:t.component.bind(t),provide:function(c,d){return r[c]=d,this},directive:function(c,d){return d?(t.directive(c,d),l):t.directive(c)},mount:function(c,d){return i||(i=new t(Object.assign({propsData:f},o,{provide:Object.assign(r,o.provide)})),i.$mount(c,d),i)},unmount:function(){i&&(i.$destroy(),i=void 0)}};return l};var v=e;for(var s in t)n[s]=t[s];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.warn=t.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=e}else if(t.version.slice(0,2)==="2.")if(a){for(var s in a)n[s]=a[s];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(t.version.slice(0,2)==="3."){for(var s in t)n[s]=t[s];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=t,n.Vue2=void 0,n.version=t.version,n.set=function(e,o,f){return Array.isArray(e)?(e.length=Math.max(e.length,o),e.splice(o,1,f),f):(e[o]=f,f)},n.del=function(e,o){if(Array.isArray(e)){e.splice(o,1);return}delete e[o]}}else console.error("[vue-demi] Vue version "+t.version+" is unsupported.");return n}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(n,t,a,s){"use strict";function v(o,f,i={}){let r;const{document:l=t.defaultDocument,...c}=i,d={onUpdate:u=>{e(f,u.oldIndex,u.newIndex)}},p=()=>{const u=typeof o=="string"?l?.querySelector(o):t.unrefElement(o);!u||r!==void 0||(r=new a(u,{...d,...c}))},y=()=>{r?.destroy(),r=void 0},h=(u,b)=>{if(b!==void 0)r?.option(u,b);else return r?.option(u)};return t.tryOnMounted(p),t.tryOnScopeDispose(y),{stop:y,start:p,option:h}}function e(o,f,i){const r=s.isRef(o),l=r?[...t.toValue(o)]:t.toValue(o);if(i>=0&&i<l.length){const c=l.splice(f,1)[0];s.nextTick(()=>{l.splice(i,0,c),r&&(o.value=l)})}}n.moveArrayElement=e,n.useSortable=v})(this.VueUse=this.VueUse||{},VueUse,Sortable,VueDemi);
|