/** * {} * @author yutent * @date 2022/10/10 17:00:29 */ import fs from 'iofs' export function writeMainJs(file) { fs.echo( ` import { createApp } from 'vue' import App from './app.vue' import router from './router' import store from './store' const app = createApp(App) app.use(router).use(store).mount('.app') `, file ) } export function writeRouter(file) { fs.echo( ` import { createRouter, createWebHistory } from 'vue-router' import Home from './views/home.vue' const router = createRouter({ history: createWebHistory(), routes: [ { path: '/', name: 'home', component: Home }, { path: '/about', name: 'about', component: () => import('./views/about.vue') } ] }) export default router `, file ) } export function writeStore(file) { fs.echo( ` import { reactive } from 'vue' const store = reactive({ foo: 'bar', version: '0.0.6' }) export default function (app) { app.config.globalProperties.$store = store } `, file ) } export function writeAppVue(file) { fs.echo( ` `, file ) } export function writeHelloVue(file) { fs.echo( ` `, file ) } export function writeHomeVue(file) { fs.echo( ` `, file ) } export function writeAboutVue(file) { fs.echo( ` `, file ) }