1.0.0 • Published 3 years ago

asp-smart-ui-12 v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

asp-smart-layout 开发指南

安装

cnpm i asp-smart-layout -S

全量加载

import Vue from 'vue'
import AspSmartLayout from 'asp-smart-layout'

Vue.use(AspSmartLayout)

new Vue({
  el: '#app',
  render: h => h(App)
})

按需加载

借助 babel-plugin-component,我们可以只引入需要的组件,以达到减小项目体积的目的。

首先,安装 babel-plugin-component

老版本脚手架

然后,将 .babelrc 修改为:

{
  "presets": [["es2015", { "modules": false }]],
  "plugins": [
    [
      "component",
      {
        "libraryName": "asp-smart-layout",
         style: false
      }
    ]
  ]
}

新版本脚手架

然后,将 babel.config.js 修改为:

module.exports = {
  presets: [
    '@vue/cli-plugin-babel/preset'
  ],
  plugins: [        // element官方教程
    [
      'component',
      {
        'libraryName': 'asp-smart-layout',
        style: false
      }
    ]
  ]
}

接下来,如果你只希望引入部分组件,比如 tableform main.js 中写入以下内容:

import Vue from 'vue';
import { table } from 'asp-smart-layout';
import App from './App.vue';

Vue.use(table)

new Vue({
  el: '#app',
  render: h => h(App)
});

新发布说明

步骤:登录、打包、发布

查询npm上当前项目版本号

npm view 【项目名称】 versions

npm view asp-smart-layout version

```历次
npm view asp-smart-layout versions