1.0.6 • Published 1 month ago

gt-coms-web v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

gt-coms-web

简介

内部项目公共模板(基于ant-design-vue@1.7.8)

安装

    npm install gt-coms-web --save

使用

全局使用
    import GtComsWeb from 'gt-coms-web'
    import 'gt-coms-web/lib/index/index.css'
    Vue.use(GtComsWeb)
按需加载(需配置babel.config.js)
    import { GtButton } from 'gt-coms-web'

配置babel.config.js

    npm install babel-plugin-import --save-dev
    const fs = require('fs')
    const path = require('path')
    module.exports = {
      presets: [
          '@vue/cli-plugin-babel/preset',
          [
          '@babel/preset-env',
          {
              useBuiltIns: 'entry',
              corejs: 3
          }
          ]
      ],
    + plugins: [
    +    [
    +    'import',
    +    {
    +        libraryName: 'gt-coms-web',
    +     camel2DashComponentName: false,
    +        camel2UnderlineComponentName: false,
    +        libraryDirectory: 'lib',
    +        style: name => {
    +        const relativePath = `${name}/index.css`
    +        if (
    +            fs.existsSync(path.join(__dirname, 'node_modules', relativePath))
    +        ) {
    +            return relativePath
    +        }
    +        return false
    +        }
    +    },
    +    'gt-coms-web'
    +    ]
    + ]
    }