Socket
Socket
Sign inDemoInstall

moudles-cli

Package Overview
Dependencies
149
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    moudles-cli

脚手架1


Version published
Maintainers
1
Install size
10.9 MB
Created

Readme

Source

moudle-cli

moudle-cli 是 创建 业务组件 产品工程模板的命令行工具

安装

npm install -g moudle-cli

使用

moudle -v // 查看当前cli版本

moudle -h // 命令帮助信息

moudle create <projectName> // 创建业务组件的工程模板,可以指定模板类型及其版本

目录结构

│ index.js │ package.json │
├─lang │ cn.js │ en.js │
├─pages ├─router │ index.js │
└─store index.js

index.js


import router from './router'
import store from './store'
import cn from './lang/cn'
import en from './lang/en'

const lang = { cn, en }

export { router, store, lang }
export default { router, store, lang }

主要输出router,store,lang,不要随意修改。也可以拓展新的业务。

router/index.js


import Telephone from '../pages/telephone'
import TelephoneSearch from '../pages/telephoneSearch'
let routes = [
  {
    path: '/LM_FE_H5_phone/telephone',
    name: 'telephone',
    component: Telephone,
    meta: {
      title: 'LM_FE_H5_lang_phone.title'
    }
  },
  {
    path: '/LM_FE_H5_phone/telephoneSearch',
    name: '/LM_FE_H5_phone/telephoneSearch',
    component: TelephoneSearch,
    meta: {
      title: 'LM_FE_H5_lang_phone.title'
    }
  }

]

export default routes

title 由原来的 ‘i18n.t('LM_FE_H5_lang_phone.title')’ 改为 ‘LM_FE_H5_lang_phone.title’ 即可

国际化命名规范

 前缀 LM_FE_H5_lang_   + 业物组件名
 例: 常用电话(LM_FE_H5_lang_phone)

路由定义规范

 path与name相同
 /(package.json中name)/子路由名
 例如:/LM_FE_H5_phone/telephone

Keywords

FAQs

Last updated on 18 Jul 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc