0.0.7 • Published 4 years ago

tui-wangji104217 v0.0.7

Weekly downloads
14
License
MIT
Repository
-
Last release
4 years ago

t-ui

介绍

一个vue组件库

使用语言:typescript + vue

使用说明

安装

npm install --save tui-wangji104217

完整引入

在文件main.js里

import Tui from 'tui-wangji104217'
import 'tui-wangji104217/lib/theme-chalk/index.css'

Vue.use(Tui);

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

按需引入

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

首先,安装 babel-plugin-component:

npm install babel-plugin-component -D

然后,将 .babelrc 修改为:

{
  "presets": [["es2015", { "modules": false }]],
  "plugins": [
    [
      "component",
      {
        "libraryName": "@zto/zui",
        "styleLibraryName": "theme-chalk"
      }
    ]
  ]
}

接下来,如果你只希望引入部分组件,比如 Button 和 Select,那么需要在 main.js 中写入以下内容:

import Vue from 'vue';
import { Button, Select } from '@zto/zui';
import App from './App.vue';

Vue.component(Button.name, Button);
Vue.component(Select.name, Select);
/* 或写为
 * Vue.use(Button)
 * Vue.use(Select)
 */

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

4 years ago

0.0.5

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

5 years ago