vue 组件库 heyui@2.20.0 发布,按需加载功能上线

栏目: 软件资讯 · 发布时间: 6年前

内容简介:HeyUI组件库 如果你还不了解heyui组件库,欢迎来我们的官网或者 https://gitee.com/heyui/heyui 参观。 官网 https://gitee.com/heyui/heyui 当然,如果能给我们一颗:sparkles::sparkles::sparkles:,那是最赞的了...

HeyUI组件库

如果你还不了解heyui组件库,欢迎来我们的官网或者 https://gitee.com/heyui/heyui 参观。

当然,如果能给我们一颗✨✨✨,那是最赞的了!

按需加载

当heyui组件库的组件越来越多的时候,按需加载的功能终于上线了。

话不多少,先把按需加载的使用方式放出来。

在线示例

按需加载在线示例

以此图为例,按需加载后,js与css的大小将大幅度减小。

vue 组件库 heyui@2.20.0 发布,按需加载功能上线

 

示例代码

import Vue from 'vue';
import App from './app.vue';
import { install, Prototypes, Button, DropdownMenu } from 'heyui';

require('../css/module.less');

Vue.use(install, { components: { Button, DropdownMenu }, prototypes: Prototypes });

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

module.less

@import (less) "../../themes/common.base.less";
@import (less) "../../themes/components/dropdown-menu.less";

其中,common.base.less将引用系统的一些基础样式,其他的组件需要自己加载样式。

common.base.less

@import (less) "./mixins/index.less";
@import (less) "./fonts/font.less";

@import "extend.less";
@import "checkbox.less";
@import "radio.less";
@import "search.less";
@import "notify.less";
@import "message.less";
@import "notice.less";
@import "modal.less";
@import "tooltip.less";
@import "dropdown.less";
@import "dropdown-custom.less";
@import "tabs.less";
@import "input.less";
@import "input-group.less";
@import "button.less";
@import "grid.less";
@import "word-count.less";

其他的组件加载请参考以下文件: https://github.com/heyui/heyui/blob/master/src/components.js


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Automate This

Automate This

Christopher Steiner / Portfolio / 2013-8-9 / USD 25.95

"The rousing story of the last gasp of human agency and how today's best and brightest minds are endeavoring to put an end to it." It used to be that to diagnose an illness, interpret legal docume......一起来看看 《Automate This》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

SHA 加密
SHA 加密

SHA 加密工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具