├── src ├── components │ ├── pagination │ │ ├── index.js │ │ ├── md-pagination-item.vue │ │ └── md-pagination.vue │ ├── chips │ │ ├── index.js │ │ └── md-chip.vue │ ├── badges │ │ ├── index.js │ │ └── md-badge.vue │ ├── commons │ │ ├── index.js │ │ ├── md-icon.vue │ │ └── md-link.vue │ ├── crumb │ │ ├── index.js │ │ └── md-crumb.vue │ ├── sidenav │ │ ├── index.js │ │ └── md-sidenav.vue │ ├── forms │ │ ├── date_picker │ │ │ ├── index.js │ │ │ ├── md-date-display.vue │ │ │ ├── md-datepicker.vue │ │ │ └── md-date-table.vue │ │ ├── md-radio.vue │ │ ├── md-checkbox.vue │ │ ├── md-submit.vue │ │ ├── md-file.vue │ │ ├── index.js │ │ ├── md-select.vue │ │ ├── md-textarea.vue │ │ ├── md-input.vue │ │ ├── md-switch.vue │ │ └── md-range.vue │ ├── lists │ │ ├── md-list-avatar.vue │ │ ├── md-list-sec.vue │ │ ├── index.js │ │ ├── md-list.vue │ │ └── md-list-item.vue │ ├── buttons │ │ ├── index.js │ │ ├── md-btn.vue │ │ └── md-fab.vue │ ├── cards │ │ ├── md-card-reveal.vue │ │ ├── md-card-content.vue │ │ ├── md-card.vue │ │ ├── md-card-action.vue │ │ ├── md-panel-card.vue │ │ ├── md-card-img.vue │ │ ├── md-card-title.vue │ │ ├── md-basic-card.vue │ │ ├── index.js │ │ └── md-image-card.vue │ ├── navbar │ │ ├── index.js │ │ ├── md-nav-logo.vue │ │ ├── md-nav-links.vue │ │ ├── md-searchbar.vue │ │ └── md-nav.vue │ ├── preloader │ │ ├── index.js │ │ ├── md-circular-item.vue │ │ ├── md-progress.vue │ │ └── md-circular.vue │ ├── footer │ │ ├── index.js │ │ ├── md-footer.vue │ │ ├── md-footer-content.vue │ │ ├── md-footer-copyright.vue │ │ └── md-footer-links.vue │ └── mixins │ │ ├── common-mixin.js │ │ ├── card-mixin.js │ │ └── form-mixin.js ├── directives │ ├── index.js │ └── md-model.js ├── utils │ ├── index.js │ ├── wrapChildren.js │ └── cssValue.js └── vue-material.js ├── .npmignore ├── .gitignore ├── LICENSE ├── package.json └── README.md /src/components/pagination/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/directives/index.js: -------------------------------------------------------------------------------- 1 | import mdModel from './md-model.js'; 2 | export default { 3 | mdModel 4 | } -------------------------------------------------------------------------------- /src/components/chips/index.js: -------------------------------------------------------------------------------- 1 | import mdChip from './md-chip.vue'; 2 | 3 | export default { 4 | mdChip 5 | } -------------------------------------------------------------------------------- /src/components/badges/index.js: -------------------------------------------------------------------------------- 1 | import mdBadge from './md-badge.vue'; 2 | 3 | export default { 4 | mdBadge, 5 | } -------------------------------------------------------------------------------- /src/components/commons/index.js: -------------------------------------------------------------------------------- 1 | import mdIcon from './md-icon.vue'; 2 | 3 | export default { 4 | mdIcon, 5 | } -------------------------------------------------------------------------------- /src/components/crumb/index.js: -------------------------------------------------------------------------------- 1 | import mdCrumb from './md-crumb.vue'; 2 | 3 | export default { 4 | mdCrumb, 5 | } -------------------------------------------------------------------------------- /src/components/sidenav/index.js: -------------------------------------------------------------------------------- 1 | import mdSidenav from "./md-sidenav.vue"; 2 | export default { 3 | mdSidenav 4 | } -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | #folders 2 | build 3 | node_modules 4 | test 5 | 6 | 7 | #files 8 | .* 9 | *.md 10 | *.log 11 | bower.json -------------------------------------------------------------------------------- /src/components/forms/date_picker/index.js: -------------------------------------------------------------------------------- 1 | import mdDatepicker from './md-datepicker.vue'; 2 | 3 | export default { 4 | mdDatepicker 5 | } -------------------------------------------------------------------------------- /src/components/lists/md-list-avatar.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /src/components/buttons/index.js: -------------------------------------------------------------------------------- 1 | import mdBtn from './md-btn.vue'; 2 | import mdFab from './md-fab.vue'; 3 | 4 | export default { 5 | mdBtn, 6 | mdFab, 7 | } -------------------------------------------------------------------------------- /src/utils/index.js: -------------------------------------------------------------------------------- 1 | import cssValue from './cssValue.js'; 2 | import wrapChildren from './wrapChildren.js'; 3 | 4 | export default { 5 | cssValue, 6 | wrapChildren 7 | } -------------------------------------------------------------------------------- /src/components/cards/md-card-reveal.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /src/components/cards/md-card-content.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /src/components/lists/md-list-sec.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /src/components/navbar/index.js: -------------------------------------------------------------------------------- 1 | import mdNav from './md-nav.vue'; 2 | import mdNavLinks from './md-nav-links.vue'; 3 | import mdNavLogo from './md-nav-logo.vue'; 4 | 5 | export default { 6 | mdNav, 7 | mdNavLinks, 8 | mdNavLogo, 9 | } -------------------------------------------------------------------------------- /src/components/pagination/md-pagination-item.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /src/components/commons/md-icon.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /src/components/preloader/index.js: -------------------------------------------------------------------------------- 1 | import mdCircular from './md-circular.vue'; 2 | import mdCircularItem from './md-circular-item.vue'; 3 | import mdProgress from './md-progress.vue'; 4 | 5 | export default { 6 | mdCircular, 7 | mdCircularItem, 8 | mdProgress 9 | } -------------------------------------------------------------------------------- /src/components/cards/md-card.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /src/components/crumb/md-crumb.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | -------------------------------------------------------------------------------- /src/components/badges/md-badge.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /src/components/lists/index.js: -------------------------------------------------------------------------------- 1 | import mdList from './md-list.vue'; 2 | import mdListAvatar from './md-list-avatar.vue'; 3 | import mdListItem from './md-list-item.vue'; 4 | import mdListSec from './md-list-sec.vue'; 5 | export default { 6 | mdList, 7 | mdListAvatar, 8 | mdListItem, 9 | mdListSec, 10 | } -------------------------------------------------------------------------------- /src/utils/wrapChildren.js: -------------------------------------------------------------------------------- 1 | export default function (parent,tag){ 2 | let len = parent.children.length; 3 | for(let i=0; i 2 |
3 | 4 | {{link.text}} 5 | 6 |
7 | 8 | 9 | 16 | -------------------------------------------------------------------------------- /src/components/cards/md-panel-card.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /src/components/navbar/md-nav-logo.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | -------------------------------------------------------------------------------- /src/components/footer/index.js: -------------------------------------------------------------------------------- 1 | import mdFooter from './md-footer.vue'; 2 | import mdFooterContent from './md-footer-content.vue'; 3 | import mdFooterCopyright from './md-footer-copyright.vue'; 4 | import mdFooterLinks from './md-footer-links.vue'; 5 | 6 | export default { 7 | mdFooter, 8 | mdFooterContent, 9 | mdFooterCopyright, 10 | mdFooterLinks 11 | } -------------------------------------------------------------------------------- /src/components/cards/md-card-img.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | -------------------------------------------------------------------------------- /src/components/footer/md-footer.vue: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /src/components/mixins/common-mixin.js: -------------------------------------------------------------------------------- 1 | import mdIcon from '../commons/md-icon.vue'; 2 | export default { 3 | hasIcon: { 4 | props: { 5 | iconText: String, 6 | iconPos:String 7 | }, 8 | components: { 9 | "md-icon": mdIcon 10 | } 11 | }, 12 | hasImg:{ 13 | props:{ 14 | imgSrc:String, 15 | imgAlt:String 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/directives/md-model.js: -------------------------------------------------------------------------------- 1 | export default { 2 | twoWay:true, 3 | bind: function () { 4 | this.handler = function () { 5 | // console.log(this.el.__vue__.mdValue); 6 | this.set(this.el.__vue__.mdValue); 7 | }.bind(this); 8 | this.el.addEventListener('change', this.handler) 9 | }, 10 | unbind: function () { 11 | this.el.removeEventListener('change', this.handler) 12 | } 13 | } -------------------------------------------------------------------------------- /src/components/chips/md-chip.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | -------------------------------------------------------------------------------- /src/components/commons/md-link.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | -------------------------------------------------------------------------------- /src/components/navbar/md-nav-links.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /src/components/forms/md-radio.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | -------------------------------------------------------------------------------- /src/components/cards/md-card-title.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 18 | -------------------------------------------------------------------------------- /src/components/lists/md-list.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | -------------------------------------------------------------------------------- /src/components/forms/md-checkbox.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 15 | -------------------------------------------------------------------------------- /src/components/footer/md-footer-content.vue: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /src/components/navbar/md-searchbar.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /src/components/preloader/md-circular-item.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /src/utils/cssValue.js: -------------------------------------------------------------------------------- 1 | export default function(element,names,pseudo=null){ 2 | //IE<11 doesn't support pseudo 3 | if(element && element.nodeType ===1) { 4 | let cssObj = window.getComputedStyle(element,pseudo); 5 | if(typeof names === "string"){ 6 | return cssObj.getPropertyValue(names); 7 | }else { 8 | let result = {}; 9 | for(let name in names) { 10 | result[name] = cssObj.getPropertyValue(name); 11 | } 12 | return result; 13 | } 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /src/components/sidenav/md-sidenav.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 18 | 19 | -------------------------------------------------------------------------------- /src/components/footer/md-footer-copyright.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /src/components/forms/md-submit.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /src/components/footer/md-footer-links.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | -------------------------------------------------------------------------------- /src/components/preloader/md-progress.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /src/components/mixins/card-mixin.js: -------------------------------------------------------------------------------- 1 | import mdCardAction from '../cards/md-card-action.vue'; 2 | import mdCardContent from '../cards/md-card-content.vue'; 3 | import mdCardImg from '../cards/md-card-img.vue'; 4 | import mdCardTitle from '../cards/md-card-title.vue'; 5 | export default { 6 | 7 | basic: { 8 | props:{ 9 | options:Object, 10 | reveal:Boolean 11 | }, 12 | components: { 13 | 'md-card-action': mdCardAction, 14 | 'md-card-content': mdCardContent, 15 | 'md-card-title': mdCardTitle, 16 | 'md-card-img': mdCardImg 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/components/forms/md-file.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | -------------------------------------------------------------------------------- /src/components/forms/index.js: -------------------------------------------------------------------------------- 1 | import mdCheckbox from './md-checkbox.vue'; 2 | // import mdDatepicker from './date_picker/'; 3 | import mdFile from './md-file.vue'; 4 | import mdInput from './md-input.vue'; 5 | import mdRadio from './md-radio.vue'; 6 | import mdRange from './md-range.vue'; 7 | import mdSelect from './md-select.vue'; 8 | import mdSubmit from './md-submit.vue'; 9 | import mdSwitch from './md-switch.vue'; 10 | import mdTextarea from './md-textarea.vue'; 11 | 12 | export default { 13 | mdCheckbox, 14 | // mdDatepicker, 15 | mdFile, 16 | mdInput, 17 | mdRadio, 18 | mdRange, 19 | mdSelect, 20 | mdSubmit, 21 | mdSwitch, 22 | mdTextarea 23 | } -------------------------------------------------------------------------------- /src/components/cards/md-basic-card.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | -------------------------------------------------------------------------------- /src/components/cards/index.js: -------------------------------------------------------------------------------- 1 | // import mdBasicCard from './md-basic-card.vue'; 2 | import mdCard from './md-card.vue'; 3 | import mdCardAction from './md-card-action.vue'; 4 | import mdCardContent from './md-card-content.vue'; 5 | import mdCardImg from './md-card-img.vue'; 6 | import mdCardReveal from './md-card-reveal.vue'; 7 | import mdCardTitle from './md-card-title.vue'; 8 | // import mdImageCard from './md-image-card.vue'; 9 | // import mdPanelCard from './md-panel-card.vue'; 10 | 11 | export default { 12 | // mdBasicCard, 13 | mdCard, 14 | mdCardAction, 15 | mdCardContent, 16 | mdCardImg, 17 | mdCardReveal, 18 | mdCardTitle, 19 | // mdImageCard, 20 | // mdPanelCard, 21 | } -------------------------------------------------------------------------------- /src/components/lists/md-list-item.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | -------------------------------------------------------------------------------- /src/components/navbar/md-nav.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 26 | 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | 29 | #elviskang 30 | 31 | #folders 32 | doc/node_modules 33 | .vscode 34 | dist 35 | 36 | #gedit backup files 37 | *.*~ -------------------------------------------------------------------------------- /src/components/forms/md-select.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | -------------------------------------------------------------------------------- /src/components/forms/date_picker/md-date-display.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | -------------------------------------------------------------------------------- /src/components/forms/md-textarea.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | -------------------------------------------------------------------------------- /src/components/preloader/md-circular.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /src/components/cards/md-image-card.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | -------------------------------------------------------------------------------- /src/components/forms/md-input.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | -------------------------------------------------------------------------------- /src/components/buttons/md-btn.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /src/components/forms/md-switch.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | -------------------------------------------------------------------------------- /src/components/pagination/md-pagination.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Kaixuan Kang 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 | 23 | -------------------------------------------------------------------------------- /src/components/mixins/form-mixin.js: -------------------------------------------------------------------------------- 1 | import {mdIcon}from '../commons/index.js'; 2 | let basicAttr = { 3 | props: { 4 | id: { 5 | type:String, 6 | default:'' 7 | }, 8 | name: { 9 | type:String, 10 | default:'' 11 | }, 12 | placeholder: { 13 | type:String, 14 | default:'' 15 | }, 16 | value: { 17 | type:String, 18 | default:'' 19 | } 20 | } 21 | }; 22 | let status = { 23 | props: { 24 | checked:Boolean, 25 | disabled: Boolean, 26 | required: Boolean, 27 | } 28 | }; 29 | let formIcon = { 30 | props: { 31 | iconText: String, 32 | iconPos:{ 33 | type:String, 34 | default:"prefix" 35 | } 36 | }, 37 | components: { 38 | 'md-icon': mdIcon 39 | } 40 | }; 41 | let actLabel = { 42 | computed:{ 43 | labelActive(){ 44 | return (this.mdValue || this.placeholder || this.focus); 45 | } 46 | }, 47 | }; 48 | export default { 49 | basicAttr, 50 | formIcon, 51 | status, 52 | actLabel, 53 | } 54 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-material", 3 | "version": "0.0.14", 4 | "description": "Material-design components built with pure Vue.js", 5 | "main": "dist/vue-material.js", 6 | "directories": { 7 | "test": "test" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1", 11 | "build": "webpack --config build/webpack.build.dev.config.js & webpack --config build/webpack.build.prod.config.js", 12 | "doc": "webpack --watch --config build/webpack.dev.js", 13 | "pub": "npm run build && npm publish" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/ElvisKang/vue-material.git" 18 | }, 19 | "keywords": [ 20 | "vue", 21 | "material", 22 | "vue-material" 23 | ], 24 | "author": "elviskang", 25 | "license": "MIT", 26 | "bugs": { 27 | "url": "https://github.com/ElvisKang/vue-material/issues" 28 | }, 29 | "homepage": "https://github.com/ElvisKang/vue-material#readme", 30 | "dependencies": { 31 | "node-waves": "^0.7.4" 32 | }, 33 | "devDependencies": { 34 | "babel-core": "^5.8.25", 35 | "babel-loader": "^5.3.2", 36 | "babel-runtime": "^5.8.25", 37 | "css-loader": "^0.19.0", 38 | "style-loader": "^0.12.4", 39 | "vue-html-loader": "^1.0.0", 40 | "vue-loader": "^4.0.5", 41 | "webpack": "^1.12.2", 42 | "webpack-dev-server": "^1.12.1" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/components/forms/md-range.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # THIS REPO IS DEPRECATED 2 | 3 | Please Move To https://github.com/vuematerial/vue-material 4 | 5 | 6 |

7 | 8 | # Introduction 9 | 10 | Vue-material intends to build [Materialize(0.97.2+)](http://materializecss.com/) with pure [Vue.js(1.0.0+)](http://vuejs.org/) ,which let users get rid of depending on 3rd Javascript libraries ,such as Materialize.js and Jquery.js(with plugins).In addition,I hope that you will construct a material design website easier with vue-material. 11 | 12 | # Status 13 | 14 | Still Under Building 15 | 16 | # Supported Browsers: 17 | 18 | Chrome 35+, Firefox 31+, Safari 7+, IE 10+ 19 | 20 | # Documentation 21 | 22 | [Link](http://elviskang.github.io/vue-material/) 23 | 24 | # Declaration & Acknowledgement 25 | 26 | This project **doesn't** belong to Materialize. I'd like to thank Alan Chang for permitting me to use their Logo for this project. :) 27 | 28 | # Getting Started 29 | 30 | ## Download 31 | 32 | Download [Materializecss](http://materializecss.com/getting-started.html) and [Vue.js(1.0.0+)](http://vuejs.org/) 33 | 34 | ```bash 35 | npm install vue-material 36 | ``` 37 | 38 | ## Usage 39 | 40 | ```javascript 41 | import Vue from 'vue'; 42 | import Material from 'vue-material'; 43 | //Globally register all of the components; 44 | Material.regAll(Vue); 45 | //or 46 | //Globally register the components that you need 47 | Material.reg(Vue,['buttons','cards']); 48 | ``` 49 | -------------------------------------------------------------------------------- /src/components/buttons/md-fab.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 61 | 62 | -------------------------------------------------------------------------------- /src/components/forms/date_picker/md-datepicker.vue: -------------------------------------------------------------------------------- 1 | 30 | //如果选择了日期,display的文字不会随着header的改变而该改变,如果未选择,display的日期会随着header改变 31 | -------------------------------------------------------------------------------- /src/vue-material.js: -------------------------------------------------------------------------------- 1 | import badges from './components/badges/' 2 | import buttons from './components/buttons/'; 3 | import cards from './components/cards/'; 4 | import chips from './components/chips/'; 5 | import commons from './components/commons/'; 6 | import crumb from './components/crumb'; 7 | import footer from './components/footer/'; 8 | import forms from './components/forms/'; 9 | import lists from './components/lists/'; 10 | import navbar from './components/navbar/'; 11 | import preloader from './components/preloader/'; 12 | import sidenav from './components/sidenav/'; 13 | 14 | import directives from './directives/'; 15 | 16 | /* 17 | import pagination from './components/pagination/'; 18 | import waves from 'node-waves'; 19 | */ 20 | 21 | export default { 22 | components: { 23 | badges, 24 | buttons, 25 | cards, 26 | chips, 27 | commons, 28 | crumb, 29 | footer, 30 | forms, 31 | navbar, 32 | sidenav, 33 | preloader, 34 | lists, 35 | }, 36 | directives, 37 | _registered: [], 38 | regAll(Vue){ 39 | for(let comName in this.components ) { 40 | if(this._registered.indexOf(comName) === -1){ 41 | this._regComponent(Vue,comName); 42 | } 43 | } 44 | this.regAllDirectives(Vue); 45 | }, 46 | reg(Vue, names) { 47 | for (let name of names) { 48 | name = name.toLowerCase(); 49 | if ((name in this.components) && (this._registered.indexOf(name) === -1)) { 50 | this._regComponent(Vue, name); 51 | } 52 | } 53 | this.regAllDirectives(Vue); 54 | }, 55 | regAllDirectives(Vue){ 56 | for(let dirName in this.directives){ 57 | if(this._registered.indexOf(dirName) === -1){ 58 | this._regDirective(Vue,dirName); 59 | } 60 | } 61 | }, 62 | getConstructor(name){ 63 | let result; 64 | if(typeof name === "string"){ 65 | 66 | } 67 | }, 68 | //mdXxYy=>md-xx-yy 69 | _camel2kebab(str) { 70 | const reg = /(?=[A-Z])/g; 71 | return str.replace(reg, '-').toLowerCase(); 72 | }, 73 | _regComponent(Vue, name) { 74 | let com = this.components[name]; 75 | for (let item in com) { 76 | let regName = this._camel2kebab(item); 77 | Vue.component(regName, com[item]); 78 | } 79 | this._registered.push(name); 80 | }, 81 | _regDirective(Vue,name){ 82 | let obj = this.directives[name]; 83 | name = this._camel2kebab(name); 84 | Vue.directive(name,obj); 85 | this._registered.push(name); 86 | } 87 | 88 | } 89 | 90 | 91 | -------------------------------------------------------------------------------- /src/components/forms/date_picker/md-date-table.vue: -------------------------------------------------------------------------------- 1 | 253 | 254 | --------------------------------------------------------------------------------