airi / assets /audio-DwTx1Y8I.js
nekomeowww's picture
release: build 032a44c661c1020a4d672f3185064600fd43114d
d8d73ee
raw
history blame
604 Bytes
import{createBaseVNode as e,createElementBlock as t,defineComponent as n,openBlock as r,ref as i}from"./index-BtAisBe9.js";var a=n({__name:`audio`,setup(n){let a=i(),o=i();function s(e){var t,n;if(!e)return;let r=(t=o.value)==null||(t=t.files)==null?void 0:t[0];if(!r)return;let i=document.createElement(`audio`);(n=a.value)?.appendChild(i),i.src=URL.createObjectURL(r),i.controls=!0,i.load(),i.play()}return(n,i)=>(r(),t(`div`,null,[e(`div`,null,[e(`div`,{ref_key:`containerRef`,ref:a},null,512),e(`input`,{ref_key:`fileInputRef`,ref:o,type:`file`,onChange:s},null,544)])]))}}),o=a;export{o as default};