VueUse 集成
reactive-vscode 为 VSCode 扩展开发提供了一个可选的 VueUse 集成。这个包包含了一部分与 Node.js 环境兼容的 VueUse 函数。这意味着依赖浏览器环境的函数已被移除。
另外,这个包使用 @reactive-vscode/reactivity 替代了 vue-demi 包来提供 Vue 响应式 API。这意味着依赖 Vue 渲染 API 的函数已被移除。
使用方法
bash
pnpm install -D @reactive-vscode/vueuse
bash
npm install -D @reactive-vscode/vueuse
bash
yarn add -D @reactive-vscode/vueuse
ts
import { useIntervalFn } from '@reactive-vscode/vueuse'
import { defineExtension } from 'reactive-vscode'
export = defineExtension(() => {
useIntervalFn(() => {
console.log('Hello World')
}, 1000)
})
可用函数
所有与 Node.js 环境兼容且不需要 Vue 渲染 API 的 VueUse 函数都可在此包中使用。查看 packages/vueuse/src/index.ts
获取完整列表。