jerrywu001 / sandpack-vue3

Vue3 components that give you the power of editable sandboxes that run in the browser.
https://sandpack-vue3.js-bridge.com
MIT License
86 stars 9 forks source link

咋监听文件的变化呢 #9

Closed npmrun closed 1 year ago

npmrun commented 1 year ago

找了半天,没找到,加上龟速网络。麻烦您知道的话说一下呗

jerrywu001 commented 1 year ago

https://sandpack.codesandbox.io/docs/advanced-usage/hooks#usesandpack

npmrun commented 1 year ago

谢谢,我用这个监听到了

const { sandpack } = useSandpack();

watch(()=>sandpack.files, ()=>{
  console.log(sandpack.files)
})