UNPKG

vue3-quickstart-cli

Version:

一个用于快速创建 Vue3 项目的脚手架工具。

21 lines (20 loc) 587 B
import path from 'path'; import fs from 'fs-extra'; import chalk from 'chalk'; const plugin = { name: 'vueuse', apply(targetDir, pkg) { pkg.dependencies['@vueuse/core'] = '^10.9.0'; const usePath = path.join(targetDir, 'src/useCounter.ts'); fs.writeFileSync(usePath, `import { ref } from 'vue'; import { useIntervalFn } from '@vueuse/core'; export function useCounter() { const count = ref(0); useIntervalFn(() => count.value++, 1000); return { count }; } `); console.log(chalk.green('已集成 vueuse!')); } }; export default plugin;