JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q21341F
  • License MIT

A magical vue admin. An out-of-box UI solution for enterprise applications. Newest development stack of vue. Lots of awesome features

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@yuechan/element-design) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    element-design

    基于Element-ui 的Vue组件 (Vue.js 2.x)

    简介

    基于 element-ui 2.0 的代码进行封装,将频繁使用的组件抽离,使用简单的代码完成复杂的业务场景。

    安装

    npm i @yuechan/element-design

    使用

    在mian.js中配置增加下列配置

    import ElmDesign from '@yuechan/element-design'
    import '@yuechan/element-design/lib/elmDesign.min/css'
    
    Vue.use(elmDesign,{
      router,
      store,
      i18n: (key, value) => i18n.t(key, value)
    })

    下面添加国际化相关配置,由于不同项目国际化配置位置不同,下面贴出常用配置

    import elementEnLocale from 'element-ui/lib/locale/lang/en' // element-ui lang
    import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN'// element-ui lang
    import enLocale from './en'
    import zhLocale from './zh'
    import enEmLocale from '@yuechan/element-design/lang/en'
    import zhEmLocale from '@yuechan/element-design/lang/zh'
    
    const messages = {
      en: {
        ...enLocale, ...elementEnLocale, ...enEmLocale
      },
      zh: {
        ...zhLocale, ...elementZhLocale, ...zhEmLocale
      }
    }
    
    const i18n = new VueI18n({
      // set locale
      // options: en | zh | es
      locale: getLanguage(), // set locale messages
      messages,
      silentTranslationWarn: true
    })

    组件