1 Star 0 Fork 124

胡进东/nuxt-elm

forked from bowen/nuxt-elm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
template.js 800 Bytes
一键复制 编辑 原始数据 按行查看 历史
[cai.bowen] 提交于 2018-08-21 18:00 . 新增部分功能
/**
* pages模版快速生成脚本,执行命令 npm run tep `文件名`
*/
const fs = require('fs');
const dirName = process.argv[2];
if (!dirName) {
console.log('文件夹名称不能为空!');
console.log('示例:npm run create test');
process.exit(0);
}
// 页面模版
const indexTep = `<template>
<div class="${dirName}-page">
<mt-header fixed title="${dirName}"></mt-header>
${dirName}
</div>
</template>
<script>
export default {
head: {
title: '${dirName}'
}
}
</script>
<style lang="scss">
@import '../assets/styles/mixin';
.${dirName}-page {
padding: px2rem(88px) 0 0 0;
}
</style>
`;
process.chdir(`./pages`); // cd $1
fs.writeFileSync(`${dirName}.vue`, indexTep);
console.log(`模版${dirName}已创建`);
process.exit(0);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/hujindo123/nuxt-elm.git
git@gitee.com:hujindo123/nuxt-elm.git
hujindo123
nuxt-elm
nuxt-elm
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385