hunk.code_window:         if (selection)
             originalEditor.setSelection(selection)
         }
       }
     }
  
hunk.labels: keep keep add keep keep keep
hunk.after_edit:       originalEditor.updateOptions(props.editorOptions)
  
hunk.file_path: packages/client/iframes/monaco/index.ts
hunk.type: add
file: import { computed, nextTick, unref } from 'vue'
  import { router } from '../routes'
  
  export function useRouteQuery<T extends string | string[]>(
    name: string,
    defaultValue?: T,
    {
      mode = 'replace',
    } = {},
  ) {
    return computed<any>({
      get() {
        const data = router.currentRoute.value.query[name]
        if (data == null)
          return defaultValue ?? null
        if (Array.isArray(data))
          return data.filter(Boolean)
        return data
      },
      set(v) {
        nextTick(() => {
          router[unref(mode) as 'replace' | 'push']({ query: { ...router.currentRoute.value.query, [name]: v } })
        })
      },
    })
  }
  