├── .npmignore ├── src ├── utils │ ├── util.js │ └── validatorProps.js ├── assets │ ├── icon.png │ ├── logo.png │ ├── icon-ext.png │ ├── loading-0.gif │ ├── loading-1.gif │ ├── loading-2.gif │ ├── font │ │ ├── iconfont.eot │ │ ├── iconfont.ttf │ │ └── iconfont.woff │ ├── lay-date │ │ └── font │ │ │ ├── iconfont.eot │ │ │ ├── iconfont.ttf │ │ │ ├── iconfont.woff │ │ │ └── iconfont.svg │ └── vue-layui.css ├── components │ ├── time-picker │ │ ├── src │ │ │ ├── utils │ │ │ │ └── index.js │ │ │ ├── header │ │ │ │ └── index.vue │ │ │ ├── content │ │ │ │ └── time-table.vue │ │ │ ├── main │ │ │ │ └── index.vue │ │ │ └── date-picker.vue │ │ ├── index.js │ │ └── README.md │ ├── row │ │ ├── index.js │ │ └── src │ │ │ └── row.vue │ ├── col │ │ ├── index.js │ │ └── src │ │ │ └── col.vue │ ├── body │ │ ├── src │ │ │ └── body.vue │ │ └── index.js │ ├── footer │ │ ├── src │ │ │ └── footer.vue │ │ └── index.js │ ├── header │ │ ├── src │ │ │ └── header.vue │ │ └── index.js │ ├── button │ │ ├── index.js │ │ └── src │ │ │ ├── button-group.vue │ │ │ ├── button-container.vue │ │ │ └── button.vue │ ├── logo │ │ ├── src │ │ │ └── logo.vue │ │ └── index.js │ ├── date-picker │ │ ├── index.js │ │ ├── README.md │ │ └── src │ │ │ ├── utils │ │ │ └── index.js │ │ │ ├── content │ │ │ ├── month-table.vue │ │ │ ├── year-table.vue │ │ │ └── date-table.vue │ │ │ ├── header │ │ │ └── index.vue │ │ │ └── date-picker.vue │ ├── timeline │ │ ├── src │ │ │ ├── timeline.vue │ │ │ └── timeline-item.vue │ │ └── index.js │ ├── button-group │ │ └── index.js │ ├── menu │ │ ├── index.js │ │ └── src │ │ │ ├── menu-child-item.vue │ │ │ ├── menu.vue │ │ │ └── menu-item.vue │ ├── rate │ │ ├── index.js │ │ └── src │ │ │ └── rate.vue │ ├── admin │ │ ├── index.js │ │ └── src │ │ │ └── admin.vue │ ├── card │ │ ├── index.js │ │ └── src │ │ │ └── card.vue │ ├── form │ │ ├── index.js │ │ └── src │ │ │ ├── form.vue │ │ │ └── form-item.vue │ ├── line │ │ ├── index.js │ │ └── src │ │ │ └── line.vue │ ├── side │ │ ├── index.js │ │ └── src │ │ │ └── side.vue │ ├── tabs │ │ ├── index.js │ │ └── src │ │ │ ├── tab-pane.vue │ │ │ └── tabs.vue │ ├── alert │ │ ├── index.js │ │ └── src │ │ │ └── alert.vue │ ├── badge │ │ ├── index.js │ │ └── src │ │ │ └── badge.vue │ ├── block │ │ ├── index.js │ │ └── src │ │ │ └── block.vue │ ├── button-container │ │ └── index.js │ ├── input │ │ ├── index.js │ │ └── src │ │ │ └── input.vue │ ├── radio │ │ ├── index.js │ │ └── src │ │ │ └── radio.vue │ ├── slider │ │ ├── index.js │ │ └── src │ │ │ ├── slider-btn.vue │ │ │ └── slider.vue │ ├── table │ │ ├── index.js │ │ └── src │ │ │ ├── table-column.vue │ │ │ ├── table-header.vue │ │ │ ├── table-colgroup.vue │ │ │ ├── table-tr.vue │ │ │ └── table.vue │ ├── select │ │ ├── index.js │ │ └── src │ │ │ └── select.vue │ ├── switch │ │ ├── index.js │ │ └── src │ │ │ └── switch.vue │ ├── carousel │ │ ├── index.js │ │ └── src │ │ │ ├── carousel-item.vue │ │ │ └── carousel.vue │ ├── checkbox │ │ ├── index.js │ │ └── src │ │ │ └── checkbox.vue │ ├── collapse │ │ ├── index.js │ │ └── src │ │ │ ├── collapse.vue │ │ │ └── collapse-item.vue │ ├── menu-item │ │ └── index.js │ ├── progress │ │ ├── index.js │ │ └── src │ │ │ └── progress.vue │ ├── tab-pane │ │ └── index.js │ ├── textarea │ │ ├── index.js │ │ └── src │ │ │ └── textarea.vue │ ├── container │ │ ├── index.js │ │ └── src │ │ │ └── container.vue │ ├── form-item │ │ └── index.js │ ├── breadcrumb │ │ ├── index.js │ │ └── src │ │ │ ├── breadcrumb-item.vue │ │ │ └── breadcrumb.vue │ ├── pagination │ │ └── index.js │ ├── color-picker │ │ ├── index.js │ │ └── src │ │ │ ├── color.js │ │ │ ├── color-box.vue │ │ │ ├── color-side.vue │ │ │ └── color-picker.vue │ ├── table-column │ │ └── index.js │ ├── menu-child-item │ │ └── index.js │ ├── carousel-item │ │ └── index.js │ ├── collapse-item │ │ └── index.js │ ├── timeline-item │ │ └── index.js │ └── breadcrumb-item │ │ └── index.js ├── mixins │ ├── eventHub.js │ ├── popper.js │ └── emitter.js └── index.js ├── .postcssrc.js ├── public ├── favicon.ico └── index.html ├── lib ├── img │ ├── icon.551539f8.png │ ├── icon-ext.ba81b24c.png │ └── loading-0.a72011cc.gif └── fonts │ ├── iconfont.0208023e.eot │ ├── iconfont.d8583a84.ttf │ └── iconfont.e9caaa06.woff ├── examples └── doc │ ├── views │ ├── Admin.vue │ ├── Auxiliar.vue │ ├── Test.vue │ ├── Timeline.vue │ ├── Rate.vue │ ├── Animation.vue │ ├── Layer.vue │ ├── DatePicker.md │ ├── ColorPicker.vue │ ├── Laypage.vue │ ├── Badge.vue │ ├── Progress.vue │ ├── Slider.vue │ ├── Carousel.vue │ ├── Tabs.vue │ ├── Table.vue │ ├── Home.vue │ └── Panel.vue │ ├── main.js │ ├── components │ └── demo-block.vue │ └── router.js ├── .gitignore ├── babel.config.js ├── README.md ├── webpack.config.js ├── .eslintrc.js ├── .github └── workflows │ └── build-docs.yml ├── LICENSE ├── vue.config.js └── package.json /.npmignore: -------------------------------------------------------------------------------- 1 | public 2 | src -------------------------------------------------------------------------------- /src/utils/util.js: -------------------------------------------------------------------------------- 1 | export const noop = () => {}; 2 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /src/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/src/assets/icon.png -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/src/assets/logo.png -------------------------------------------------------------------------------- /lib/img/icon.551539f8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/lib/img/icon.551539f8.png -------------------------------------------------------------------------------- /src/assets/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/src/assets/icon-ext.png -------------------------------------------------------------------------------- /src/assets/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/src/assets/loading-0.gif -------------------------------------------------------------------------------- /src/assets/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/src/assets/loading-1.gif -------------------------------------------------------------------------------- /src/assets/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/src/assets/loading-2.gif -------------------------------------------------------------------------------- /lib/img/icon-ext.ba81b24c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/lib/img/icon-ext.ba81b24c.png -------------------------------------------------------------------------------- /lib/img/loading-0.a72011cc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/lib/img/loading-0.a72011cc.gif -------------------------------------------------------------------------------- /src/assets/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/src/assets/font/iconfont.eot -------------------------------------------------------------------------------- /src/assets/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/src/assets/font/iconfont.ttf -------------------------------------------------------------------------------- /src/assets/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/src/assets/font/iconfont.woff -------------------------------------------------------------------------------- /lib/fonts/iconfont.0208023e.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/lib/fonts/iconfont.0208023e.eot -------------------------------------------------------------------------------- /lib/fonts/iconfont.d8583a84.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/lib/fonts/iconfont.d8583a84.ttf -------------------------------------------------------------------------------- /lib/fonts/iconfont.e9caaa06.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/lib/fonts/iconfont.e9caaa06.woff -------------------------------------------------------------------------------- /src/assets/lay-date/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/src/assets/lay-date/font/iconfont.eot -------------------------------------------------------------------------------- /src/assets/lay-date/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/src/assets/lay-date/font/iconfont.ttf -------------------------------------------------------------------------------- /src/assets/lay-date/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kouchao/vue-layui/HEAD/src/assets/lay-date/font/iconfont.woff -------------------------------------------------------------------------------- /src/components/time-picker/src/utils/index.js: -------------------------------------------------------------------------------- 1 | // 获取数字 补零 2 | export const getText = (num) => { 3 | return num < 10 ? `0${num}` : `${num}`; 4 | }; 5 | -------------------------------------------------------------------------------- /src/components/row/index.js: -------------------------------------------------------------------------------- 1 | import Row from './src/row'; 2 | /* istanbul ignore next */ 3 | Row.install = function (Vue) { 4 | Vue.component(Row.name, Row); 5 | }; 6 | 7 | export default Row; 8 | -------------------------------------------------------------------------------- /src/components/col/index.js: -------------------------------------------------------------------------------- 1 | import Col from './src/col'; 2 | 3 | /* istanbul ignore next */ 4 | Col.install = function (Vue) { 5 | Vue.component(Col.name, Col); 6 | }; 7 | 8 | export default Col; 9 | -------------------------------------------------------------------------------- /src/components/body/src/body.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /src/components/footer/src/footer.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /src/components/header/src/header.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /src/components/button/index.js: -------------------------------------------------------------------------------- 1 | import Button from './src/button'; 2 | 3 | /* istanbul ignore next */ 4 | Button.install = function (Vue) { 5 | Vue.component(Button.name, Button); 6 | }; 7 | 8 | export default Button; 9 | -------------------------------------------------------------------------------- /src/components/time-picker/src/header/index.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /src/components/button/src/button-group.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /src/components/logo/src/logo.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /src/components/button/src/button-container.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /src/components/date-picker/index.js: -------------------------------------------------------------------------------- 1 | import DatePicker from './src/date-picker'; 2 | 3 | /* istanbul ignore next */ 4 | DatePicker.install = function (Vue) { 5 | Vue.component(DatePicker.name, DatePicker); 6 | }; 7 | 8 | export default DatePicker; 9 | -------------------------------------------------------------------------------- /src/components/time-picker/index.js: -------------------------------------------------------------------------------- 1 | import DatePicker from './src/date-picker'; 2 | 3 | /* istanbul ignore next */ 4 | DatePicker.install = function (Vue) { 5 | Vue.component(DatePicker.name, DatePicker); 6 | }; 7 | 8 | export default DatePicker; 9 | -------------------------------------------------------------------------------- /src/components/timeline/src/timeline.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/doc/views/Admin.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/components/button-group/index.js: -------------------------------------------------------------------------------- 1 | import ButtonGroup from '../button/src/button-group'; 2 | 3 | /* istanbul ignore next */ 4 | ButtonGroup.install = function (Vue) { 5 | Vue.component(ButtonGroup.name, ButtonGroup); 6 | }; 7 | 8 | export default ButtonGroup; 9 | -------------------------------------------------------------------------------- /src/components/menu/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 3 | */ 4 | 5 | import LayMenu from './src/menu'; 6 | 7 | /* istanbul ignore next */ 8 | LayMenu.install = function (Vue) { 9 | Vue.component(LayMenu.name, LayMenu); 10 | }; 11 | 12 | export default LayMenu; 13 | -------------------------------------------------------------------------------- /src/components/rate/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayRate from './src/rate'; 6 | /* istanbul ignore next */ 7 | LayRate.install = function (Vue) { 8 | Vue.component(LayRate.name, LayRate); 9 | }; 10 | 11 | export default LayRate; 12 | -------------------------------------------------------------------------------- /src/components/admin/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 3 | */ 4 | 5 | import LayAdmin from './src/admin'; 6 | 7 | /* istanbul ignore next */ 8 | LayAdmin.install = function (Vue) { 9 | Vue.component(LayAdmin.name, LayAdmin); 10 | }; 11 | 12 | export default LayAdmin; 13 | -------------------------------------------------------------------------------- /src/components/body/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayBody from './src/body'; 6 | 7 | /* istanbul ignore next */ 8 | LayBody.install = function (Vue) { 9 | Vue.component(LayBody.name, LayBody); 10 | }; 11 | 12 | export default LayBody; 13 | -------------------------------------------------------------------------------- /src/components/card/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayCard from './src/card'; 6 | 7 | /* istanbul ignore next */ 8 | LayCard.install = function (Vue) { 9 | Vue.component(LayCard.name, LayCard); 10 | }; 11 | 12 | export default LayCard; 13 | -------------------------------------------------------------------------------- /src/components/form/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayForm from './src/form'; 6 | 7 | /* istanbul ignore next */ 8 | LayForm.install = function (Vue) { 9 | Vue.component(LayForm.name, LayForm); 10 | }; 11 | 12 | export default LayForm; 13 | -------------------------------------------------------------------------------- /src/components/line/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayLine from './src/line'; 6 | 7 | /* istanbul ignore next */ 8 | LayLine.install = function (Vue) { 9 | Vue.component(LayLine.name, LayLine); 10 | }; 11 | 12 | export default LayLine; 13 | -------------------------------------------------------------------------------- /src/components/logo/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayLogo from './src/logo'; 6 | 7 | /* istanbul ignore next */ 8 | LayLogo.install = function (Vue) { 9 | Vue.component(LayLogo.name, LayLogo); 10 | }; 11 | 12 | export default LayLogo; 13 | -------------------------------------------------------------------------------- /src/components/side/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LaySide from './src/side'; 6 | 7 | /* istanbul ignore next */ 8 | LaySide.install = function (Vue) { 9 | Vue.component(LaySide.name, LaySide); 10 | }; 11 | 12 | export default LaySide; 13 | -------------------------------------------------------------------------------- /src/components/tabs/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/9/3 3 | */ 4 | 5 | import LayTabs from './src/tabs'; 6 | 7 | /* istanbul ignore next */ 8 | LayTabs.install = function (Vue) { 9 | Vue.component(LayTabs.name, LayTabs); 10 | }; 11 | 12 | export default LayTabs; 13 | -------------------------------------------------------------------------------- /src/components/alert/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/9/4 3 | */ 4 | 5 | import LayAlert from './src/alert'; 6 | 7 | /* istanbul ignore next */ 8 | LayAlert.install = function (Vue) { 9 | Vue.component(LayAlert.name, LayAlert); 10 | }; 11 | 12 | export default LayAlert; 13 | -------------------------------------------------------------------------------- /src/components/badge/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayBadge from './src/badge'; 6 | 7 | /* istanbul ignore next */ 8 | LayBadge.install = function (Vue) { 9 | Vue.component(LayBadge.name, LayBadge); 10 | }; 11 | 12 | export default LayBadge; 13 | -------------------------------------------------------------------------------- /src/components/block/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayBlock from './src/block'; 6 | 7 | /* istanbul ignore next */ 8 | LayBlock.install = function (Vue) { 9 | Vue.component(LayBlock.name, LayBlock); 10 | }; 11 | 12 | export default LayBlock; 13 | -------------------------------------------------------------------------------- /src/components/button-container/index.js: -------------------------------------------------------------------------------- 1 | import ButtonContainer from '../button/src/button-container'; 2 | 3 | /* istanbul ignore next */ 4 | ButtonContainer.install = function (Vue) { 5 | Vue.component(ButtonContainer.name, ButtonContainer); 6 | }; 7 | 8 | export default ButtonContainer; 9 | -------------------------------------------------------------------------------- /src/components/input/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayInput from './src/input'; 6 | 7 | /* istanbul ignore next */ 8 | LayInput.install = function (Vue) { 9 | Vue.component(LayInput.name, LayInput); 10 | }; 11 | 12 | export default LayInput; 13 | -------------------------------------------------------------------------------- /src/components/radio/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayRadio from './src/radio'; 6 | 7 | /* istanbul ignore next */ 8 | LayRadio.install = function (Vue) { 9 | Vue.component(LayRadio.name, LayRadio); 10 | }; 11 | 12 | export default LayRadio; 13 | -------------------------------------------------------------------------------- /src/components/slider/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/9/5 3 | */ 4 | 5 | import LaySlider from './src/slider'; 6 | /* istanbul ignore next */ 7 | LaySlider.install = function (Vue) { 8 | Vue.component(LaySlider.name, LaySlider); 9 | }; 10 | 11 | export default LaySlider; 12 | -------------------------------------------------------------------------------- /src/components/table/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/9/3 3 | */ 4 | 5 | import LayTable from './src/table'; 6 | 7 | /* istanbul ignore next */ 8 | LayTable.install = function (Vue) { 9 | Vue.component(LayTable.name, LayTable); 10 | }; 11 | 12 | export default LayTable; 13 | -------------------------------------------------------------------------------- /src/components/footer/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayFooter from './src/footer'; 6 | 7 | /* istanbul ignore next */ 8 | LayFooter.install = function (Vue) { 9 | Vue.component(LayFooter.name, LayFooter); 10 | }; 11 | 12 | export default LayFooter; 13 | -------------------------------------------------------------------------------- /src/components/header/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayHeader from './src/header'; 6 | 7 | /* istanbul ignore next */ 8 | LayHeader.install = function (Vue) { 9 | Vue.component(LayHeader.name, LayHeader); 10 | }; 11 | 12 | export default LayHeader; 13 | -------------------------------------------------------------------------------- /src/components/select/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LaySelect from './src/select'; 6 | 7 | /* istanbul ignore next */ 8 | LaySelect.install = function (Vue) { 9 | Vue.component(LaySelect.name, LaySelect); 10 | }; 11 | 12 | export default LaySelect; 13 | -------------------------------------------------------------------------------- /src/components/switch/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LaySwitch from './src/switch'; 6 | 7 | /* istanbul ignore next */ 8 | LaySwitch.install = function (Vue) { 9 | Vue.component(LaySwitch.name, LaySwitch); 10 | }; 11 | 12 | export default LaySwitch; 13 | -------------------------------------------------------------------------------- /src/components/admin/src/admin.vue: -------------------------------------------------------------------------------- 1 | 6 | 14 | -------------------------------------------------------------------------------- /src/components/carousel/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/9/7 3 | */ 4 | 5 | import LayCarousel from './src/carousel'; 6 | 7 | /* istanbul ignore next */ 8 | LayCarousel.install = function (Vue) { 9 | Vue.component(LayCarousel.name, LayCarousel); 10 | }; 11 | 12 | export default LayCarousel; 13 | -------------------------------------------------------------------------------- /src/components/checkbox/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayCheckbox from './src/checkbox'; 6 | 7 | /* istanbul ignore next */ 8 | LayCheckbox.install = function (Vue) { 9 | Vue.component(LayCheckbox.name, LayCheckbox); 10 | }; 11 | 12 | export default LayCheckbox; 13 | -------------------------------------------------------------------------------- /src/components/collapse/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/31 3 | */ 4 | 5 | import LayCollapse from './src/collapse'; 6 | 7 | /* istanbul ignore next */ 8 | LayCollapse.install = function (Vue) { 9 | Vue.component(LayCollapse.name, LayCollapse); 10 | }; 11 | 12 | export default LayCollapse; 13 | -------------------------------------------------------------------------------- /src/components/menu-item/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 3 | */ 4 | 5 | import LayMenuItem from '../menu/src/menu-item'; 6 | 7 | /* istanbul ignore next */ 8 | LayMenuItem.install = function (Vue) { 9 | Vue.component(LayMenuItem.name, LayMenuItem); 10 | }; 11 | 12 | export default LayMenuItem; 13 | -------------------------------------------------------------------------------- /src/components/progress/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/31 3 | */ 4 | 5 | import LayProgress from './src/progress'; 6 | 7 | /* istanbul ignore next */ 8 | LayProgress.install = function (Vue) { 9 | Vue.component(LayProgress.name, LayProgress); 10 | }; 11 | 12 | export default LayProgress; 13 | -------------------------------------------------------------------------------- /src/components/tab-pane/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/9/3 3 | */ 4 | 5 | import LayTabPane from '../tabs/src/tab-pane'; 6 | 7 | /* istanbul ignore next */ 8 | LayTabPane.install = function (Vue) { 9 | Vue.component(LayTabPane.name, LayTabPane); 10 | }; 11 | 12 | export default LayTabPane; 13 | -------------------------------------------------------------------------------- /src/components/textarea/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayTextarea from './src/textarea'; 6 | 7 | /* istanbul ignore next */ 8 | LayTextarea.install = function (Vue) { 9 | Vue.component(LayTextarea.name, LayTextarea); 10 | }; 11 | 12 | export default LayTextarea; 13 | -------------------------------------------------------------------------------- /src/components/timeline/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/9/1 3 | */ 4 | 5 | import LayTimeline from './src/timeline'; 6 | 7 | /* istanbul ignore next */ 8 | LayTimeline.install = function (Vue) { 9 | Vue.component(LayTimeline.name, LayTimeline); 10 | }; 11 | 12 | export default LayTimeline; 13 | -------------------------------------------------------------------------------- /src/components/container/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayContainer from './src/container'; 6 | 7 | /* istanbul ignore next */ 8 | LayContainer.install = function (Vue) { 9 | Vue.component(LayContainer.name, LayContainer); 10 | }; 11 | 12 | export default LayContainer; 13 | -------------------------------------------------------------------------------- /src/components/form-item/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayFormItem from '../form/src/form-item'; 6 | 7 | /* istanbul ignore next */ 8 | LayFormItem.install = function (Vue) { 9 | Vue.component(LayFormItem.name, LayFormItem); 10 | }; 11 | 12 | export default LayFormItem; 13 | -------------------------------------------------------------------------------- /src/utils/validatorProps.js: -------------------------------------------------------------------------------- 1 | export const oneOf = (failed, arr, value) => { 2 | const checked = arr.indexOf(value) !== -1; 3 | if (checked) { 4 | return checked; 5 | } else { 6 | console.error(`[vue-layui warn]: prop "${failed}" ${value} must be one of ${JSON.stringify(arr)}`); 7 | } 8 | 9 | }; 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | -------------------------------------------------------------------------------- /src/components/breadcrumb/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayBreadcrumb from './src/breadcrumb'; 6 | 7 | /* istanbul ignore next */ 8 | LayBreadcrumb.install = function (Vue) { 9 | Vue.component(LayBreadcrumb.name, LayBreadcrumb); 10 | }; 11 | 12 | export default LayBreadcrumb; 13 | -------------------------------------------------------------------------------- /src/components/pagination/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/9/4 3 | */ 4 | 5 | import LayPagination from './src/pagination'; 6 | 7 | /* istanbul ignore next */ 8 | LayPagination.install = function (Vue) { 9 | Vue.component(LayPagination.name, LayPagination); 10 | }; 11 | 12 | export default LayPagination; 13 | -------------------------------------------------------------------------------- /src/components/color-picker/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/9/10 3 | */ 4 | 5 | import LayColorPicker from './src/color-picker'; 6 | 7 | /* istanbul ignore next */ 8 | LayColorPicker.install = function (Vue) { 9 | Vue.component(LayColorPicker.name, LayColorPicker); 10 | }; 11 | 12 | export default LayColorPicker; 13 | -------------------------------------------------------------------------------- /src/components/table-column/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/9/3 3 | */ 4 | 5 | import LayTableColumn from '../table/src/table-column'; 6 | 7 | /* istanbul ignore next */ 8 | LayTableColumn.install = function (Vue) { 9 | Vue.component(LayTableColumn.name, LayTableColumn); 10 | }; 11 | 12 | export default LayTableColumn; 13 | -------------------------------------------------------------------------------- /src/components/menu-child-item/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 3 | */ 4 | 5 | import LayMenuChildItem from '../menu/src/menu-child-item'; 6 | 7 | /* istanbul ignore next */ 8 | LayMenuChildItem.install = function (Vue) { 9 | Vue.component(LayMenuChildItem.name, LayMenuChildItem); 10 | }; 11 | 12 | export default LayMenuChildItem; 13 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@babel/env', 5 | { 6 | loose: true, 7 | modules: false, 8 | targets: { 9 | browsers: ['> 1%', 'last 2 versions', 'not ie <= 8'] 10 | } 11 | } 12 | ] 13 | ], 14 | plugins: ['@babel/transform-runtime'] 15 | }; 16 | -------------------------------------------------------------------------------- /src/components/carousel-item/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/9/7 3 | */ 4 | 5 | import LayCarouselItem from '../carousel/src/carousel-item'; 6 | 7 | /* istanbul ignore next */ 8 | LayCarouselItem.install = function (Vue) { 9 | Vue.component(LayCarouselItem.name, LayCarouselItem); 10 | }; 11 | 12 | export default LayCarouselItem; 13 | -------------------------------------------------------------------------------- /src/components/collapse-item/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayCollapseItem from '../collapse/src/collapse-item'; 6 | 7 | /* istanbul ignore next */ 8 | LayCollapseItem.install = function (Vue) { 9 | Vue.component(LayCollapseItem.name, LayCollapseItem); 10 | }; 11 | 12 | export default LayCollapseItem; 13 | -------------------------------------------------------------------------------- /src/components/timeline-item/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/9/1 3 | */ 4 | 5 | import LayTimelineItem from '../timeline/src/timeline-item'; 6 | 7 | /* istanbul ignore next */ 8 | LayTimelineItem.install = function (Vue) { 9 | Vue.component(LayTimelineItem.name, LayTimelineItem); 10 | }; 11 | 12 | export default LayTimelineItem; 13 | -------------------------------------------------------------------------------- /src/components/breadcrumb-item/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | 5 | import LayBreadcrumbItem from '../breadcrumb/src/breadcrumb-item'; 6 | 7 | /* istanbul ignore next */ 8 | LayBreadcrumbItem.install = function (Vue) { 9 | Vue.component(LayBreadcrumbItem.name, LayBreadcrumbItem); 10 | }; 11 | 12 | export default LayBreadcrumbItem; 13 | -------------------------------------------------------------------------------- /src/components/date-picker/README.md: -------------------------------------------------------------------------------- 1 | ## 日期组件 2 | 3 | ### 开发计划 4 | - [x] 日期选择器 5 | - [x] 年选择器 6 | - [x] 年月选择器 7 | - [x] 自定义日期格式 8 | - [x] 公历节日 9 | - [x] 自定义重要日子 10 | - [x] 限制可选日期 11 | - [x] 多种款色任你挑选 12 | - [x] 多种事件供你使用 13 | - [ ] 时间选择器 14 | - [ ] 自定义时间格式 15 | - [ ] 限制可选时间 16 | - [ ] 日期时间选择器 17 | - [ ] 年范围 18 | - [ ] 年月范围 19 | - [ ] 时间范围 20 | - [ ] 日期时间范围 21 | - [ ] 日期多选 22 | - [ ] 双向数据绑定 -------------------------------------------------------------------------------- /src/components/time-picker/README.md: -------------------------------------------------------------------------------- 1 | ## 日期组件 2 | 3 | ### 开发计划 4 | - [x] 日期选择器 5 | - [x] 年选择器 6 | - [x] 年月选择器 7 | - [x] 自定义日期格式 8 | - [x] 公历节日 9 | - [x] 自定义重要日子 10 | - [x] 限制可选日期 11 | - [x] 多种款色任你挑选 12 | - [x] 多种事件供你使用 13 | - [x] 时间选择器 14 | - [x] 自定义时间格式 15 | - [ ] 限制可选时间 16 | - [ ] 日期时间选择器 17 | - [ ] 年范围 18 | - [ ] 年月范围 19 | - [ ] 时间范围 20 | - [ ] 日期时间范围 21 | - [ ] 日期多选 22 | - [ ] 双向数据绑定 -------------------------------------------------------------------------------- /src/components/card/src/card.vue: -------------------------------------------------------------------------------- 1 | 14 | 19 | -------------------------------------------------------------------------------- /src/components/side/src/side.vue: -------------------------------------------------------------------------------- 1 | 8 | 13 | 19 | -------------------------------------------------------------------------------- /src/components/line/src/line.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/components/table/src/table-column.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/components/table/src/table-header.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/components/table/src/table-colgroup.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/components/tabs/src/tab-pane.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/components/row/src/row.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 22 | -------------------------------------------------------------------------------- /src/components/table/src/table-tr.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/components/container/src/container.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # vue-layui 4 | 这是一个基于vue的ui框架,引用了layui的样式(逻辑重新编写,非jquery) 5 | 注意:本框架用于学习,不适用于生产。 6 | 注意:本框架用于学习,不适用于生产。 7 | 注意:本框架用于学习,不适用于生产。 8 | 9 | 点击预览: [文档和演示](https://kouchao.github.io/vue-layui) 10 | 11 | 基于 [layui](https://github.com/sentsin/layui/) 2.4.0版本 12 | 13 | ### Install 14 | npm i vue-layui -S 15 | 16 | ### Quick Start 17 | import layui from 'vue-layui' 18 | import 'vue-layui/lib/vue-layui.css' 19 | 20 | Vue.use(layui) 21 | -------------------------------------------------------------------------------- /examples/doc/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import layui from '@'; 3 | import App from './App.vue'; 4 | import router from './router'; 5 | 6 | import '@/assets/layui.css'; 7 | import '@/assets/layer.css'; 8 | import '@/assets/lay-date/laydate.css'; 9 | import '@/assets/vue-layui.css'; 10 | import 'highlight.js/styles/atom-one-dark.css'; 11 | 12 | import demoBlock from './components/demo-block.vue'; 13 | Vue.use(layui); 14 | Vue.config.productionTip = false; 15 | Vue.component('demo-block', demoBlock); 16 | 17 | new Vue({ 18 | router, 19 | render: h => h(App) 20 | }).$mount('#app'); 21 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const merge = require('webpack-merge'); 2 | const baseConfig = require('./build/webpack.base.js'); 3 | const devConfig = require('./build/webpack.dev.js'); 4 | const proConfig = require('./build/webpack.pro.js'); 5 | const demoConfig = require('./build/webpack.demo.js'); 6 | 7 | const getConfig = (env) => { 8 | console.log(env); 9 | if (env === 'demo') { 10 | return merge(baseConfig, demoConfig); 11 | } else if (env === 'pro') { 12 | return merge(baseConfig, proConfig); 13 | } else { 14 | return merge(baseConfig, devConfig); 15 | } 16 | }; 17 | module.exports = getConfig(process.env.NODE_ENV); 18 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | extends: ['plugin:vue/recommended', 'standard'], 7 | rules: { 8 | // allow paren-less arrow functions 9 | 'arrow-parens': 0, 10 | // allow async-await 11 | 'generator-star-spacing': 'off', 12 | // allow debugger during development 13 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', 14 | // 关闭语句强制分号结尾 15 | 'semi': [2, 'always'], 16 | // 两个空行 17 | 'indent': ['error', 2], 18 | // 判断无等号 19 | 'padded-blocks': 0, 20 | 'no-useless-escape': 0, 21 | 22 | // 全等于 23 | eqeqeq: 0 24 | }, 25 | parserOptions: { 26 | parser: 'babel-eslint' 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /src/components/breadcrumb/src/breadcrumb-item.vue: -------------------------------------------------------------------------------- 1 | 17 | 36 | -------------------------------------------------------------------------------- /src/components/breadcrumb/src/breadcrumb.vue: -------------------------------------------------------------------------------- 1 | 9 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/components/color-picker/src/color.js: -------------------------------------------------------------------------------- 1 | // RGB转HEX 2 | export const rgb2hex = function (rgb) { 3 | var aRgb = rgb instanceof Array ? rgb : rgb.split(',') || [0, 0, 0]; 4 | var temp; 5 | return [ 6 | (temp = Number(aRgb[0]).toString(16)).length == 1 ? '0' + temp : temp, 7 | (temp = Number(aRgb[1]).toString(16)).length == 1 ? '0' + temp : temp, 8 | (temp = Number(aRgb[2]).toString(16)).length == 1 ? '0' + temp : temp 9 | ].join(''); 10 | }; 11 | 12 | // HEX转RGB 13 | export const hex2rgb = hex => { 14 | if (hex.length == 3) { 15 | hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; 16 | } 17 | return [ 18 | parseInt(hex[0] + hex[1], 16), 19 | parseInt(hex[2] + hex[3], 16), 20 | parseInt(hex[4] + hex[5], 16) 21 | ].join(); 22 | }; 23 | -------------------------------------------------------------------------------- /src/mixins/eventHub.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kouchao 创建于 2018/8/27 3 | */ 4 | import Vue from 'vue'; 5 | const eventHub = new Vue(); 6 | 7 | export default { 8 | methods: { 9 | eventEmit (eventName, data, isGlobal) { 10 | const parent = isGlobal ? this.$root : this.$parent || this.$root; 11 | 12 | if (parent && parent._uid) { 13 | const uid = parent._uid; 14 | eventHub.$emit(eventName + uid, data); 15 | } 16 | }, 17 | eventOn (eventName, cb) { 18 | eventHub.$on(eventName + this._uid, cb); 19 | }, 20 | eventOnGlobal (eventName, cb) { 21 | const parent = this.$root; 22 | eventHub.$on(eventName + parent._uid, cb); 23 | }, 24 | eventEmitGlobal (eventName, data) { 25 | this.eventEmit(eventName, data, true); 26 | } 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /src/components/carousel/src/carousel-item.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/components/badge/src/badge.vue: -------------------------------------------------------------------------------- 1 | 9 | 41 | -------------------------------------------------------------------------------- /.github/workflows/build-docs.yml: -------------------------------------------------------------------------------- 1 | name: build docs 2 | 3 | on: 4 | push: 5 | branches: 6 | - dev 7 | 8 | jobs: 9 | build-and-deploy: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | with: 14 | fetch-depth: 0 15 | 16 | - uses: pnpm/action-setup@v2 17 | with: 18 | version: 7.1.6 19 | 20 | - name: Setup Node.js 21 | uses: actions/setup-node@v3 22 | with: 23 | node-version: 16 24 | cache: 'pnpm' 25 | 26 | - name: Install dependencies 27 | run: pnpm i --frozen-lockfile 28 | 29 | - name: Build VuePress site 30 | run: pnpm build:demo 31 | 32 | - name: Deploy to GitHub Pages 33 | uses: crazy-max/ghaction-github-pages@v2 34 | with: 35 | target_branch: gh-pages 36 | build_dir: dist 37 | env: 38 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /src/mixins/popper.js: -------------------------------------------------------------------------------- 1 | import Popper from 'popper.js'; 2 | 3 | export default { 4 | methods: { 5 | 6 | getRef (key) { 7 | const dom = this.$refs[key]; 8 | 9 | if (dom._isVue) { 10 | return dom.$refs[key]; 11 | } 12 | 13 | return dom; 14 | }, 15 | createPopper () { 16 | const reference = this.getRef('reference'); 17 | const popper = this.getRef('popper'); 18 | 19 | console.log(reference, popper); 20 | this.popper = new Popper(reference, popper, { 21 | placement: 'bottom' 22 | }); 23 | }, 24 | updatePopper () { 25 | const popper = this.popper; 26 | 27 | if (popper) { 28 | popper.update(); 29 | } 30 | }, 31 | 32 | destroyPopper () { 33 | const popper = this.popper; 34 | 35 | if (popper) { 36 | popper.destroy(); 37 | this.popper = null; 38 | } 39 | } 40 | }, 41 | beforeDestroy () { 42 | this.destroyPopper(); 43 | } 44 | 45 | }; 46 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | vue-layui 9 | 10 | 11 | 14 |
15 | 16 | 17 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/components/menu/src/menu-child-item.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 47 | 48 | 53 | -------------------------------------------------------------------------------- /src/components/col/src/col.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 53 | -------------------------------------------------------------------------------- /src/components/progress/src/progress.vue: -------------------------------------------------------------------------------- 1 | 25 | 53 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 kouchao 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/components/timeline/src/timeline-item.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/mixins/emitter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 来源 https://github.com/ElemeFE/element/blob/dev/src/mixins/emitter.js 3 | */ 4 | 5 | function broadcast (componentName, eventName, params) { 6 | this.$children.forEach(child => { 7 | var name = child.$options.componentName; 8 | 9 | if (name === componentName) { 10 | child.$emit.apply(child, [eventName].concat(params)); 11 | } else { 12 | broadcast.apply(child, [componentName, eventName].concat([params])); 13 | } 14 | }); 15 | } 16 | export default { 17 | methods: { 18 | dispatch (componentName, eventName, params) { 19 | var parent = this.$parent || this.$root; 20 | var name = parent.$options.componentName; 21 | 22 | while (parent && (!name || name !== componentName)) { 23 | parent = parent.$parent; 24 | 25 | if (parent) { 26 | name = parent.$options.componentName; 27 | } 28 | } 29 | if (parent) { 30 | parent.$emit.apply(parent, [eventName].concat(params)); 31 | } 32 | }, 33 | broadcast (componentName, eventName, params) { 34 | broadcast.call(this, componentName, eventName, params); 35 | } 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /src/components/block/src/block.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 54 | 55 | 60 | -------------------------------------------------------------------------------- /examples/doc/views/Auxiliar.vue: -------------------------------------------------------------------------------- 1 | 47 | 48 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/components/collapse/src/collapse.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/components/color-picker/src/color-box.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/components/date-picker/src/utils/index.js: -------------------------------------------------------------------------------- 1 | const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; 2 | // TODO: 待补充,按招 https://github.com/sentsin/laydate/blob/master/src/laydate.js 3 | const FESTIVAL = { 4 | '1-1': '元旦', 5 | '2-14': '情人节', 6 | '3-8': '妇女', 7 | '3-12': '植树', 8 | '9-18': '国耻', 9 | '10-1': '国庆', 10 | '12-25': '圣诞' 11 | }; 12 | 13 | // 是否闰年 14 | export const isLeapYear = (year) => { 15 | return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; 16 | }; 17 | 18 | // 获得某月的第一天是周几 19 | export const getDay = (year, month) => { 20 | return new Date(year, month, 1).getDay(); 21 | }; 22 | 23 | // 获得某月总天数 24 | export const getDaysInMonth = (year, month) => { 25 | if (month == 1) { 26 | return isLeapYear(year) ? 29 : 28; 27 | } 28 | 29 | return DAYS_IN_MONTH[month]; 30 | }; 31 | 32 | // 获得上个月总天数 33 | export const getPrevDaysInMonth = (year, month) => { 34 | if (month == 0) { 35 | year = year - 1; 36 | month = 11; 37 | } else { 38 | month = month - 1; 39 | } 40 | 41 | return getDaysInMonth(year, month); 42 | }; 43 | 44 | // 获得公历节日和自定义节日 45 | export const getFestival = (month, day, festival = FESTIVAL) => { 46 | return festival[`${month + 1}-${day}`]; 47 | }; 48 | -------------------------------------------------------------------------------- /src/assets/vue-layui.css: -------------------------------------------------------------------------------- 1 | .layui-co-red { 2 | color: #FF5722 !important 3 | } 4 | 5 | .layui-co-orange { 6 | color: #FFB800 !important 7 | } 8 | 9 | .layui-co-green { 10 | color: #009688 !important 11 | } 12 | 13 | .layui-co-cyan { 14 | color: #2F4056 !important 15 | } 16 | 17 | .layui-co-blue { 18 | color: #1E9FFF !important 19 | } 20 | 21 | .layui-co-black { 22 | color: #393D49 !important 23 | } 24 | 25 | .layui-co-gray { 26 | color: #eee !important; 27 | } 28 | 29 | .layui-bd-red { 30 | border-color: #FF5722 !important 31 | } 32 | 33 | .layui-bd-orange { 34 | border-color: #FFB800 !important 35 | } 36 | 37 | .layui-bd-green { 38 | border-color: #009688 !important 39 | } 40 | 41 | .layui-bd-cyan { 42 | border-color: #2F4056 !important 43 | } 44 | 45 | .layui-bd-blue { 46 | border-color: #1E9FFF !important 47 | } 48 | 49 | .layui-bd-black { 50 | border-color: #393D49 !important 51 | } 52 | 53 | .layui-bd-gray { 54 | border-color: #eee !important; 55 | } 56 | 57 | li { 58 | list-style: none 59 | } 60 | 61 | /* 日期选择器 月份内容覆盖 */ 62 | .layui-laydate-list { 63 | position: unset !important; 64 | padding: 0 !important; 65 | } 66 | 67 | 68 | 69 | /* 表单样式覆盖 */ 70 | .is-error .layui-input { 71 | border-color: #ff5722 !important; 72 | } 73 | -------------------------------------------------------------------------------- /src/components/collapse/src/collapse-item.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /examples/doc/components/demo-block.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 41 | 42 | -------------------------------------------------------------------------------- /src/components/radio/src/radio.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/components/date-picker/src/content/month-table.vue: -------------------------------------------------------------------------------- 1 | 18 | 64 | -------------------------------------------------------------------------------- /src/components/switch/src/switch.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/components/textarea/src/textarea.vue: -------------------------------------------------------------------------------- 1 |