├── ElementCode ├── build │ ├── bin │ │ ├── build-all.js │ │ ├── build-entry.js │ │ ├── build-locale.js │ │ ├── gen-cssfile.js │ │ ├── gen-indices.js │ │ ├── i18n.js │ │ ├── iconInit.js │ │ ├── new-lang.js │ │ ├── new.js │ │ ├── template.js │ │ └── version.js │ ├── config.js │ ├── cooking.common.js │ ├── cooking.component.js │ ├── cooking.conf.js │ ├── cooking.demo.js │ ├── cooking.test.js │ ├── deploy-ci.sh │ ├── deploy-faas.sh │ ├── gen-single-config.js │ ├── git-release.sh │ ├── release.sh │ ├── salad.config.json │ └── strip-tags.js ├── demos │ ├── HelloCarousel.html │ ├── HelloCursor.html │ ├── HelloGradient.html │ ├── HelloNotice.html │ ├── HelloSelect.html │ ├── HelloTable.html │ ├── MyCarousel.html │ ├── MyCarouselCard.html │ ├── MyNotice.html │ └── vue.js ├── packages │ ├── alert │ │ ├── index.js │ │ └── src │ │ │ └── main.vue │ ├── aside │ │ ├── index.js │ │ └── src │ │ │ └── main.vue │ ├── autocomplete │ │ ├── index.js │ │ └── src │ │ │ ├── autocomplete-suggestions.vue │ │ │ └── autocomplete.vue │ ├── badge │ │ ├── index.js │ │ └── src │ │ │ └── main.vue │ ├── breadcrumb-item │ │ └── index.js │ ├── breadcrumb │ │ ├── index.js │ │ └── src │ │ │ ├── breadcrumb-item.vue │ │ │ └── breadcrumb.vue │ ├── button-group │ │ └── index.js │ ├── button │ │ ├── index.js │ │ └── src │ │ │ ├── button-group.vue │ │ │ └── button.vue │ ├── card │ │ ├── index.js │ │ └── src │ │ │ └── main.vue │ ├── carousel-item │ │ └── index.js │ ├── carousel │ │ ├── _index.js │ │ ├── cooking.conf.js │ │ ├── index.js │ │ ├── package.json │ │ └── src │ │ │ ├── item.vue │ │ │ └── main.vue │ ├── cascader │ │ ├── cooking.conf.js │ │ ├── index.js │ │ ├── package.json │ │ └── src │ │ │ ├── main.vue │ │ │ └── menu.vue │ ├── checkbox-button │ │ └── index.js │ ├── checkbox-group │ │ └── index.js │ ├── checkbox │ │ ├── index.js │ │ └── src │ │ │ ├── checkbox-button.vue │ │ │ ├── checkbox-group.vue │ │ │ └── checkbox.vue │ ├── col │ │ ├── index.js │ │ └── src │ │ │ └── col.js │ ├── collapse-item │ │ └── index.js │ ├── collapse │ │ ├── index.js │ │ └── src │ │ │ ├── collapse-item.vue │ │ │ └── collapse.vue │ ├── color-picker │ │ ├── cooking.conf.js │ │ ├── index.js │ │ ├── package.json │ │ └── src │ │ │ ├── color.js │ │ │ ├── components │ │ │ ├── alpha-slider.vue │ │ │ ├── hue-slider.vue │ │ │ ├── picker-dropdown.vue │ │ │ └── sv-panel.vue │ │ │ ├── draggable.js │ │ │ └── main.vue │ ├── container │ │ ├── index.js │ │ └── src │ │ │ └── main.vue │ ├── date-picker │ │ ├── README.md │ │ ├── _index.js │ │ ├── cooking.conf.js │ │ ├── index.js │ │ ├── package.json │ │ └── src │ │ │ ├── basic │ │ │ ├── date-table.vue │ │ │ ├── month-table.vue │ │ │ ├── time-spinner.vue │ │ │ └── year-table.vue │ │ │ ├── panel │ │ │ ├── date-range.vue │ │ │ ├── date.vue │ │ │ ├── time-range.vue │ │ │ ├── time-select.vue │ │ │ └── time.vue │ │ │ ├── picker.vue │ │ │ ├── picker │ │ │ ├── date-picker.js │ │ │ ├── time-picker.js │ │ │ └── time-select.js │ │ │ └── util │ │ │ └── index.js │ ├── dialog │ │ ├── index.js │ │ └── src │ │ │ └── component.vue │ ├── dropdown-item │ │ └── index.js │ ├── dropdown-menu │ │ └── index.js │ ├── dropdown │ │ ├── index.js │ │ └── src │ │ │ ├── dropdown-item.vue │ │ │ ├── dropdown-menu.vue │ │ │ └── dropdown.vue │ ├── footer │ │ ├── index.js │ │ └── src │ │ │ └── main.vue │ ├── form-item │ │ └── index.js │ ├── form │ │ ├── index.js │ │ └── src │ │ │ ├── form-item.vue │ │ │ └── form.vue │ ├── header │ │ ├── index.js │ │ └── src │ │ │ └── main.vue │ ├── icon │ │ ├── index.js │ │ └── src │ │ │ └── icon.vue │ ├── input-number │ │ ├── index.js │ │ └── src │ │ │ └── input-number.vue │ ├── input │ │ ├── index.js │ │ └── src │ │ │ ├── calcTextareaHeight.js │ │ │ └── input.vue │ ├── loading │ │ ├── README.md │ │ ├── cooking.conf.js │ │ ├── index.js │ │ ├── package.json │ │ └── src │ │ │ ├── directive.js │ │ │ ├── index.js │ │ │ └── loading.vue │ ├── main │ │ ├── index.js │ │ └── src │ │ │ └── main.vue │ ├── menu-item-group │ │ └── index.js │ ├── menu-item │ │ └── index.js │ ├── menu │ │ ├── index.js │ │ └── src │ │ │ ├── menu-item-group.vue │ │ │ ├── menu-item.vue │ │ │ ├── menu-mixin.js │ │ │ ├── menu.vue │ │ │ └── submenu.vue │ ├── message-box │ │ ├── index.js │ │ └── src │ │ │ ├── main.js │ │ │ └── main.vue │ ├── message │ │ ├── index.js │ │ └── src │ │ │ ├── main.js │ │ │ └── main.vue │ ├── notification │ │ ├── index.js │ │ └── src │ │ │ ├── main.js │ │ │ └── main.vue │ ├── option-group │ │ └── index.js │ ├── option │ │ └── index.js │ ├── pagination │ │ ├── README.md │ │ ├── cooking.conf.js │ │ ├── index.js │ │ ├── package.json │ │ └── src │ │ │ ├── pager.vue │ │ │ └── pagination.js │ ├── popover │ │ ├── index.js │ │ └── src │ │ │ ├── directive.js │ │ │ └── main.vue │ ├── progress │ │ ├── index.js │ │ └── src │ │ │ └── progress.vue │ ├── radio-button │ │ └── index.js │ ├── radio-group │ │ └── index.js │ ├── radio │ │ ├── index.js │ │ └── src │ │ │ ├── radio-button.vue │ │ │ ├── radio-group.vue │ │ │ └── radio.vue │ ├── rate │ │ ├── index.js │ │ └── src │ │ │ └── main.vue │ ├── row │ │ ├── index.js │ │ └── src │ │ │ └── row.js │ ├── scrollbar │ │ ├── index.js │ │ └── src │ │ │ ├── bar.js │ │ │ ├── main.js │ │ │ └── util.js │ ├── select │ │ ├── index.js │ │ └── src │ │ │ ├── navigation-mixin.js │ │ │ ├── option-group.vue │ │ │ ├── option.vue │ │ │ ├── select-dropdown.vue │ │ │ └── select.vue │ ├── slider │ │ ├── index.js │ │ └── src │ │ │ ├── button.vue │ │ │ └── main.vue │ ├── spinner │ │ ├── index.js │ │ └── src │ │ │ └── spinner.vue │ ├── step │ │ └── index.js │ ├── steps │ │ ├── README.md │ │ ├── index.js │ │ └── src │ │ │ ├── step.vue │ │ │ └── steps.vue │ ├── submenu │ │ └── index.js │ ├── switch │ │ ├── index.js │ │ └── src │ │ │ └── component.vue │ ├── tab-pane │ │ └── index.js │ ├── table-column │ │ └── index.js │ ├── table │ │ ├── README.md │ │ ├── _index.js │ │ ├── cooking.conf.js │ │ ├── index.js │ │ ├── package.json │ │ └── src │ │ │ ├── dropdown.js │ │ │ ├── filter-panel.vue │ │ │ ├── layout-observer.js │ │ │ ├── table-body.js │ │ │ ├── table-column.js │ │ │ ├── table-footer.js │ │ │ ├── table-header.js │ │ │ ├── table-layout.js │ │ │ ├── table-store.js │ │ │ ├── table.vue │ │ │ └── util.js │ ├── tabs │ │ ├── index.js │ │ └── src │ │ │ ├── tab-bar.vue │ │ │ ├── tab-nav.vue │ │ │ ├── tab-pane.vue │ │ │ └── tabs.vue │ ├── tag │ │ ├── index.js │ │ └── src │ │ │ └── tag.vue │ ├── theme-chalk │ │ ├── .gitignore │ │ ├── README.md │ │ ├── gulpfile.js │ │ ├── package.json │ │ └── src │ │ │ ├── alert.css │ │ │ ├── alert.scss │ │ │ ├── aside.scss │ │ │ ├── autocomplete.scss │ │ │ ├── badge.scss │ │ │ ├── base.scss │ │ │ ├── breadcrumb-item.scss │ │ │ ├── breadcrumb.scss │ │ │ ├── button-group.scss │ │ │ ├── button.css │ │ │ ├── button.scss │ │ │ ├── card.scss │ │ │ ├── carousel-item.css │ │ │ ├── carousel-item.scss │ │ │ ├── carousel.css │ │ │ ├── carousel.scss │ │ │ ├── cascader.scss │ │ │ ├── checkbox-button.scss │ │ │ ├── checkbox-group.scss │ │ │ ├── checkbox.scss │ │ │ ├── col.scss │ │ │ ├── collapse-item.scss │ │ │ ├── collapse.scss │ │ │ ├── color-picker.scss │ │ │ ├── common │ │ │ ├── popup.scss │ │ │ ├── transition.scss │ │ │ └── var.scss │ │ │ ├── container.scss │ │ │ ├── date-picker.scss │ │ │ ├── date-picker │ │ │ ├── date-picker.scss │ │ │ ├── date-range-picker.scss │ │ │ ├── date-table.scss │ │ │ ├── month-table.scss │ │ │ ├── picker-panel.scss │ │ │ ├── picker.scss │ │ │ ├── time-picker.scss │ │ │ ├── time-range-picker.scss │ │ │ ├── time-spinner.scss │ │ │ └── year-table.scss │ │ │ ├── dialog.scss │ │ │ ├── display.scss │ │ │ ├── dropdown-item.scss │ │ │ ├── dropdown-menu.scss │ │ │ ├── dropdown.scss │ │ │ ├── fonts │ │ │ ├── element-icons.ttf │ │ │ └── element-icons.woff │ │ │ ├── footer.scss │ │ │ ├── form-item.scss │ │ │ ├── form.scss │ │ │ ├── header.scss │ │ │ ├── icon.scss │ │ │ ├── index.scss │ │ │ ├── input-number.scss │ │ │ ├── input.scss │ │ │ ├── loading.css │ │ │ ├── loading.scss │ │ │ ├── main.scss │ │ │ ├── menu-item-group.scss │ │ │ ├── menu-item.scss │ │ │ ├── menu.scss │ │ │ ├── message-box.scss │ │ │ ├── message.css │ │ │ ├── message.scss │ │ │ ├── mixins │ │ │ ├── _button.scss │ │ │ ├── config.scss │ │ │ ├── function.scss │ │ │ ├── mixins.scss │ │ │ └── utils.scss │ │ │ ├── notification.css │ │ │ ├── notification.scss │ │ │ ├── option-group.scss │ │ │ ├── option.scss │ │ │ ├── pagination.scss │ │ │ ├── popover.scss │ │ │ ├── popper.scss │ │ │ ├── progress.scss │ │ │ ├── radio-button.scss │ │ │ ├── radio-group.scss │ │ │ ├── radio.scss │ │ │ ├── rate.scss │ │ │ ├── reset.scss │ │ │ ├── row.scss │ │ │ ├── scrollbar.scss │ │ │ ├── select-dropdown.scss │ │ │ ├── select.scss │ │ │ ├── slider.scss │ │ │ ├── spinner.scss │ │ │ ├── step.scss │ │ │ ├── steps.scss │ │ │ ├── submenu.scss │ │ │ ├── switch.scss │ │ │ ├── tab-pane.scss │ │ │ ├── table-column.scss │ │ │ ├── table.scss │ │ │ ├── tabs.scss │ │ │ ├── tag.scss │ │ │ ├── time-picker.scss │ │ │ ├── time-select.scss │ │ │ ├── tooltip.scss │ │ │ ├── transfer.scss │ │ │ ├── tree.scss │ │ │ └── upload.scss │ ├── time-picker │ │ └── index.js │ ├── time-select │ │ └── index.js │ ├── tooltip │ │ ├── index.js │ │ └── src │ │ │ └── main.js │ ├── transfer │ │ ├── index.js │ │ └── src │ │ │ ├── main.vue │ │ │ └── transfer-panel.vue │ ├── tree │ │ ├── index.js │ │ └── src │ │ │ ├── model │ │ │ ├── node.js │ │ │ ├── tree-store.js │ │ │ └── util.js │ │ │ ├── tree-node.vue │ │ │ └── tree.vue │ └── upload │ │ ├── README.md │ │ ├── cooking.conf.js │ │ ├── index.js │ │ ├── package.json │ │ └── src │ │ ├── ajax.js │ │ ├── iframe-upload.vue │ │ ├── index.vue │ │ ├── upload-dragger.vue │ │ ├── upload-list.vue │ │ └── upload.vue ├── src │ ├── directives │ │ ├── mousewheel.js │ │ └── repeat-click.js │ ├── index.js │ ├── locale │ │ ├── format.js │ │ ├── index.js │ │ └── lang │ │ │ ├── af-ZA.js │ │ │ ├── ar.js │ │ │ ├── bg.js │ │ │ ├── ca.js │ │ │ ├── cs-CZ.js │ │ │ ├── da.js │ │ │ ├── de.js │ │ │ ├── ee.js │ │ │ ├── el.js │ │ │ ├── en.js │ │ │ ├── es.js │ │ │ ├── fa.js │ │ │ ├── fi.js │ │ │ ├── fr.js │ │ │ ├── he.js │ │ │ ├── hu.js │ │ │ ├── id.js │ │ │ ├── it.js │ │ │ ├── ja.js │ │ │ ├── ko.js │ │ │ ├── ku.js │ │ │ ├── kz.js │ │ │ ├── lt.js │ │ │ ├── lv.js │ │ │ ├── mn.js │ │ │ ├── nb-NO.js │ │ │ ├── nl.js │ │ │ ├── pl.js │ │ │ ├── pt-br.js │ │ │ ├── pt.js │ │ │ ├── ro.js │ │ │ ├── ru-RU.js │ │ │ ├── sk.js │ │ │ ├── sl.js │ │ │ ├── sv-SE.js │ │ │ ├── ta.js │ │ │ ├── th.js │ │ │ ├── tk.js │ │ │ ├── tr-TR.js │ │ │ ├── ua.js │ │ │ ├── vi.js │ │ │ ├── zh-CN.js │ │ │ └── zh-TW.js │ ├── mixins │ │ ├── emitter.js │ │ ├── focus.js │ │ ├── locale.js │ │ └── migrating.js │ ├── transitions │ │ └── collapse-transition.js │ └── utils │ │ ├── after-leave.js │ │ ├── aria-dialog.js │ │ ├── aria-utils.js │ │ ├── clickoutside.js │ │ ├── date.js │ │ ├── dom.js │ │ ├── menu │ │ ├── aria-menubar.js │ │ ├── aria-menuitem.js │ │ └── aria-submenu.js │ │ ├── merge.js │ │ ├── popper.js │ │ ├── popup │ │ ├── index.js │ │ └── popup-manager.js │ │ ├── resize-event.js │ │ ├── scroll-into-view.js │ │ ├── scrollbar-width.js │ │ ├── shared.js │ │ ├── sync.js │ │ ├── util.js │ │ ├── vdom.js │ │ └── vue-popper.js ├── test │ └── unit │ │ ├── index.js │ │ ├── karma.conf.js │ │ ├── specs │ │ ├── alert.spec.js │ │ ├── autocomplete.spec.js │ │ ├── badge.spec.js │ │ ├── breadcrumb.spec.js │ │ ├── button.spec.js │ │ ├── card.spec.js │ │ ├── carousel.spec.js │ │ ├── cascader.spec.js │ │ ├── checkbox.spec.js │ │ ├── col.spec.js │ │ ├── collapse.spec.js │ │ ├── color-picker.spec.js │ │ ├── container.spec.js │ │ ├── date-picker.spec.js │ │ ├── dialog.spec.js │ │ ├── dropdown.spec.js │ │ ├── form.spec.js │ │ ├── input-number.spec.js │ │ ├── input.spec.js │ │ ├── loading.spec.js │ │ ├── menu.spec.js │ │ ├── message-box.spec.js │ │ ├── message.spec.js │ │ ├── mixin.vue-popup.spec.js │ │ ├── notification.spec.js │ │ ├── pagination.spec.js │ │ ├── popover.spec.js │ │ ├── progress.spec.js │ │ ├── radio.spec.js │ │ ├── rate.spec.js │ │ ├── row.spec.js │ │ ├── select.spec.js │ │ ├── slider.spec.js │ │ ├── steps.spec.js │ │ ├── switch.spec.js │ │ ├── sync.spec.js │ │ ├── table.spec.js │ │ ├── tabs.spec.js │ │ ├── tag.spec.js │ │ ├── time-picker.spec.js │ │ ├── time-select.spec.js │ │ ├── tooltip.spec.js │ │ ├── transfer.spec.js │ │ ├── tree.spec.js │ │ ├── upload.spec.js │ │ ├── util.clickoutside.spec.js │ │ └── util.vue-popper.spec.js │ │ └── util.js └── types.md ├── NuxtDemo ├── .editorconfig ├── .eslintrc.js ├── .gitignore ├── README.md ├── assets │ ├── README.md │ └── font-awesome │ │ ├── HELP-US-OUT.txt │ │ ├── css │ │ ├── font-awesome.css │ │ └── font-awesome.min.css │ │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ │ ├── less │ │ ├── animated.less │ │ ├── bordered-pulled.less │ │ ├── core.less │ │ ├── fixed-width.less │ │ ├── font-awesome.less │ │ ├── icons.less │ │ ├── larger.less │ │ ├── list.less │ │ ├── mixins.less │ │ ├── path.less │ │ ├── rotated-flipped.less │ │ ├── screen-reader.less │ │ ├── stacked.less │ │ └── variables.less │ │ └── scss │ │ ├── _animated.scss │ │ ├── _bordered-pulled.scss │ │ ├── _core.scss │ │ ├── _fixed-width.scss │ │ ├── _icons.scss │ │ ├── _larger.scss │ │ ├── _list.scss │ │ ├── _mixins.scss │ │ ├── _path.scss │ │ ├── _rotated-flipped.scss │ │ ├── _screen-reader.scss │ │ ├── _stacked.scss │ │ ├── _variables.scss │ │ └── font-awesome.scss ├── components │ ├── AppLogo.vue │ ├── Avatar.vue │ └── README.md ├── layouts │ ├── README.md │ ├── default.vue │ └── page.vue ├── middleware │ ├── README.md │ └── add.js ├── nuxt.config.js ├── package-lock.json ├── package.json ├── pages │ ├── README.md │ ├── app.vue │ ├── index.vue │ ├── state.vue │ └── user │ │ ├── _id.vue │ │ ├── about.vue │ │ ├── index.vue │ │ └── sign.vue ├── plugins │ ├── README.md │ └── mint-ui.js ├── static │ ├── README.md │ ├── favicon.ico │ └── logo.png └── store │ ├── README.md │ └── index.js ├── README.md ├── VueCodes ├── README.md ├── demos │ ├── .idea │ │ ├── demos.iml │ │ ├── modules.xml │ │ └── workspace.xml │ ├── HelloArr.html │ ├── HelloOr.html │ ├── HelloProperty.html │ ├── HelloTransition.html │ ├── HelloTransition02.html │ ├── HelloTransitionGroup.html │ ├── HelloVue.html │ ├── Hey.html │ ├── MyTransition.html │ ├── MyTransition02.html │ ├── Transition02.html │ ├── parse.json │ ├── vnode.json │ └── vue.js └── vue │ ├── README.md │ ├── src │ ├── compiler │ │ ├── codegen │ │ │ ├── events.js │ │ │ └── index.js │ │ ├── create-compiler.js │ │ ├── directives │ │ │ ├── bind.js │ │ │ ├── index.js │ │ │ ├── model.js │ │ │ └── on.js │ │ ├── error-detector.js │ │ ├── helpers.js │ │ ├── index.js │ │ ├── optimizer.js │ │ ├── parser │ │ │ ├── entity-decoder.js │ │ │ ├── filter-parser.js │ │ │ ├── html-parser.js │ │ │ ├── index.js │ │ │ └── text-parser.js │ │ └── to-function.js │ ├── core │ │ ├── components │ │ │ ├── index.js │ │ │ └── keep-alive.js │ │ ├── config.js │ │ ├── global-api │ │ │ ├── assets.js │ │ │ ├── extend.js │ │ │ ├── index.js │ │ │ ├── mixin.js │ │ │ └── use.js │ │ ├── index.js │ │ ├── instance │ │ │ ├── events.js │ │ │ ├── index.js │ │ │ ├── init.js │ │ │ ├── inject.js │ │ │ ├── lifecycle.js │ │ │ ├── proxy.js │ │ │ ├── render-helpers │ │ │ │ ├── bind-object-listeners.js │ │ │ │ ├── bind-object-props.js │ │ │ │ ├── check-keycodes.js │ │ │ │ ├── index.js │ │ │ │ ├── render-list.js │ │ │ │ ├── render-slot.js │ │ │ │ ├── render-static.js │ │ │ │ ├── resolve-filter.js │ │ │ │ └── resolve-slots.js │ │ │ ├── render.js │ │ │ └── state.js │ │ ├── observer │ │ │ ├── array.js │ │ │ ├── dep.js │ │ │ ├── index.js │ │ │ ├── scheduler.js │ │ │ ├── traverse.js │ │ │ └── watcher.js │ │ ├── util │ │ │ ├── debug.js │ │ │ ├── env.js │ │ │ ├── error.js │ │ │ ├── index.js │ │ │ ├── lang.js │ │ │ ├── next-tick.js │ │ │ ├── options.js │ │ │ ├── perf.js │ │ │ └── props.js │ │ └── vdom │ │ │ ├── create-component.js │ │ │ ├── create-element.js │ │ │ ├── create-functional-component.js │ │ │ ├── helpers │ │ │ ├── extract-props.js │ │ │ ├── get-first-component-child.js │ │ │ ├── index.js │ │ │ ├── is-async-placeholder.js │ │ │ ├── merge-hook.js │ │ │ ├── normalize-children.js │ │ │ ├── resolve-async-component.js │ │ │ └── update-listeners.js │ │ │ ├── modules │ │ │ ├── directives.js │ │ │ ├── index.js │ │ │ └── ref.js │ │ │ ├── patch.js │ │ │ └── vnode.js │ ├── platforms │ │ ├── web │ │ │ ├── compiler │ │ │ │ ├── directives │ │ │ │ │ ├── html.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── model.js │ │ │ │ │ └── text.js │ │ │ │ ├── index.js │ │ │ │ ├── modules │ │ │ │ │ ├── class.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── model.js │ │ │ │ │ └── style.js │ │ │ │ ├── options.js │ │ │ │ └── util.js │ │ │ ├── entry-compiler.js │ │ │ ├── entry-runtime-with-compiler.js │ │ │ ├── entry-runtime.js │ │ │ ├── entry-server-basic-renderer.js │ │ │ ├── entry-server-renderer.js │ │ │ ├── runtime │ │ │ │ ├── class-util.js │ │ │ │ ├── components │ │ │ │ │ ├── index.js │ │ │ │ │ ├── transition-group.js │ │ │ │ │ └── transition.js │ │ │ │ ├── directives │ │ │ │ │ ├── index.js │ │ │ │ │ ├── model.js │ │ │ │ │ └── show.js │ │ │ │ ├── index.js │ │ │ │ ├── modules │ │ │ │ │ ├── attrs.js │ │ │ │ │ ├── class.js │ │ │ │ │ ├── dom-props.js │ │ │ │ │ ├── events.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── style.js │ │ │ │ │ └── transition.js │ │ │ │ ├── node-ops.js │ │ │ │ ├── patch.js │ │ │ │ └── transition-util.js │ │ │ ├── server │ │ │ │ ├── compiler.js │ │ │ │ ├── directives │ │ │ │ │ ├── index.js │ │ │ │ │ ├── model.js │ │ │ │ │ └── show.js │ │ │ │ ├── modules │ │ │ │ │ ├── attrs.js │ │ │ │ │ ├── class.js │ │ │ │ │ ├── dom-props.js │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.js │ │ │ │ └── util.js │ │ │ └── util │ │ │ │ ├── attrs.js │ │ │ │ ├── class.js │ │ │ │ ├── compat.js │ │ │ │ ├── element.js │ │ │ │ ├── index.js │ │ │ │ └── style.js │ │ └── weex │ │ │ ├── compiler │ │ │ ├── directives │ │ │ │ ├── index.js │ │ │ │ └── model.js │ │ │ ├── index.js │ │ │ └── modules │ │ │ │ ├── append.js │ │ │ │ ├── class.js │ │ │ │ ├── index.js │ │ │ │ ├── props.js │ │ │ │ ├── recycle-list │ │ │ │ ├── component-root.js │ │ │ │ ├── component.js │ │ │ │ ├── index.js │ │ │ │ ├── recycle-list.js │ │ │ │ ├── text.js │ │ │ │ ├── v-bind.js │ │ │ │ ├── v-for.js │ │ │ │ ├── v-if.js │ │ │ │ └── v-on.js │ │ │ │ └── style.js │ │ │ ├── entry-compiler.js │ │ │ ├── entry-framework.js │ │ │ ├── entry-runtime-factory.js │ │ │ ├── runtime │ │ │ ├── components │ │ │ │ ├── index.js │ │ │ │ ├── richtext.js │ │ │ │ ├── transition-group.js │ │ │ │ └── transition.js │ │ │ ├── directives │ │ │ │ └── index.js │ │ │ ├── index.js │ │ │ ├── modules │ │ │ │ ├── attrs.js │ │ │ │ ├── class.js │ │ │ │ ├── events.js │ │ │ │ ├── index.js │ │ │ │ ├── style.js │ │ │ │ └── transition.js │ │ │ ├── node-ops.js │ │ │ ├── patch.js │ │ │ ├── recycle-list │ │ │ │ ├── render-component-template.js │ │ │ │ └── virtual-component.js │ │ │ └── text-node.js │ │ │ └── util │ │ │ ├── element.js │ │ │ ├── index.js │ │ │ └── parser.js │ ├── server │ │ ├── bundle-renderer │ │ │ ├── create-bundle-renderer.js │ │ │ ├── create-bundle-runner.js │ │ │ └── source-map-support.js │ │ ├── create-basic-renderer.js │ │ ├── create-renderer.js │ │ ├── optimizing-compiler │ │ │ ├── codegen.js │ │ │ ├── index.js │ │ │ ├── modules.js │ │ │ ├── optimizer.js │ │ │ └── runtime-helpers.js │ │ ├── render-context.js │ │ ├── render-stream.js │ │ ├── render.js │ │ ├── template-renderer │ │ │ ├── create-async-file-mapper.js │ │ │ ├── index.js │ │ │ ├── parse-template.js │ │ │ └── template-stream.js │ │ ├── util.js │ │ ├── webpack-plugin │ │ │ ├── client.js │ │ │ ├── server.js │ │ │ └── util.js │ │ └── write.js │ ├── sfc │ │ └── parser.js │ └── shared │ │ ├── constants.js │ │ └── util.js │ ├── test │ ├── e2e │ │ ├── .eslintrc │ │ ├── nightwatch.config.js │ │ ├── runner.js │ │ └── specs │ │ │ ├── async-edge-cases.html │ │ │ ├── async-edge-cases.js │ │ │ ├── basic-ssr.html │ │ │ ├── basic-ssr.js │ │ │ ├── commits.js │ │ │ ├── grid.js │ │ │ ├── markdown.js │ │ │ ├── modal.js │ │ │ ├── select2.js │ │ │ ├── svg.js │ │ │ ├── todomvc.js │ │ │ └── tree.js │ ├── helpers │ │ ├── .eslintrc │ │ ├── classlist.js │ │ ├── test-object-option.js │ │ ├── to-equal.js │ │ ├── to-have-been-warned.js │ │ ├── trigger-event.js │ │ ├── vdom.js │ │ └── wait-for-update.js │ ├── ssr │ │ ├── .eslintrc │ │ ├── async-loader.js │ │ ├── compile-with-webpack.js │ │ ├── fixtures │ │ │ ├── app.js │ │ │ ├── async-bar.js │ │ │ ├── async-foo.js │ │ │ ├── cache.js │ │ │ ├── error.js │ │ │ ├── nested-cache.js │ │ │ ├── promise-rejection.js │ │ │ ├── split.js │ │ │ ├── test.css │ │ │ ├── test.png │ │ │ └── test.woff2 │ │ ├── jasmine.json │ │ ├── ssr-basic-renderer.spec.js │ │ ├── ssr-bundle-render.spec.js │ │ ├── ssr-stream.spec.js │ │ ├── ssr-string.spec.js │ │ └── ssr-template.spec.js │ ├── unit │ │ ├── .eslintrc │ │ ├── features │ │ │ ├── component │ │ │ │ ├── component-async.spec.js │ │ │ │ ├── component-keep-alive.spec.js │ │ │ │ ├── component-scoped-slot.spec.js │ │ │ │ ├── component-slot.spec.js │ │ │ │ └── component.spec.js │ │ │ ├── debug.spec.js │ │ │ ├── directives │ │ │ │ ├── bind.spec.js │ │ │ │ ├── class.spec.js │ │ │ │ ├── cloak.spec.js │ │ │ │ ├── for.spec.js │ │ │ │ ├── html.spec.js │ │ │ │ ├── if.spec.js │ │ │ │ ├── model-checkbox.spec.js │ │ │ │ ├── model-component.spec.js │ │ │ │ ├── model-dynamic.spec.js │ │ │ │ ├── model-file.spec.js │ │ │ │ ├── model-parse.spec.js │ │ │ │ ├── model-radio.spec.js │ │ │ │ ├── model-select.spec.js │ │ │ │ ├── model-text.spec.js │ │ │ │ ├── on.spec.js │ │ │ │ ├── once.spec.js │ │ │ │ ├── pre.spec.js │ │ │ │ ├── show.spec.js │ │ │ │ ├── static-style-parser.spec.js │ │ │ │ ├── style.spec.js │ │ │ │ └── text.spec.js │ │ │ ├── error-handling.spec.js │ │ │ ├── filter │ │ │ │ └── filter.spec.js │ │ │ ├── global-api │ │ │ │ ├── assets.spec.js │ │ │ │ ├── compile.spec.js │ │ │ │ ├── config.spec.js │ │ │ │ ├── extend.spec.js │ │ │ │ ├── mixin.spec.js │ │ │ │ ├── set-delete.spec.js │ │ │ │ └── use.spec.js │ │ │ ├── instance │ │ │ │ ├── init.spec.js │ │ │ │ ├── methods-data.spec.js │ │ │ │ ├── methods-events.spec.js │ │ │ │ ├── methods-lifecycle.spec.js │ │ │ │ ├── properties.spec.js │ │ │ │ └── render-proxy.spec.js │ │ │ ├── options │ │ │ │ ├── _scopeId.spec.js │ │ │ │ ├── comments.spec.js │ │ │ │ ├── components.spec.js │ │ │ │ ├── computed.spec.js │ │ │ │ ├── data.spec.js │ │ │ │ ├── delimiters.spec.js │ │ │ │ ├── directives.spec.js │ │ │ │ ├── el.spec.js │ │ │ │ ├── errorCaptured.spec.js │ │ │ │ ├── extends.spec.js │ │ │ │ ├── functional.spec.js │ │ │ │ ├── inheritAttrs.spec.js │ │ │ │ ├── inject.spec.js │ │ │ │ ├── lifecycle.spec.js │ │ │ │ ├── methods.spec.js │ │ │ │ ├── mixins.spec.js │ │ │ │ ├── name.spec.js │ │ │ │ ├── parent.spec.js │ │ │ │ ├── props.spec.js │ │ │ │ ├── propsData.spec.js │ │ │ │ ├── render.spec.js │ │ │ │ ├── renderError.spec.js │ │ │ │ ├── template.spec.js │ │ │ │ └── watch.spec.js │ │ │ ├── ref.spec.js │ │ │ └── transition │ │ │ │ ├── inject-styles.js │ │ │ │ ├── transition-group.spec.js │ │ │ │ ├── transition-mode.spec.js │ │ │ │ └── transition.spec.js │ │ ├── index.js │ │ ├── karma.base.config.js │ │ ├── karma.cover.config.js │ │ ├── karma.dev.config.js │ │ ├── karma.sauce.config.js │ │ ├── karma.unit.config.js │ │ └── modules │ │ │ ├── compiler │ │ │ ├── codegen.spec.js │ │ │ ├── compiler-options.spec.js │ │ │ ├── optimizer.spec.js │ │ │ └── parser.spec.js │ │ │ ├── observer │ │ │ ├── observer.spec.js │ │ │ ├── scheduler.spec.js │ │ │ └── watcher.spec.js │ │ │ ├── server-compiler │ │ │ └── optimizer.spec.js │ │ │ ├── sfc │ │ │ └── sfc-parser.spec.js │ │ │ ├── util │ │ │ └── next-tick.spec.js │ │ │ └── vdom │ │ │ ├── create-component.spec.js │ │ │ ├── create-element.spec.js │ │ │ ├── modules │ │ │ ├── attrs.spec.js │ │ │ ├── class.spec.js │ │ │ ├── directive.spec.js │ │ │ ├── dom-props.spec.js │ │ │ ├── events.spec.js │ │ │ └── style.spec.js │ │ │ └── patch │ │ │ ├── children.spec.js │ │ │ ├── edge-cases.spec.js │ │ │ ├── element.spec.js │ │ │ ├── hooks.spec.js │ │ │ └── hydration.spec.js │ └── weex │ │ ├── .eslintrc │ │ ├── cases │ │ ├── cases.spec.js │ │ ├── event │ │ │ ├── click.after.vdom.js │ │ │ ├── click.before.vdom.js │ │ │ └── click.vue │ │ ├── recycle-list │ │ │ ├── attrs.vdom.js │ │ │ ├── attrs.vue │ │ │ ├── classname.vdom.js │ │ │ ├── classname.vue │ │ │ ├── components │ │ │ │ ├── banner.vue │ │ │ │ ├── counter.vue │ │ │ │ ├── editor.vue │ │ │ │ ├── footer.vue │ │ │ │ ├── lifecycle.vue │ │ │ │ ├── poster.vue │ │ │ │ ├── stateful-lifecycle.vdom.js │ │ │ │ ├── stateful-lifecycle.vue │ │ │ │ ├── stateful-v-model.vdom.js │ │ │ │ ├── stateful-v-model.vue │ │ │ │ ├── stateful.vdom.js │ │ │ │ ├── stateful.vue │ │ │ │ ├── stateless-multi-components.vdom.js │ │ │ │ ├── stateless-multi-components.vue │ │ │ │ ├── stateless-with-props.vdom.js │ │ │ │ ├── stateless-with-props.vue │ │ │ │ ├── stateless.vdom.js │ │ │ │ └── stateless.vue │ │ │ ├── inline-style.vdom.js │ │ │ ├── inline-style.vue │ │ │ ├── text-node.vdom.js │ │ │ ├── text-node.vue │ │ │ ├── v-else-if.vdom.js │ │ │ ├── v-else-if.vue │ │ │ ├── v-else.vdom.js │ │ │ ├── v-else.vue │ │ │ ├── v-for-iterator.vdom.js │ │ │ ├── v-for-iterator.vue │ │ │ ├── v-for.vdom.js │ │ │ ├── v-for.vue │ │ │ ├── v-if.vdom.js │ │ │ ├── v-if.vue │ │ │ ├── v-on-inline.vdom.js │ │ │ ├── v-on-inline.vue │ │ │ ├── v-on.vdom.js │ │ │ └── v-on.vue │ │ └── render │ │ │ ├── sample.vdom.js │ │ │ └── sample.vue │ │ ├── compiler │ │ ├── append.spec.js │ │ ├── class.spec.js │ │ ├── compile.spec.js │ │ ├── parser.spec.js │ │ ├── props.spec.js │ │ ├── style.spec.js │ │ └── v-model.spec.js │ │ ├── helpers │ │ └── index.js │ │ ├── jasmine.json │ │ └── runtime │ │ ├── attrs.spec.js │ │ ├── class.spec.js │ │ ├── components │ │ └── richtext.spec.js │ │ ├── events.spec.js │ │ ├── framework.spec.js │ │ ├── node.spec.js │ │ └── style.spec.js │ └── vue.js ├── VueRouterDemo ├── .babelrc ├── .editorconfig ├── .gitignore ├── README.md ├── build │ ├── build.js │ ├── check-versions.js │ ├── dev-client.js │ ├── dev-server.js │ ├── utils.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ └── webpack.prod.conf.js ├── config │ ├── dev.env.js │ ├── index.js │ └── prod.env.js ├── index.html ├── package.json ├── src │ ├── App.vue │ ├── assets │ │ └── logo.png │ ├── components │ │ ├── childs │ │ │ ├── child01.vue │ │ │ └── child02.vue │ │ ├── page01.vue │ │ ├── page02.vue │ │ ├── page03.vue │ │ ├── page04.vue │ │ └── page05.vue │ ├── main.js │ └── routes.js └── static │ └── .gitkeep ├── VueTestDemo ├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .postcssrc.js ├── README.md ├── build │ ├── build.js │ ├── check-versions.js │ ├── dev-client.js │ ├── dev-server.js │ ├── utils.js │ ├── vue-loader.conf.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ ├── webpack.prod.conf.js │ └── webpack.test.conf.js ├── config │ ├── dev.env.js │ ├── index.js │ ├── prod.env.js │ └── test.env.js ├── index.html ├── package.json ├── src │ ├── App.vue │ ├── assets │ │ └── logo.png │ ├── components │ │ ├── Click.vue │ │ └── Hello.vue │ ├── main.js │ └── router.js ├── static │ └── .gitkeep └── test │ ├── e2e │ ├── custom-assertions │ │ └── elementCount.js │ ├── nightwatch.conf.js │ ├── runner.js │ └── specs │ │ └── test.js │ └── unit │ ├── .eslintrc │ ├── index.js │ ├── karma.conf.js │ ├── specs │ ├── Click.spec.js │ └── Hello.spec.js │ └── util.js ├── VuexDemo ├── .babelrc ├── .editorconfig ├── .gitignore ├── README.md ├── build │ ├── build.js │ ├── check-versions.js │ ├── dev-client.js │ ├── dev-server.js │ ├── utils.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ └── webpack.prod.conf.js ├── config │ ├── dev.env.js │ ├── index.js │ └── prod.env.js ├── index.html ├── package.json ├── src │ ├── App.vue │ ├── assets │ │ └── logo.png │ ├── components │ │ ├── A.vue │ │ ├── Arr.vue │ │ ├── B.vue │ │ ├── Hello.vue │ │ └── Single.vue │ ├── main.js │ └── stores.js └── static │ └── .gitkeep └── WebpackDemos ├── Demo04 ├── .babelrc ├── .gitignore ├── app.js ├── bar.js ├── bundle.js ├── index.html ├── package.json └── webpack.config.js ├── README.md ├── demo01 ├── app.js ├── bundle.js ├── hello.js └── index.html ├── demo02 ├── .babelrc ├── .gitignore ├── app │ ├── entry.js │ ├── good.js │ ├── home.js │ └── sign.js ├── index.html ├── package.json └── webpack.config.js ├── demo03 ├── .babelrc ├── .editorconfig ├── .gitignore ├── README.md ├── build │ ├── build.js │ ├── check-versions.js │ ├── dev-client.js │ ├── dev-server.js │ ├── utils.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ └── webpack.prod.conf.js ├── config │ ├── dev.env.js │ ├── index.js │ └── prod.env.js ├── index.html ├── package.json ├── src │ ├── App.vue │ ├── assets │ │ └── logo.png │ ├── components │ │ └── Hello.vue │ └── main.js └── static │ └── .gitkeep └── demo05 ├── .babelrc ├── .gitignore ├── index.html ├── package.json ├── src ├── App.vue ├── assets │ └── logo.png ├── components │ └── Hello.vue └── main.js └── webpack.config.js /ElementCode/build/bin/build-all.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const components = require('../../components.json'); 4 | const execSync = require('child_process').execSync; 5 | const existsSync = require('fs').existsSync; 6 | const path = require('path'); 7 | 8 | let componentPaths = []; 9 | 10 | delete components.index; 11 | delete components.font; 12 | 13 | Object.keys(components).forEach(key => { 14 | const filePath = path.join(__dirname, `../../packages/${key}/cooking.conf.js`); 15 | 16 | if (existsSync(filePath)) { 17 | componentPaths.push(`packages/${key}/cooking.conf.js`); 18 | } 19 | }); 20 | 21 | const paths = componentPaths.join(','); 22 | const cli = path.join('node_modules', '.bin', 'cooking') + ` build -c ${paths} -p`; 23 | 24 | execSync(cli, { 25 | stdio: 'inherit' 26 | }); 27 | -------------------------------------------------------------------------------- /ElementCode/build/bin/iconInit.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var postcss = require('postcss'); 4 | var fs = require('fs'); 5 | var path = require('path'); 6 | var fontFile = fs.readFileSync(path.resolve(__dirname, '../../packages/theme-chalk/src/icon.scss'), 'utf8'); 7 | var nodes = postcss.parse(fontFile).nodes; 8 | var classList = []; 9 | 10 | nodes.forEach((node) => { 11 | var selector = node.selector || ''; 12 | var reg = new RegExp(/\.el-icon-([^:]+):before/); 13 | var arr = selector.match(reg); 14 | 15 | if (arr && arr[1]) { 16 | classList.push(arr[1]); 17 | } 18 | }); 19 | 20 | fs.writeFile(path.resolve(__dirname, '../../examples/icon.json'), JSON.stringify(classList)); 21 | -------------------------------------------------------------------------------- /ElementCode/build/bin/template.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const templates = path.resolve(process.cwd(), './examples/pages/template'); 3 | 4 | const chokidar = require('chokidar'); 5 | let watcher = chokidar.watch([templates]); 6 | 7 | watcher.on('ready', function() { 8 | watcher 9 | .on('change', function() { 10 | exec('npm run i18n'); 11 | }); 12 | }); 13 | 14 | function exec(cmd) { 15 | return require('child_process').execSync(cmd).toString().trim(); 16 | } 17 | -------------------------------------------------------------------------------- /ElementCode/build/bin/version.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var path = require('path'); 3 | var version = process.env.VERSION || require('../../package.json').version; 4 | var content = { '1.4.13': '1.4', '2.0.11': '2.0', '2.1.0': '2.1' }; 5 | if (!content[version]) content[version] = '2.2'; 6 | fs.writeFileSync(path.resolve(__dirname, '../../examples/versions.json'), JSON.stringify(content)); 7 | -------------------------------------------------------------------------------- /ElementCode/build/cooking.common.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var config = require('./config'); 3 | 4 | cooking.set({ 5 | entry: './src/index.js', 6 | dist: './lib', 7 | clean: false, 8 | format: 'cjs', 9 | extends: ['vue2'], 10 | minimize: false, 11 | alias: config.alias, 12 | externals: config.externals 13 | }); 14 | 15 | cooking.add('output.filename', 'element-ui.common.js'); 16 | cooking.add('loader.js.exclude', config.jsexclude); 17 | cooking.add('loader.scss', { 18 | test: /\.scss$/, 19 | loaders: ['style-loader', 'css-loader', 'sass-loader'] 20 | }); 21 | cooking.add('vue.preserveWhitespace', false); 22 | module.exports = cooking.resolve(); 23 | -------------------------------------------------------------------------------- /ElementCode/build/cooking.component.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var Components = require('../components.json'); 3 | var config = require('./config'); 4 | 5 | cooking.set({ 6 | entry: Components, 7 | dist: './lib', 8 | clean: false, 9 | format: 'cjs', 10 | extends: ['vue2'], 11 | minimize: false, 12 | externals: config.externals, 13 | alias: config.alias 14 | }); 15 | 16 | cooking.add('output.filename', '[name].js'); 17 | cooking.add('loader.js.exclude', config.jsexclude); 18 | cooking.add('loader.scss', { 19 | test: /\.scss$/, 20 | loaders: ['style-loader', 'css-loader', 'sass-loader'] 21 | }); 22 | cooking.add('vue.preserveWhitespace', false); 23 | module.exports = cooking.resolve(); 24 | -------------------------------------------------------------------------------- /ElementCode/build/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var config = require('./config'); 3 | 4 | cooking.set({ 5 | entry: './src/index.js', 6 | dist: './lib', 7 | clean: false, 8 | format: 'umd', 9 | moduleName: 'ELEMENT', 10 | extends: ['vue2'], 11 | alias: config.alias, 12 | externals: { vue: config.vue } 13 | }); 14 | 15 | cooking.add('output.filename', 'index.js'); 16 | cooking.add('loader.js.exclude', config.jsexclude); 17 | cooking.add('loader.scss', { 18 | test: /\.scss$/, 19 | loaders: ['style-loader', 'css-loader', 'sass-loader'] 20 | }); 21 | cooking.add('vue.preserveWhitespace', false); 22 | module.exports = cooking.resolve(); 23 | -------------------------------------------------------------------------------- /ElementCode/build/deploy-faas.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | mkdir temp_web 3 | npm run deploy:build 4 | cd temp_web 5 | git clone -b gh-pages https://github.com/ElemeFE/element.git && cd element 6 | 7 | # build sub folder 8 | SUB_FOLDER='2.2' 9 | mkdir $SUB_FOLDER 10 | rm -rf *.js *.css *.map static 11 | rm -rf $SUB_FOLDER/** 12 | cp -rf ../../examples/element-ui/** . 13 | cp -rf ../../examples/element-ui/** $SUB_FOLDER/ 14 | cd ../.. 15 | 16 | # deploy domestic site 17 | faas deploy alpha 18 | rm -rf temp_web -------------------------------------------------------------------------------- /ElementCode/build/gen-single-config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var config = require('./config'); 3 | 4 | module.exports = function(context, moduleName, entry) { 5 | return { 6 | entry: { 7 | index: path.resolve(context, entry || 'index.js') 8 | }, 9 | dist: path.resolve(context, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: moduleName, 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /ElementCode/build/git-release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | git checkout dev 3 | 4 | if test -n "$(git status --porcelain)"; then 5 | echo 'Unclean working tree. Commit or stash changes first.' >&2; 6 | exit 128; 7 | fi 8 | 9 | if ! git fetch --quiet 2>/dev/null; then 10 | echo 'There was a problem fetching your branch. Run `git fetch` to see more...' >&2; 11 | exit 128; 12 | fi 13 | 14 | if test "0" != "$(git rev-list --count --left-only @'{u}'...HEAD)"; then 15 | echo 'Remote history differ. Please pull changes.' >&2; 16 | exit 128; 17 | fi 18 | 19 | echo 'No conflicts.' >&2; 20 | -------------------------------------------------------------------------------- /ElementCode/build/salad.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "browsers": ["ie > 8", "last 2 versions"], 3 | "features": { 4 | "bem": { 5 | "shortcuts": { 6 | "component": "b", 7 | "modifier": "m", 8 | "descendent": "e" 9 | }, 10 | "separators": { 11 | "descendent": "__", 12 | "modifier": "--" 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ElementCode/build/strip-tags.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * strip-tags 3 | * 4 | * Copyright (c) 2015 Jon Schlinkert, contributors. 5 | * Licensed under the MIT license. 6 | */ 7 | 8 | 'use strict'; 9 | 10 | var cheerio = require('cheerio'); 11 | 12 | exports.strip = function(str, tags) { 13 | var $ = cheerio.load(str, {decodeEntities: false}); 14 | 15 | if (!tags || tags.length === 0) { 16 | return str; 17 | } 18 | 19 | tags = !Array.isArray(tags) ? [tags] : tags; 20 | var len = tags.length; 21 | 22 | while (len--) { 23 | $(tags[len]).remove(); 24 | } 25 | 26 | return $.html(); 27 | }; 28 | 29 | exports.fetch = function(str, tag) { 30 | var $ = cheerio.load(str, {decodeEntities: false}); 31 | if (!tag) return str; 32 | 33 | return $(tag).html(); 34 | }; 35 | -------------------------------------------------------------------------------- /ElementCode/packages/alert/index.js: -------------------------------------------------------------------------------- 1 | import Alert from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Alert.install = function(Vue) { 5 | Vue.component(Alert.name, Alert); 6 | }; 7 | 8 | export default Alert; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/aside/index.js: -------------------------------------------------------------------------------- 1 | import Aside from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Aside.install = function(Vue) { 5 | Vue.component(Aside.name, Aside); 6 | }; 7 | 8 | export default Aside; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/aside/src/main.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 21 | -------------------------------------------------------------------------------- /ElementCode/packages/autocomplete/index.js: -------------------------------------------------------------------------------- 1 | import ElAutocomplete from './src/autocomplete'; 2 | 3 | /* istanbul ignore next */ 4 | ElAutocomplete.install = function(Vue) { 5 | Vue.component(ElAutocomplete.name, ElAutocomplete); 6 | }; 7 | 8 | export default ElAutocomplete; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/badge/index.js: -------------------------------------------------------------------------------- 1 | import Badge from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Badge.install = function(Vue) { 5 | Vue.component(Badge.name, Badge); 6 | }; 7 | 8 | export default Badge; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/breadcrumb-item/index.js: -------------------------------------------------------------------------------- 1 | import ElBreadcrumbItem from '../breadcrumb/src/breadcrumb-item'; 2 | 3 | /* istanbul ignore next */ 4 | ElBreadcrumbItem.install = function(Vue) { 5 | Vue.component(ElBreadcrumbItem.name, ElBreadcrumbItem); 6 | }; 7 | 8 | export default ElBreadcrumbItem; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/breadcrumb/index.js: -------------------------------------------------------------------------------- 1 | import ElBreadcrumb from './src/breadcrumb'; 2 | 3 | /* istanbul ignore next */ 4 | ElBreadcrumb.install = function(Vue) { 5 | Vue.component(ElBreadcrumb.name, ElBreadcrumb); 6 | }; 7 | 8 | export default ElBreadcrumb; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/breadcrumb/src/breadcrumb.vue: -------------------------------------------------------------------------------- 1 | 6 | 35 | -------------------------------------------------------------------------------- /ElementCode/packages/button-group/index.js: -------------------------------------------------------------------------------- 1 | import ElButtonGroup from '../button/src/button-group'; 2 | 3 | /* istanbul ignore next */ 4 | ElButtonGroup.install = function(Vue) { 5 | Vue.component(ElButtonGroup.name, ElButtonGroup); 6 | }; 7 | 8 | export default ElButtonGroup; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/button/index.js: -------------------------------------------------------------------------------- 1 | import ElButton from './src/button'; 2 | 3 | // 全局注册组件 4 | ElButton.install = function(Vue) { 5 | Vue.component(ElButton.name, ElButton); 6 | }; 7 | 8 | export default ElButton; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/button/src/button-group.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /ElementCode/packages/card/index.js: -------------------------------------------------------------------------------- 1 | import Card from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Card.install = function(Vue) { 5 | Vue.component(Card.name, Card); 6 | }; 7 | 8 | export default Card; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/card/src/main.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 19 | -------------------------------------------------------------------------------- /ElementCode/packages/carousel-item/index.js: -------------------------------------------------------------------------------- 1 | import ElCarouselItem from '../carousel/src/item'; 2 | 3 | /* istanbul ignore next */ 4 | ElCarouselItem.install = function(Vue) { 5 | Vue.component(ElCarouselItem.name, ElCarouselItem); 6 | }; 7 | 8 | export default ElCarouselItem; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/carousel/_index.js: -------------------------------------------------------------------------------- 1 | import ElCarousel from './src/main'; 2 | import ElCarouselItem from './src/item'; 3 | 4 | /* istanbul ignore next */ 5 | export default function(Vue) { 6 | Vue.component(ElCarousel.name, ElCarousel); 7 | Vue.component(ElCarouselItem.name, ElCarouselItem); 8 | }; 9 | 10 | export { ElCarousel, ElCarouselItem }; 11 | -------------------------------------------------------------------------------- /ElementCode/packages/carousel/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var gen = require('../../build/gen-single-config'); 3 | 4 | cooking.set(gen(__dirname, 'ElCarousel', '_index.js')); 5 | 6 | module.exports = cooking.resolve(); 7 | -------------------------------------------------------------------------------- /ElementCode/packages/carousel/index.js: -------------------------------------------------------------------------------- 1 | import Carousel from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Carousel.install = function(Vue) { 5 | Vue.component(Carousel.name, Carousel); 6 | }; 7 | 8 | export default Carousel; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/carousel/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "element-carousel", 3 | "version": "2.0.0", 4 | "description": "A carousel component for Vue.js.", 5 | "main": "lib/index.js", 6 | "keywords": [ 7 | "element", 8 | "vue", 9 | "component" 10 | ], 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/carousel", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": { 15 | "throttle-debounce": "^1.0.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ElementCode/packages/cascader/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var path = require('path'); 3 | var config = require('../../build/config'); 4 | 5 | cooking.set({ 6 | entry: { 7 | index: path.join(__dirname, 'index.js') 8 | }, 9 | dist: path.join(__dirname, 'lib'), 10 | template: false, 11 | format: 'umd', 12 | moduleName: 'ElCascader', 13 | extends: ['vue2'], 14 | alias: config.alias, 15 | externals: { vue: config.vue } 16 | }); 17 | 18 | module.exports = cooking.resolve(); 19 | -------------------------------------------------------------------------------- /ElementCode/packages/cascader/index.js: -------------------------------------------------------------------------------- 1 | import Cascader from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Cascader.install = function(Vue) { 5 | Vue.component(Cascader.name, Cascader); 6 | }; 7 | 8 | export default Cascader; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/cascader/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "element-cascader", 3 | "version": "0.0.0", 4 | "description": "A cascader component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/cascader", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /ElementCode/packages/checkbox-button/index.js: -------------------------------------------------------------------------------- 1 | import ElCheckboxButton from '../checkbox/src/checkbox-button.vue'; 2 | 3 | /* istanbul ignore next */ 4 | ElCheckboxButton.install = function(Vue) { 5 | Vue.component(ElCheckboxButton.name, ElCheckboxButton); 6 | }; 7 | 8 | export default ElCheckboxButton; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/checkbox-group/index.js: -------------------------------------------------------------------------------- 1 | import ElCheckboxGroup from '../checkbox/src/checkbox-group.vue'; 2 | 3 | /* istanbul ignore next */ 4 | ElCheckboxGroup.install = function(Vue) { 5 | Vue.component(ElCheckboxGroup.name, ElCheckboxGroup); 6 | }; 7 | 8 | export default ElCheckboxGroup; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/checkbox/index.js: -------------------------------------------------------------------------------- 1 | import ElCheckbox from './src/checkbox'; 2 | 3 | /* istanbul ignore next */ 4 | ElCheckbox.install = function(Vue) { 5 | Vue.component(ElCheckbox.name, ElCheckbox); 6 | }; 7 | 8 | export default ElCheckbox; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/col/index.js: -------------------------------------------------------------------------------- 1 | import ElCol from './src/col'; 2 | 3 | /* istanbul ignore next */ 4 | ElCol.install = function(Vue) { 5 | Vue.component(ElCol.name, ElCol); 6 | }; 7 | 8 | export default ElCol; 9 | 10 | -------------------------------------------------------------------------------- /ElementCode/packages/collapse-item/index.js: -------------------------------------------------------------------------------- 1 | import ElCollapseItem from '../collapse/src/collapse-item.vue'; 2 | 3 | /* istanbul ignore next */ 4 | ElCollapseItem.install = function(Vue) { 5 | Vue.component(ElCollapseItem.name, ElCollapseItem); 6 | }; 7 | 8 | export default ElCollapseItem; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/collapse/index.js: -------------------------------------------------------------------------------- 1 | import ElCollapse from './src/collapse'; 2 | 3 | /* istanbul ignore next */ 4 | ElCollapse.install = function(Vue) { 5 | Vue.component(ElCollapse.name, ElCollapse); 6 | }; 7 | 8 | export default ElCollapse; 9 | 10 | -------------------------------------------------------------------------------- /ElementCode/packages/color-picker/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var gen = require('../../build/gen-single-config'); 3 | 4 | cooking.set(gen(__dirname, 'ElColorPicker')); 5 | 6 | module.exports = cooking.resolve(); 7 | -------------------------------------------------------------------------------- /ElementCode/packages/color-picker/index.js: -------------------------------------------------------------------------------- 1 | import ColorPicker from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | ColorPicker.install = function(Vue) { 5 | Vue.component(ColorPicker.name, ColorPicker); 6 | }; 7 | 8 | export default ColorPicker; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/color-picker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "element-color-picker", 3 | "version": "0.0.0", 4 | "description": "A color-picker component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/color-picker", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /ElementCode/packages/container/index.js: -------------------------------------------------------------------------------- 1 | import Container from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Container.install = function(Vue) { 5 | Vue.component(Container.name, Container); 6 | }; 7 | 8 | export default Container; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/date-picker/_index.js: -------------------------------------------------------------------------------- 1 | import DatePicker from './src/picker/date-picker'; 2 | import TimePicker from './src/picker/time-picker'; 3 | import TimeSelect from './src/picker/time-select'; 4 | 5 | /* istanbul ignore next */ 6 | export default function install(Vue) { 7 | Vue.component(DatePicker.name, DatePicker); 8 | Vue.component(TimePicker.name, TimePicker); 9 | Vue.component(TimeSelect.name, TimeSelect); 10 | }; 11 | 12 | export { DatePicker, TimePicker, TimeSelect }; 13 | -------------------------------------------------------------------------------- /ElementCode/packages/date-picker/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var gen = require('../../build/gen-single-config'); 3 | 4 | cooking.set(gen(__dirname, 'ElDatePicker', '_index.js')); 5 | 6 | module.exports = cooking.resolve(); 7 | -------------------------------------------------------------------------------- /ElementCode/packages/date-picker/index.js: -------------------------------------------------------------------------------- 1 | import DatePicker from './src/picker/date-picker'; 2 | 3 | /* istanbul ignore next */ 4 | DatePicker.install = function install(Vue) { 5 | Vue.component(DatePicker.name, DatePicker); 6 | }; 7 | 8 | export default DatePicker; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/date-picker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "element-datepicker", 3 | "version": "2.0.0", 4 | "description": "A datepicker component for Vue.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/date-picker", 12 | "author": "long.zhang@ele.me", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /ElementCode/packages/date-picker/src/picker/time-select.js: -------------------------------------------------------------------------------- 1 | import Picker from '../picker'; 2 | import Panel from '../panel/time-select'; 3 | 4 | export default { 5 | mixins: [Picker], 6 | 7 | name: 'ElTimeSelect', 8 | 9 | beforeCreate() { 10 | this.type = 'time-select'; 11 | this.panel = Panel; 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /ElementCode/packages/dialog/index.js: -------------------------------------------------------------------------------- 1 | import ElDialog from './src/component'; 2 | 3 | /* istanbul ignore next */ 4 | ElDialog.install = function(Vue) { 5 | Vue.component(ElDialog.name, ElDialog); 6 | }; 7 | 8 | export default ElDialog; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/dropdown-item/index.js: -------------------------------------------------------------------------------- 1 | import ElDropdownItem from '../dropdown/src/dropdown-item'; 2 | 3 | /* istanbul ignore next */ 4 | ElDropdownItem.install = function(Vue) { 5 | Vue.component(ElDropdownItem.name, ElDropdownItem); 6 | }; 7 | 8 | export default ElDropdownItem; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/dropdown-menu/index.js: -------------------------------------------------------------------------------- 1 | import ElDropdownMenu from '../dropdown/src/dropdown-menu'; 2 | 3 | /* istanbul ignore next */ 4 | ElDropdownMenu.install = function(Vue) { 5 | Vue.component(ElDropdownMenu.name, ElDropdownMenu); 6 | }; 7 | 8 | export default ElDropdownMenu; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/dropdown/index.js: -------------------------------------------------------------------------------- 1 | import ElDropdown from './src/dropdown'; 2 | 3 | /* istanbul ignore next */ 4 | ElDropdown.install = function(Vue) { 5 | Vue.component(ElDropdown.name, ElDropdown); 6 | }; 7 | 8 | export default ElDropdown; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/dropdown/src/dropdown-item.vue: -------------------------------------------------------------------------------- 1 | 15 | 36 | -------------------------------------------------------------------------------- /ElementCode/packages/footer/index.js: -------------------------------------------------------------------------------- 1 | import Footer from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Footer.install = function(Vue) { 5 | Vue.component(Footer.name, Footer); 6 | }; 7 | 8 | export default Footer; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/footer/src/main.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 21 | -------------------------------------------------------------------------------- /ElementCode/packages/form-item/index.js: -------------------------------------------------------------------------------- 1 | import ElFormItem from '../form/src/form-item'; 2 | 3 | /* istanbul ignore next */ 4 | ElFormItem.install = function(Vue) { 5 | Vue.component(ElFormItem.name, ElFormItem); 6 | }; 7 | 8 | export default ElFormItem; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/form/index.js: -------------------------------------------------------------------------------- 1 | import ElForm from './src/form'; 2 | 3 | /* istanbul ignore next */ 4 | ElForm.install = function(Vue) { 5 | Vue.component(ElForm.name, ElForm); 6 | }; 7 | 8 | export default ElForm; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/header/index.js: -------------------------------------------------------------------------------- 1 | import Header from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Header.install = function(Vue) { 5 | Vue.component(Header.name, Header); 6 | }; 7 | 8 | export default Header; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/header/src/main.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 21 | -------------------------------------------------------------------------------- /ElementCode/packages/icon/index.js: -------------------------------------------------------------------------------- 1 | import ElIcon from './src/icon.vue'; 2 | 3 | /* istanbul ignore next */ 4 | ElIcon.install = function(Vue) { 5 | Vue.component(ElIcon.name, ElIcon); 6 | }; 7 | 8 | export default ElIcon; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/icon/src/icon.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 14 | -------------------------------------------------------------------------------- /ElementCode/packages/input-number/index.js: -------------------------------------------------------------------------------- 1 | import ElInputNumber from './src/input-number'; 2 | 3 | /* istanbul ignore next */ 4 | ElInputNumber.install = function(Vue) { 5 | Vue.component(ElInputNumber.name, ElInputNumber); 6 | }; 7 | 8 | export default ElInputNumber; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/input/index.js: -------------------------------------------------------------------------------- 1 | import ElInput from './src/input'; 2 | 3 | /* istanbul ignore next */ 4 | ElInput.install = function(Vue) { 5 | Vue.component(ElInput.name, ElInput); 6 | }; 7 | 8 | export default ElInput; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/loading/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var gen = require('../../build/gen-single-config'); 3 | 4 | cooking.set(gen(__dirname, 'ElLoading')); 5 | 6 | module.exports = cooking.resolve(); 7 | -------------------------------------------------------------------------------- /ElementCode/packages/loading/index.js: -------------------------------------------------------------------------------- 1 | import directive from './src/directive'; 2 | import service from './src/index'; 3 | 4 | export default { 5 | install(Vue) { 6 | Vue.use(directive); 7 | Vue.prototype.$loading = service; 8 | }, 9 | directive, 10 | service 11 | }; 12 | -------------------------------------------------------------------------------- /ElementCode/packages/loading/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "element-loading", 3 | "version": "2.0.0", 4 | "description": "A loading component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/loading", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /ElementCode/packages/main/index.js: -------------------------------------------------------------------------------- 1 | import Main from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Main.install = function(Vue) { 5 | Vue.component(Main.name, Main); 6 | }; 7 | 8 | export default Main; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/main/src/main.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | -------------------------------------------------------------------------------- /ElementCode/packages/menu-item-group/index.js: -------------------------------------------------------------------------------- 1 | import ElMenuItemGroup from '../menu/src/menu-item-group'; 2 | 3 | /* istanbul ignore next */ 4 | ElMenuItemGroup.install = function(Vue) { 5 | Vue.component(ElMenuItemGroup.name, ElMenuItemGroup); 6 | }; 7 | 8 | export default ElMenuItemGroup; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/menu-item/index.js: -------------------------------------------------------------------------------- 1 | import ElMenuItem from '../menu/src/menu-item'; 2 | 3 | /* istanbul ignore next */ 4 | ElMenuItem.install = function(Vue) { 5 | Vue.component(ElMenuItem.name, ElMenuItem); 6 | }; 7 | 8 | export default ElMenuItem; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/menu/index.js: -------------------------------------------------------------------------------- 1 | import ElMenu from './src/menu'; 2 | 3 | /* istanbul ignore next */ 4 | ElMenu.install = function(Vue) { 5 | Vue.component(ElMenu.name, ElMenu); 6 | }; 7 | 8 | export default ElMenu; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/message-box/index.js: -------------------------------------------------------------------------------- 1 | import MessageBox from './src/main.js'; 2 | export default MessageBox; 3 | -------------------------------------------------------------------------------- /ElementCode/packages/message/index.js: -------------------------------------------------------------------------------- 1 | import Message from './src/main.js'; 2 | export default Message; 3 | -------------------------------------------------------------------------------- /ElementCode/packages/notification/index.js: -------------------------------------------------------------------------------- 1 | import Notification from './src/main.js'; 2 | export default Notification; 3 | -------------------------------------------------------------------------------- /ElementCode/packages/option-group/index.js: -------------------------------------------------------------------------------- 1 | import ElOptionGroup from '../select/src/option-group'; 2 | 3 | /* istanbul ignore next */ 4 | ElOptionGroup.install = function(Vue) { 5 | Vue.component(ElOptionGroup.name, ElOptionGroup); 6 | }; 7 | 8 | export default ElOptionGroup; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/option/index.js: -------------------------------------------------------------------------------- 1 | import ElOption from '../select/src/option'; 2 | 3 | /* istanbul ignore next */ 4 | ElOption.install = function(Vue) { 5 | Vue.component(ElOption.name, ElOption); 6 | }; 7 | 8 | export default ElOption; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/pagination/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var gen = require('../../build/gen-single-config'); 3 | 4 | cooking.set(gen(__dirname, 'ElPagination')); 5 | 6 | module.exports = cooking.resolve(); 7 | -------------------------------------------------------------------------------- /ElementCode/packages/pagination/index.js: -------------------------------------------------------------------------------- 1 | import Pagination from './src/pagination'; 2 | 3 | /* istanbul ignore next */ 4 | Pagination.install = function(Vue) { 5 | Vue.component(Pagination.name, Pagination); 6 | }; 7 | 8 | export default Pagination; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/pagination/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "element-pagination", 3 | "version": "2.0.0", 4 | "description": "A pagination component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/pagination", 12 | "author": "qingwei-li", 13 | "license": "MIT", 14 | "dependencies": {} 15 | } 16 | -------------------------------------------------------------------------------- /ElementCode/packages/popover/index.js: -------------------------------------------------------------------------------- 1 | import Popover from './src/main'; 2 | import directive from './src/directive'; 3 | import Vue from 'vue'; 4 | 5 | Vue.directive('popover', directive); 6 | 7 | /* istanbul ignore next */ 8 | Popover.install = function(Vue) { 9 | Vue.directive('popover', directive); 10 | Vue.component(Popover.name, Popover); 11 | }; 12 | Popover.directive = directive; 13 | 14 | export default Popover; 15 | -------------------------------------------------------------------------------- /ElementCode/packages/popover/src/directive.js: -------------------------------------------------------------------------------- 1 | export default { 2 | bind(el, binding, vnode) { 3 | // vue中 v-popover:argument 和 v-popover="variate|| expression"得到的binding数据是不同的。后者可以指向动态popver组件,可以极大的增强popover指令的灵活程度。 4 | const _ref = binding.expression ? binding.value : binding.arg; 5 | vnode.context.$refs[_ref].$refs.reference = el; 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /ElementCode/packages/progress/index.js: -------------------------------------------------------------------------------- 1 | import ElProgress from './src/progress'; 2 | 3 | /* istanbul ignore next */ 4 | ElProgress.install = function(Vue) { 5 | Vue.component(ElProgress.name, ElProgress); 6 | }; 7 | 8 | export default ElProgress; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/radio-button/index.js: -------------------------------------------------------------------------------- 1 | import RadioButton from '../radio/src/radio-button.vue'; 2 | 3 | /* istanbul ignore next */ 4 | RadioButton.install = function(Vue) { 5 | Vue.component(RadioButton.name, RadioButton); 6 | }; 7 | 8 | export default RadioButton; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/radio-group/index.js: -------------------------------------------------------------------------------- 1 | import RadioGroup from '../radio/src/radio-group.vue'; 2 | 3 | /* istanbul ignore next */ 4 | RadioGroup.install = function(Vue) { 5 | Vue.component(RadioGroup.name, RadioGroup); 6 | }; 7 | 8 | export default RadioGroup; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/radio/index.js: -------------------------------------------------------------------------------- 1 | import Radio from './src/radio'; 2 | 3 | /* istanbul ignore next */ 4 | Radio.install = function(Vue) { 5 | Vue.component('el-radio', Radio); 6 | }; 7 | 8 | export default Radio; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/rate/index.js: -------------------------------------------------------------------------------- 1 | import Rate from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Rate.install = function(Vue) { 5 | Vue.component(Rate.name, Rate); 6 | }; 7 | 8 | export default Rate; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/row/index.js: -------------------------------------------------------------------------------- 1 | import Row from './src/row'; 2 | 3 | /* istanbul ignore next */ 4 | Row.install = function(Vue) { 5 | Vue.component(Row.name, Row); 6 | }; 7 | 8 | export default Row; 9 | 10 | -------------------------------------------------------------------------------- /ElementCode/packages/scrollbar/index.js: -------------------------------------------------------------------------------- 1 | import Scrollbar from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Scrollbar.install = function(Vue) { 5 | Vue.component(Scrollbar.name, Scrollbar); 6 | }; 7 | 8 | export default Scrollbar; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/scrollbar/src/util.js: -------------------------------------------------------------------------------- 1 | export const BAR_MAP = { 2 | vertical: { 3 | offset: 'offsetHeight', 4 | scroll: 'scrollTop', 5 | scrollSize: 'scrollHeight', 6 | size: 'height', 7 | key: 'vertical', 8 | axis: 'Y', 9 | client: 'clientY', 10 | direction: 'top' 11 | }, 12 | horizontal: { 13 | offset: 'offsetWidth', 14 | scroll: 'scrollLeft', 15 | scrollSize: 'scrollWidth', 16 | size: 'width', 17 | key: 'horizontal', 18 | axis: 'X', 19 | client: 'clientX', 20 | direction: 'left' 21 | } 22 | }; 23 | 24 | export function renderThumbStyle({ move, size, bar }) { 25 | const style = {}; 26 | const translate = `translate${bar.axis}(${ move }%)`; 27 | 28 | style[bar.size] = size; 29 | style.transform = translate; 30 | style.msTransform = translate; 31 | style.webkitTransform = translate; 32 | 33 | return style; 34 | }; 35 | -------------------------------------------------------------------------------- /ElementCode/packages/select/index.js: -------------------------------------------------------------------------------- 1 | import Select from './src/select'; 2 | 3 | /* istanbul ignore next */ 4 | Select.install = function(Vue) { 5 | Vue.component(Select.name, Select); 6 | }; 7 | 8 | export default Select; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/slider/index.js: -------------------------------------------------------------------------------- 1 | import Slider from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Slider.install = function(Vue) { 5 | Vue.component(Slider.name, Slider); 6 | }; 7 | 8 | export default Slider; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/spinner/index.js: -------------------------------------------------------------------------------- 1 | import Spinner from './src/spinner'; 2 | 3 | /* istanbul ignore next */ 4 | Spinner.install = function(Vue) { 5 | Vue.component(Spinner.name, Spinner); 6 | }; 7 | 8 | export default Spinner; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/spinner/src/spinner.vue: -------------------------------------------------------------------------------- 1 | 8 | 28 | -------------------------------------------------------------------------------- /ElementCode/packages/step/index.js: -------------------------------------------------------------------------------- 1 | import Step from '../steps/src/step'; 2 | 3 | /* istanbul ignore next */ 4 | Step.install = function(Vue) { 5 | Vue.component(Step.name, Step); 6 | }; 7 | 8 | export default Step; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/steps/index.js: -------------------------------------------------------------------------------- 1 | import Steps from './src/steps'; 2 | 3 | /* istanbul ignore next */ 4 | Steps.install = function(Vue) { 5 | Vue.component(Steps.name, Steps); 6 | }; 7 | 8 | export default Steps; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/submenu/index.js: -------------------------------------------------------------------------------- 1 | import ElSubmenu from '../menu/src/submenu'; 2 | 3 | /* istanbul ignore next */ 4 | ElSubmenu.install = function(Vue) { 5 | Vue.component(ElSubmenu.name, ElSubmenu); 6 | }; 7 | 8 | export default ElSubmenu; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/switch/index.js: -------------------------------------------------------------------------------- 1 | import Switch from './src/component'; 2 | 3 | /* istanbul ignore next */ 4 | Switch.install = function(Vue) { 5 | Vue.component(Switch.name, Switch); 6 | }; 7 | 8 | export default Switch; 9 | 10 | -------------------------------------------------------------------------------- /ElementCode/packages/tab-pane/index.js: -------------------------------------------------------------------------------- 1 | import TabPane from '../tabs/src/tab-pane.vue'; 2 | 3 | /* istanbul ignore next */ 4 | TabPane.install = function(Vue) { 5 | Vue.component(TabPane.name, TabPane); 6 | }; 7 | 8 | export default TabPane; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/table-column/index.js: -------------------------------------------------------------------------------- 1 | import ElTableColumn from '../table/src/table-column'; 2 | 3 | /* istanbul ignore next */ 4 | ElTableColumn.install = function(Vue) { 5 | Vue.component(ElTableColumn.name, ElTableColumn); 6 | }; 7 | 8 | export default ElTableColumn; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/table/_index.js: -------------------------------------------------------------------------------- 1 | import ElTableColumn from './src/table-column'; 2 | import ElTable from './src/table'; 3 | 4 | /* istanbul ignore next */ 5 | export default function(Vue) { 6 | Vue.component(ElTable.name, ElTable); 7 | Vue.component(ElTableColumn.name, ElTableColumn); 8 | }; 9 | 10 | export { ElTable, ElTableColumn }; 11 | -------------------------------------------------------------------------------- /ElementCode/packages/table/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var gen = require('../../build/gen-single-config'); 3 | 4 | cooking.set(gen(__dirname, 'ElTable', '_index.js')); 5 | 6 | module.exports = cooking.resolve(); 7 | -------------------------------------------------------------------------------- /ElementCode/packages/table/index.js: -------------------------------------------------------------------------------- 1 | import ElTable from './src/table'; 2 | 3 | /* istanbul ignore next */ 4 | ElTable.install = function(Vue) { 5 | Vue.component(ElTable.name, ElTable); 6 | }; 7 | 8 | export default ElTable; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/table/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "element-table", 3 | "version": "2.0.0", 4 | "description": "A table component for Vue.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/table", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": { 15 | "throttle-debounce": "^1.0.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ElementCode/packages/table/src/dropdown.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | var dropdowns = []; 3 | 4 | !Vue.prototype.$isServer && document.addEventListener('click', function(event) { 5 | dropdowns.forEach(function(dropdown) { 6 | var target = event.target; 7 | if (!dropdown || !dropdown.$el) return; 8 | if (target === dropdown.$el || dropdown.$el.contains(target)) { 9 | return; 10 | } 11 | dropdown.handleOutsideClick && dropdown.handleOutsideClick(event); 12 | }); 13 | }); 14 | 15 | export default { 16 | open(instance) { 17 | if (instance) { 18 | dropdowns.push(instance); 19 | } 20 | }, 21 | 22 | close(instance) { 23 | var index = dropdowns.indexOf(instance); 24 | if (index !== -1) { 25 | dropdowns.splice(instance, 1); 26 | } 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /ElementCode/packages/tabs/index.js: -------------------------------------------------------------------------------- 1 | import ElTabs from './src/tabs'; 2 | 3 | /* istanbul ignore next */ 4 | ElTabs.install = function(Vue) { 5 | Vue.component(ElTabs.name, ElTabs); 6 | }; 7 | 8 | export default ElTabs; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/tag/index.js: -------------------------------------------------------------------------------- 1 | import ElTag from './src/tag'; 2 | 3 | /* istanbul ignore next */ 4 | ElTag.install = function(Vue) { 5 | Vue.component(ElTag.name, ElTag); 6 | }; 7 | 8 | export default ElTag; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib 3 | npm-debug* 4 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/README.md: -------------------------------------------------------------------------------- 1 | # element-theme-chalk 2 | > element component chalk theme. 3 | 4 | 5 | ## Installation 6 | ```shell 7 | npm i element-theme-chalk -S 8 | ``` 9 | 10 | ## Usage 11 | 12 | Use Sass import 13 | ```css 14 | @import 'element-theme-chalk'; 15 | ``` 16 | 17 | Or Use webpack 18 | ```javascript 19 | import 'element-theme-chalk'; 20 | ``` 21 | 22 | Or 23 | ```html 24 | 25 | ``` 26 | 27 | ## Import on demand 28 | ```javascript 29 | import 'element-theme-chalk/lib/input.css'; 30 | import 'element-theme-chalk/lib/select.css'; 31 | 32 | // ... 33 | ``` 34 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var sass = require('gulp-sass'); 5 | var autoprefixer = require('gulp-autoprefixer'); 6 | var cssmin = require('gulp-cssmin'); 7 | 8 | gulp.task('compile', function() { 9 | return gulp.src('./src/*.scss') 10 | .pipe(sass.sync()) 11 | .pipe(autoprefixer({ 12 | browsers: ['ie > 9', 'last 2 versions'], 13 | cascade: false 14 | })) 15 | .pipe(cssmin()) 16 | .pipe(gulp.dest('./lib')); 17 | }); 18 | 19 | gulp.task('copyfont', function() { 20 | return gulp.src('./src/fonts/**') 21 | .pipe(cssmin()) 22 | .pipe(gulp.dest('./lib/fonts')); 23 | }); 24 | 25 | gulp.task('build', ['compile', 'copyfont']); 26 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/aside.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/mixins"; 2 | 3 | @include b(aside) { 4 | overflow: auto; 5 | box-sizing: border-box; 6 | flex-shrink: 0; 7 | } 8 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/base.scss: -------------------------------------------------------------------------------- 1 | @import "common/transition.scss"; 2 | @import "icon.scss"; 3 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/breadcrumb-item.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/ElementCode/packages/theme-chalk/src/breadcrumb-item.scss -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/button-group.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/ElementCode/packages/theme-chalk/src/button-group.scss -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/card.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/mixins"; 2 | @import "common/var"; 3 | 4 | @include b(card) { 5 | border-radius: $--card-border-radius; 6 | border: 1px solid $--card-border-color; 7 | background-color: $--color-white; 8 | overflow: hidden; 9 | box-shadow: $--box-shadow-light; 10 | color: $--color-text-primary; 11 | 12 | @include e(header) { 13 | padding: #{$--card-padding - 2 $--card-padding}; 14 | border-bottom: 1px solid $--card-border-color; 15 | box-sizing: border-box; 16 | } 17 | 18 | @include e(body) { 19 | padding: $--card-padding; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/checkbox-button.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/ElementCode/packages/theme-chalk/src/checkbox-button.scss -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/checkbox-group.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/ElementCode/packages/theme-chalk/src/checkbox-group.scss -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/collapse-item.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/ElementCode/packages/theme-chalk/src/collapse-item.scss -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/common/popup.scss: -------------------------------------------------------------------------------- 1 | .v-modal-enter { 2 | animation: v-modal-in .2s ease; 3 | } 4 | 5 | .v-modal-leave { 6 | animation: v-modal-out .2s ease forwards; 7 | } 8 | 9 | @keyframes v-modal-in { 10 | 0% { 11 | opacity: 0; 12 | } 13 | 100% { 14 | } 15 | } 16 | 17 | @keyframes v-modal-out { 18 | 0% { 19 | } 20 | 100% { 21 | opacity: 0; 22 | } 23 | } 24 | 25 | .v-modal { 26 | position: fixed; 27 | left: 0; 28 | top: 0; 29 | width: 100%; 30 | height: 100%; 31 | opacity: 0.5; 32 | background: #000; 33 | } 34 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/container.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/mixins"; 2 | 3 | @include b(container) { 4 | display: flex; 5 | flex-direction: row; 6 | flex: 1; 7 | flex-basis: auto; 8 | box-sizing: border-box; 9 | min-width: 0; 10 | 11 | @include when(vertical) { 12 | flex-direction: column; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/date-picker.scss: -------------------------------------------------------------------------------- 1 | @import "./date-picker/date-table.scss"; 2 | @import "./date-picker/month-table.scss"; 3 | @import "./date-picker/year-table.scss"; 4 | @import "./date-picker/time-spinner.scss"; 5 | @import "./date-picker/picker.scss"; 6 | @import "./date-picker/date-picker.scss"; 7 | @import "./date-picker/date-range-picker.scss"; 8 | @import "./date-picker/time-range-picker.scss"; 9 | @import "./date-picker/time-picker.scss"; 10 | @import "./input.scss"; 11 | @import "./scrollbar.scss"; 12 | @import "./popper"; -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/date-picker/time-range-picker.scss: -------------------------------------------------------------------------------- 1 | @import "../common/var"; 2 | 3 | @include b(time-range-picker) { 4 | width: 354px; 5 | overflow: visible; 6 | 7 | @include e(content) { 8 | position: relative; 9 | text-align: center; 10 | padding: 10px; 11 | } 12 | 13 | @include e(cell) { 14 | box-sizing: border-box; 15 | margin: 0; 16 | padding: 4px 7px 7px; 17 | width: 50%; 18 | display: inline-block; 19 | } 20 | 21 | @include e(header) { 22 | margin-bottom: 5px; 23 | text-align: center; 24 | font-size: 14px; 25 | } 26 | 27 | @include e(body) { 28 | border-radius:2px; 29 | border: 1px solid $--datepicker-border-color; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/display.scss: -------------------------------------------------------------------------------- 1 | @import "common/var"; 2 | @import "mixins/mixins"; 3 | 4 | .hidden { 5 | @each $break-point-name, $value in $--breakpoints-spec { 6 | &-#{$break-point-name} { 7 | @include res($break-point-name, $--breakpoints-spec) { 8 | display: none !important; 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/dropdown-item.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/ElementCode/packages/theme-chalk/src/dropdown-item.scss -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/dropdown-menu.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/ElementCode/packages/theme-chalk/src/dropdown-menu.scss -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/ElementCode/packages/theme-chalk/src/fonts/element-icons.ttf -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/ElementCode/packages/theme-chalk/src/fonts/element-icons.woff -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/footer.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/mixins"; 2 | @import "common/var"; 3 | 4 | @include b(footer) { 5 | padding: $--footer-padding; 6 | box-sizing: border-box; 7 | flex-shrink: 0; 8 | } 9 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/form-item.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/ElementCode/packages/theme-chalk/src/form-item.scss -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/header.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/mixins"; 2 | @import "common/var"; 3 | 4 | @include b(header) { 5 | padding: $--header-padding; 6 | box-sizing: border-box; 7 | flex-shrink: 0; 8 | } 9 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/main.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/mixins"; 2 | @import "common/var"; 3 | 4 | @include b(main) { 5 | flex: 1; 6 | flex-basis: auto; 7 | overflow: auto; 8 | box-sizing: border-box; 9 | padding: $--main-padding; 10 | } 11 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/menu-item-group.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/ElementCode/packages/theme-chalk/src/menu-item-group.scss -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/menu-item.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/ElementCode/packages/theme-chalk/src/menu-item.scss -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/mixins/config.scss: -------------------------------------------------------------------------------- 1 | $namespace: 'el'; 2 | $element-separator: '__'; 3 | $modifier-separator: '--'; 4 | $state-prefix: 'is-'; 5 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/mixins/utils.scss: -------------------------------------------------------------------------------- 1 | @mixin utils-user-select($value) { 2 | -moz-user-select: $value; 3 | -webkit-user-select: $value; 4 | -ms-user-select: $value; 5 | } 6 | 7 | @mixin utils-clearfix { 8 | $selector: &; 9 | 10 | @at-root { 11 | #{$selector}::before, 12 | #{$selector}::after { 13 | display: table; 14 | content: ""; 15 | } 16 | #{$selector}::after { 17 | clear: both 18 | } 19 | } 20 | } 21 | 22 | @mixin utils-vertical-center { 23 | $selector: &; 24 | 25 | @at-root { 26 | #{$selector}::after { 27 | display: inline-block; 28 | content: ""; 29 | height: 100%; 30 | vertical-align: middle 31 | } 32 | } 33 | } 34 | 35 | @mixin utils-ellipsis { 36 | overflow: hidden; 37 | text-overflow: ellipsis; 38 | white-space: nowrap; 39 | } -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/radio-group.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/mixins"; 2 | @import "common/var"; 3 | 4 | @include b(radio-group) { 5 | display: inline-block; 6 | line-height: 1; 7 | vertical-align: middle; 8 | font-size: 0; 9 | } 10 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/steps.scss: -------------------------------------------------------------------------------- 1 | @import "mixins/mixins"; 2 | 3 | @include b(steps) { 4 | display: flex; 5 | 6 | @include m(simple) { 7 | padding: 13px 8%; 8 | border-radius: 4px; 9 | background: $--background-color-base; 10 | } 11 | 12 | @include m(horizontal) { 13 | white-space: nowrap; 14 | } 15 | 16 | @include m(vertical) { 17 | height: 100%; 18 | flex-flow: column; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/submenu.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/ElementCode/packages/theme-chalk/src/submenu.scss -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/tab-pane.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/ElementCode/packages/theme-chalk/src/tab-pane.scss -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/time-picker.scss: -------------------------------------------------------------------------------- 1 | @import "./date-picker/picker.scss"; 2 | @import "./date-picker/time-spinner.scss"; 3 | @import "./date-picker/time-picker.scss"; 4 | @import "./input.scss"; 5 | @import "./scrollbar.scss"; 6 | @import "./popper"; 7 | -------------------------------------------------------------------------------- /ElementCode/packages/theme-chalk/src/time-select.scss: -------------------------------------------------------------------------------- 1 | @import "common/var"; 2 | @import "./date-picker/picker.scss"; 3 | @import "./date-picker/date-picker.scss"; 4 | @import "./scrollbar.scss"; 5 | @import "./popper"; 6 | 7 | .time-select { 8 | margin: 5px 0; 9 | min-width: 0; 10 | } 11 | 12 | .time-select .el-picker-panel__content { 13 | max-height: 200px; 14 | margin: 0; 15 | } 16 | 17 | .time-select-item { 18 | padding: 8px 10px; 19 | font-size: 14px; 20 | line-height: 20px; 21 | } 22 | 23 | .time-select-item.selected:not(.disabled) { 24 | color: $--color-primary; 25 | font-weight: bold; 26 | } 27 | 28 | .time-select-item.disabled { 29 | color: $--datepicker-border-color; 30 | cursor: not-allowed; 31 | } 32 | 33 | .time-select-item:hover { 34 | background-color: $--background-color-base; 35 | font-weight: bold; 36 | cursor: pointer; 37 | } 38 | -------------------------------------------------------------------------------- /ElementCode/packages/time-picker/index.js: -------------------------------------------------------------------------------- 1 | import TimePicker from '../date-picker/src/picker/time-picker'; 2 | 3 | /* istanbul ignore next */ 4 | TimePicker.install = function(Vue) { 5 | Vue.component(TimePicker.name, TimePicker); 6 | }; 7 | 8 | export default TimePicker; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/time-select/index.js: -------------------------------------------------------------------------------- 1 | import TimeSelect from '../date-picker/src/picker/time-select'; 2 | 3 | /* istanbul ignore next */ 4 | TimeSelect.install = function(Vue) { 5 | Vue.component(TimeSelect.name, TimeSelect); 6 | }; 7 | 8 | export default TimeSelect; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/tooltip/index.js: -------------------------------------------------------------------------------- 1 | import Tooltip from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Tooltip.install = function(Vue) { 5 | Vue.component(Tooltip.name, Tooltip); 6 | }; 7 | 8 | export default Tooltip; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/transfer/index.js: -------------------------------------------------------------------------------- 1 | import Transfer from './src/main'; 2 | 3 | /* istanbul ignore next */ 4 | Transfer.install = function(Vue) { 5 | Vue.component(Transfer.name, Transfer); 6 | }; 7 | 8 | export default Transfer; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/tree/index.js: -------------------------------------------------------------------------------- 1 | import Tree from './src/tree.vue'; 2 | 3 | /* istanbul ignore next */ 4 | Tree.install = function(Vue) { 5 | Vue.component(Tree.name, Tree); 6 | }; 7 | 8 | export default Tree; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/tree/src/model/util.js: -------------------------------------------------------------------------------- 1 | export const NODE_KEY = '$treeNodeId'; 2 | 3 | export const markNodeData = function(node, data) { 4 | if (data[NODE_KEY]) return; 5 | Object.defineProperty(data, NODE_KEY, { 6 | value: node.id, 7 | enumerable: false, 8 | configurable: false, 9 | writable: false 10 | }); 11 | }; 12 | 13 | export const getNodeKey = function(key, data) { 14 | if (!key) return data[NODE_KEY]; 15 | return data[key]; 16 | }; 17 | -------------------------------------------------------------------------------- /ElementCode/packages/upload/cooking.conf.js: -------------------------------------------------------------------------------- 1 | var cooking = require('cooking'); 2 | var gen = require('../../build/gen-single-config'); 3 | 4 | cooking.set(gen(__dirname, 'ElUpload')); 5 | 6 | module.exports = cooking.resolve(); 7 | -------------------------------------------------------------------------------- /ElementCode/packages/upload/index.js: -------------------------------------------------------------------------------- 1 | import Upload from './src'; 2 | 3 | /* istanbul ignore next */ 4 | Upload.install = function(Vue) { 5 | Vue.component(Upload.name, Upload); 6 | }; 7 | 8 | export default Upload; 9 | -------------------------------------------------------------------------------- /ElementCode/packages/upload/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "element-upload", 3 | "version": "2.0.0", 4 | "description": "A upload component for Vue.js.", 5 | "keywords": [ 6 | "element", 7 | "vue", 8 | "component" 9 | ], 10 | "main": "./lib/index.js", 11 | "repository": "https://github.com/ElemeFE/element/tree/master/packages/upload", 12 | "author": "elemefe", 13 | "license": "MIT", 14 | "dependencies": {}, 15 | "devDependencies": {} 16 | } 17 | -------------------------------------------------------------------------------- /ElementCode/src/directives/mousewheel.js: -------------------------------------------------------------------------------- 1 | import normalizeWheel from 'normalize-wheel'; 2 | 3 | const isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1; 4 | 5 | const mousewheel = function(element, callback) { 6 | if (element && element.addEventListener) { 7 | element.addEventListener(isFirefox ? 'DOMMouseScroll' : 'mousewheel', function(event) { 8 | const normalized = normalizeWheel(event); 9 | callback && callback.apply(this, [event, normalized]); 10 | }); 11 | } 12 | }; 13 | 14 | export default { 15 | bind(el, binding) { 16 | mousewheel(el, binding.value); 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /ElementCode/src/directives/repeat-click.js: -------------------------------------------------------------------------------- 1 | import { once, on } from 'element-ui/src/utils/dom'; 2 | // on 添加监听事件 3 | // once 监听一次事件 4 | 5 | export default { 6 | bind(el, binding, vnode) { 7 | let interval = null; 8 | let startTime; 9 | // 执行表达式方法 10 | const handler = () => vnode.context[binding.expression].apply(); 11 | // 清除interval 12 | const clear = () => { 13 | if (new Date() - startTime < 100) { 14 | handler(); 15 | } 16 | clearInterval(interval); 17 | interval = null; 18 | }; 19 | 20 | // 监听 mousedown 鼠标点击事件 21 | on(el, 'mousedown', (e) => { 22 | if (e.button !== 0) return; 23 | startTime = new Date(); 24 | once(document, 'mouseup', clear); 25 | clearInterval(interval); 26 | // setInterval() 方法可按照指定的周期(以毫秒计)来调用函数或计算表达式。 27 | interval = setInterval(handler, 100); 28 | }); 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /ElementCode/src/mixins/focus.js: -------------------------------------------------------------------------------- 1 | export default function(ref) { 2 | return { 3 | methods: { 4 | focus() { 5 | this.$refs[ref].focus(); 6 | } 7 | } 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /ElementCode/src/mixins/locale.js: -------------------------------------------------------------------------------- 1 | import { t } from 'element-ui/src/locale'; 2 | 3 | export default { 4 | methods: { 5 | t(...args) { 6 | return t.apply(this, args); 7 | } 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /ElementCode/src/utils/menu/aria-menubar.js: -------------------------------------------------------------------------------- 1 | import MenuItem from './aria-menuitem'; 2 | 3 | const Menu = function(domNode) { 4 | this.domNode = domNode; 5 | this.init(); 6 | }; 7 | 8 | Menu.prototype.init = function() { 9 | let menuChildren = this.domNode.childNodes; 10 | [].filter.call(menuChildren, child => child.nodeType === 1).forEach(child => { 11 | new MenuItem(child); // eslint-disable-line 12 | }); 13 | }; 14 | export default Menu; 15 | -------------------------------------------------------------------------------- /ElementCode/src/utils/merge.js: -------------------------------------------------------------------------------- 1 | export default function(target) { 2 | for (let i = 1, j = arguments.length; i < j; i++) { 3 | let source = arguments[i] || {}; 4 | for (let prop in source) { 5 | if (source.hasOwnProperty(prop)) { 6 | let value = source[prop]; 7 | if (value !== undefined) { 8 | target[prop] = value; 9 | } 10 | } 11 | } 12 | } 13 | 14 | return target; 15 | }; 16 | -------------------------------------------------------------------------------- /ElementCode/src/utils/scroll-into-view.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | 3 | export default function scrollIntoView(container, selected) { 4 | if (Vue.prototype.$isServer) return; 5 | 6 | if (!selected) { 7 | container.scrollTop = 0; 8 | return; 9 | } 10 | 11 | const top = selected.offsetTop; 12 | const bottom = selected.offsetTop + selected.offsetHeight; 13 | const viewRectTop = container.scrollTop; 14 | const viewRectBottom = viewRectTop + container.clientHeight; 15 | 16 | if (top < viewRectTop) { 17 | container.scrollTop = top; 18 | } else if (bottom > viewRectBottom) { 19 | container.scrollTop = bottom - container.clientHeight; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ElementCode/src/utils/shared.js: -------------------------------------------------------------------------------- 1 | export function isDef(val) { 2 | return val !== undefined && val !== null; 3 | } 4 | -------------------------------------------------------------------------------- /ElementCode/src/utils/vdom.js: -------------------------------------------------------------------------------- 1 | import { hasOwn } from 'element-ui/src/utils/util'; 2 | 3 | export function isVNode(node) { 4 | return node !== null && typeof node === 'object' && hasOwn(node, 'componentOptions'); 5 | }; 6 | 7 | export function getFirstComponentChild(children) { 8 | return children && children.filter(c => c && c.tag)[0]; 9 | }; 10 | -------------------------------------------------------------------------------- /ElementCode/test/unit/index.js: -------------------------------------------------------------------------------- 1 | // Polyfill fn.bind() for PhantomJS 2 | /* eslint-disable no-extend-native */ 3 | Function.prototype.bind = require('function-bind'); 4 | require('packages/theme-chalk/lib/index.css'); 5 | 6 | // require all test files (files that ends with .spec.js) 7 | const testsContext = require.context('./specs', true, /\.spec$/); 8 | testsContext.keys().forEach(testsContext); 9 | 10 | // require all src files except main.js for coverage. 11 | // you can also change this to match only the subset of files that 12 | // you want coverage for. 13 | const srcContext = require.context('../../src', true, /^\.\/(?!main(\.js)?$)/); 14 | srcContext.keys().forEach(srcContext); 15 | -------------------------------------------------------------------------------- /ElementCode/test/unit/specs/breadcrumb.spec.js: -------------------------------------------------------------------------------- 1 | import { createVue, destroyVM } from '../util'; 2 | 3 | describe('Breadcrumb', () => { 4 | let vm; 5 | afterEach(() => { 6 | destroyVM(vm); 7 | }); 8 | 9 | it('create', done => { 10 | vm = createVue(` 11 | 12 | 首页 13 | 活动管理 14 | 活动列表 15 | 活动详情 16 | 17 | `); 18 | vm.$nextTick(_ => { 19 | expect(vm.$el.querySelector('.el-breadcrumb__separator').innerText).to.equal('>'); 20 | done(); 21 | }); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /ElementCode/types.md: -------------------------------------------------------------------------------- 1 | # 关于 element 中的 types 文件夹 2 | 3 | 饿了么大前端负责人:这是网上的一个 PR,为组件都添加了 ts,其实项目中是没有用到的。 -------------------------------------------------------------------------------- /NuxtDemo/.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_size = 2 6 | indent_style = space 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /NuxtDemo/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | browser: true, 5 | node: true 6 | }, 7 | parserOptions: { 8 | parser: 'babel-eslint' 9 | }, 10 | extends: [ 11 | // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention 12 | // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. 13 | 'plugin:vue/essential', 14 | ], 15 | // required to lint *.vue files 16 | plugins: [ 17 | 'vue' 18 | ], 19 | // add your custom rules here 20 | rules: {} 21 | } 22 | -------------------------------------------------------------------------------- /NuxtDemo/.gitignore: -------------------------------------------------------------------------------- 1 | # dependencies 2 | node_modules 3 | 4 | # logs 5 | npm-debug.log 6 | 7 | # Nuxt build 8 | .nuxt 9 | 10 | # Nuxt generate 11 | dist 12 | -------------------------------------------------------------------------------- /NuxtDemo/README.md: -------------------------------------------------------------------------------- 1 | # nuxt demo 2 | 3 | > 本项目为nuxt demo项目,演示了nuxt的简单使用方法。 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | $ npm install # Or yarn install 10 | 11 | # serve with hot reload at localhost:3000 12 | $ npm run dev 13 | 14 | # build for production and launch server 15 | $ npm run build 16 | $ npm start 17 | 18 | # generate static project 19 | $ npm run generate 20 | ``` 21 | 22 | ## 文章地址 23 | 24 | [Vue.js学习系列七 —— Vue服务器渲染Nuxt学习](https://www.jianshu.com/p/ba7466d7101a) -------------------------------------------------------------------------------- /NuxtDemo/assets/README.md: -------------------------------------------------------------------------------- 1 | # ASSETS 2 | 3 | This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. 4 | 5 | More information about the usage of this directory in the documentation: 6 | https://nuxtjs.org/guide/assets#webpacked 7 | 8 | **This directory is not required, you can delete it if you don't want to use it.** 9 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/HELP-US-OUT.txt: -------------------------------------------------------------------------------- 1 | I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project, 2 | Fort Awesome (https://fortawesome.com). It makes it easy to put the perfect icons on your website. Choose from our awesome, 3 | comprehensive icon sets or copy and paste your own. 4 | 5 | Please. Check it out. 6 | 7 | -Dave Gandy 8 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/NuxtDemo/assets/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/NuxtDemo/assets/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/NuxtDemo/assets/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/NuxtDemo/assets/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/NuxtDemo/assets/font-awesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/less/animated.less: -------------------------------------------------------------------------------- 1 | // Animated Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .@{fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .@{fa-css-prefix}-pull-left { float: left; } 11 | .@{fa-css-prefix}-pull-right { float: right; } 12 | 13 | .@{fa-css-prefix} { 14 | &.@{fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.@{fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .@{fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "animated.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | @import "screen-reader.less"; 19 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), 9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/less/screen-reader.less: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { .sr-only(); } 5 | .sr-only-focusable { .sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/scss/_animated.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .#{$fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .#{$fa-css-prefix}-pull-left { float: left; } 11 | .#{$fa-css-prefix}-pull-right { float: right; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .#{$fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), 9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .#{$fa-css-prefix}-rotate-90, 15 | :root .#{$fa-css-prefix}-rotate-180, 16 | :root .#{$fa-css-prefix}-rotate-270, 17 | :root .#{$fa-css-prefix}-flip-horizontal, 18 | :root .#{$fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/scss/_screen-reader.scss: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { @include sr-only(); } 5 | .sr-only-focusable { @include sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /NuxtDemo/assets/font-awesome/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "animated"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | @import "screen-reader"; 19 | -------------------------------------------------------------------------------- /NuxtDemo/components/Avatar.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | -------------------------------------------------------------------------------- /NuxtDemo/components/README.md: -------------------------------------------------------------------------------- 1 | # COMPONENTS 2 | 3 | The components directory contains your Vue.js Components. 4 | Nuxt.js doesn't supercharge these components. 5 | 6 | **This directory is not required, you can delete it if you don't want to use it.** 7 | -------------------------------------------------------------------------------- /NuxtDemo/layouts/README.md: -------------------------------------------------------------------------------- 1 | # LAYOUTS 2 | 3 | This directory contains your Application Layouts. 4 | 5 | More information about the usage of this directory in the documentation: 6 | https://nuxtjs.org/guide/views#layouts 7 | 8 | **This directory is not required, you can delete it if you don't want to use it.** 9 | -------------------------------------------------------------------------------- /NuxtDemo/layouts/page.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | -------------------------------------------------------------------------------- /NuxtDemo/middleware/README.md: -------------------------------------------------------------------------------- 1 | # MIDDLEWARE 2 | 3 | This directory contains your Application Middleware. 4 | The middleware lets you define custom function to be ran before rendering a page or a group of pages (layouts). 5 | 6 | More information about the usage of this directory in the documentation: 7 | https://nuxtjs.org/guide/routing#middleware 8 | 9 | **This directory is not required, you can delete it if you don't want to use it.** 10 | -------------------------------------------------------------------------------- /NuxtDemo/middleware/add.js: -------------------------------------------------------------------------------- 1 | export default function ({ store }) { 2 | store.commit('increment') 3 | } -------------------------------------------------------------------------------- /NuxtDemo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nuxts", 3 | "version": "1.0.0", 4 | "description": "Nuxt.js project", 5 | "author": "violetjack <475966597@qq.com>", 6 | "private": true, 7 | "scripts": { 8 | "dev": "nuxt", 9 | "build": "nuxt build", 10 | "start": "nuxt start", 11 | "generate": "nuxt generate", 12 | "lint": "eslint --ext .js,.vue --ignore-path .gitignore .", 13 | "precommit": "npm run lint" 14 | }, 15 | "dependencies": { 16 | "mint-ui": "^2.2.13", 17 | "nuxt": "^1.0.0" 18 | }, 19 | "devDependencies": { 20 | "babel-eslint": "^8.2.1", 21 | "eslint": "^4.15.0", 22 | "eslint-friendly-formatter": "^3.0.0", 23 | "eslint-loader": "^1.7.1", 24 | "eslint-plugin-vue": "^4.0.0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /NuxtDemo/pages/README.md: -------------------------------------------------------------------------------- 1 | # PAGES 2 | 3 | This directory contains your Application Views and Routes. 4 | The framework reads all the .vue files inside this directory and creates the router of your application. 5 | 6 | More information about the usage of this directory in the documentation: 7 | https://nuxtjs.org/guide/routing 8 | -------------------------------------------------------------------------------- /NuxtDemo/pages/state.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 20 | -------------------------------------------------------------------------------- /NuxtDemo/pages/user/_id.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /NuxtDemo/pages/user/about.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /NuxtDemo/pages/user/index.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /NuxtDemo/pages/user/sign.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /NuxtDemo/plugins/README.md: -------------------------------------------------------------------------------- 1 | # PLUGINS 2 | 3 | This directory contains your Javascript plugins that you want to run before instantiating the root vue.js application. 4 | 5 | More information about the usage of this directory in the documentation: 6 | https://nuxtjs.org/guide/plugins 7 | 8 | **This directory is not required, you can delete it if you don't want to use it.** 9 | -------------------------------------------------------------------------------- /NuxtDemo/plugins/mint-ui.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import MintUI from 'mint-ui' 3 | import 'mint-ui/lib/style.css' 4 | 5 | Vue.use(MintUI) -------------------------------------------------------------------------------- /NuxtDemo/static/README.md: -------------------------------------------------------------------------------- 1 | # STATIC 2 | 3 | This directory contains your static files. 4 | Each file inside this directory is mapped to /. 5 | 6 | Example: /static/robots.txt is mapped as /robots.txt. 7 | 8 | More information about the usage of this directory in the documentation: 9 | https://nuxtjs.org/guide/assets#static 10 | 11 | **This directory is not required, you can delete it if you don't want to use it.** 12 | -------------------------------------------------------------------------------- /NuxtDemo/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/NuxtDemo/static/favicon.ico -------------------------------------------------------------------------------- /NuxtDemo/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/NuxtDemo/static/logo.png -------------------------------------------------------------------------------- /NuxtDemo/store/README.md: -------------------------------------------------------------------------------- 1 | # STORE 2 | 3 | This directory contains your Vuex Store files. 4 | Vuex Store option is implemented in the Nuxt.js framework. 5 | Creating a index.js file in this directory activate the option in the framework automatically. 6 | 7 | More information about the usage of this directory in the documentation: 8 | https://nuxtjs.org/guide/vuex-store 9 | 10 | **This directory is not required, you can delete it if you don't want to use it.** 11 | -------------------------------------------------------------------------------- /NuxtDemo/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | Vue.use(Vuex) 5 | 6 | const store = () => new Vuex.Store({ 7 | 8 | state: { 9 | counter: 0 10 | }, 11 | mutations: { 12 | increment (state) { 13 | state.counter++ 14 | } 15 | } 16 | }) 17 | 18 | export default store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vue.js学习系列项目源码 2 | 3 | 作者在学习过程中写的一些小demo和源码注释,便于查看、学习和交流。 4 | 5 | ## Vue实验室 6 | 7 | 相关博客都将收录到 gitbook —— [Vue 实验室](https://www.gitbook.com/book/violetjack/vue-laboratory/details) 中。 8 | 本系列博客内容**只专注与 Vue.js 相关知识的学习和分享!致力于成为全中文社区最全最好的 Vue.js 相关系列博客。** 9 | 10 | ## TODO List 11 | 12 | * Vue学习系列(7/7) 13 | * Vue源码学习系列(8/15) 14 | * ElementUI源码学习系列(4/8) 15 | * mint ui源码学习系列 16 | * Vuex 源码学习系列 17 | * vue-router 源码学习系列 18 | * weex 源码探究 19 | * Vue 相关技术栈用法和源码学习系列 20 | * …… 21 | 22 | ## Plan 23 | 24 | 今年目标很简单:专注于Vue前端相关技术的学习、使用和分享。 25 | 每天早起写两小时博客,在保证质量情况下保证3-4天一更新。 26 | 27 | ## 欢迎提问 28 | 29 | 在此留下我的 [知乎](https://www.zhihu.com/people/violetjack/activities) 和 [SegmentFault](https://segmentfault.com/u/violetjack) 地址。关于 Vue.js 相关的问题欢迎找到我哦,如果在我能力范围内,一定尽力回答帮助解决问题。这么做的动机一是因为我乐于助人,二是因为我想解决更多 Vue.js 相关的问题,成为解决 Vue.js 相关问题的小能手~ 30 | 31 | ## 最后 32 | 33 | 欢迎提交 issue 和 pr 让项目越变越好,也欢迎 star 关注收藏本项目~ -------------------------------------------------------------------------------- /VueCodes/README.md: -------------------------------------------------------------------------------- 1 | # Vue 源码学习 2 | 3 | 对 Vue 源码进行注释和学习~ -------------------------------------------------------------------------------- /VueCodes/demos/.idea/demos.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /VueCodes/demos/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /VueCodes/demos/HelloArr.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Arr 6 | 7 | 8 |
9 |

Hello Array

10 |
11 | 24 | 25 | -------------------------------------------------------------------------------- /VueCodes/demos/HelloOr.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Or 6 | 7 | 8 |
9 |

Hello Or

10 |
11 | 12 | 34 | 35 | -------------------------------------------------------------------------------- /VueCodes/demos/HelloVue.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Vue 6 | 7 | 8 | 9 |
10 | {{ message }} 11 |
    12 |
  • {{ item }}
  • 13 |
14 |
15 | 16 | 25 | 26 | -------------------------------------------------------------------------------- /VueCodes/demos/Hey.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hey 6 | 7 | 8 | 9 |
10 | 11 | 12 | 你好! 13 |
14 | 15 | 28 | 29 | -------------------------------------------------------------------------------- /VueCodes/demos/parse.json: -------------------------------------------------------------------------------- 1 | { 2 | "解析开头字符": { 3 | "attrs": [ 4 | [ 5 | " v-on:click='hey'", 6 | "v-on:click", 7 | "=", 8 | "hey", 9 | "undefined", 10 | "undefined" 11 | ] 12 | ], 13 | "end": 48, 14 | "start": 23, 15 | "tagName": "button", 16 | "unarySlash": "" 17 | }, 18 | "处理开头字符": { 19 | "tag": "button", 20 | "lowerCasedTag": "button", 21 | "attrs": [ 22 | { 23 | "name": "v-on:click", 24 | "value": "hey" 25 | } 26 | ] 27 | }, 28 | "如果是文本": "options.chars", 29 | "结束的时候": "options.end" 30 | } 31 | 32 | -------------------------------------------------------------------------------- /VueCodes/vue/README.md: -------------------------------------------------------------------------------- 1 | # vue源码学习 2 | 3 | 源码版本:`2.5.13` -------------------------------------------------------------------------------- /VueCodes/vue/src/compiler/directives/bind.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | export default function bind (el: ASTElement, dir: ASTDirective) { 4 | el.wrapData = (code: string) => { 5 | return `_b(${code},'${el.tag}',${dir.value},${ 6 | dir.modifiers && dir.modifiers.prop ? 'true' : 'false' 7 | }${ 8 | dir.modifiers && dir.modifiers.sync ? ',true' : '' 9 | })` 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /VueCodes/vue/src/compiler/directives/index.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import on from './on' 4 | import bind from './bind' 5 | import { noop } from 'shared/util' 6 | 7 | export default { 8 | on, 9 | bind, 10 | cloak: noop 11 | } 12 | -------------------------------------------------------------------------------- /VueCodes/vue/src/compiler/directives/on.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { warn } from 'core/util/index' 4 | 5 | export default function on (el: ASTElement, dir: ASTDirective) { 6 | if (process.env.NODE_ENV !== 'production' && dir.modifiers) { 7 | warn(`v-on without argument does not support modifiers.`) 8 | } 9 | el.wrapListeners = (code: string) => `_g(${code},${dir.value})` 10 | } 11 | -------------------------------------------------------------------------------- /VueCodes/vue/src/compiler/parser/entity-decoder.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | let decoder 4 | 5 | export default { 6 | decode (html: string): string { 7 | decoder = decoder || document.createElement('div') 8 | decoder.innerHTML = html 9 | return decoder.textContent 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /VueCodes/vue/src/core/components/index.js: -------------------------------------------------------------------------------- 1 | import KeepAlive from './keep-alive' 2 | 3 | export default { 4 | KeepAlive 5 | } 6 | -------------------------------------------------------------------------------- /VueCodes/vue/src/core/global-api/mixin.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { mergeOptions } from '../util/index' 4 | 5 | export function initMixin (Vue: GlobalAPI) { 6 | Vue.mixin = function (mixin: Object) { 7 | this.options = mergeOptions(this.options, mixin) 8 | return this 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /VueCodes/vue/src/core/global-api/use.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { toArray } from '../util/index' 4 | 5 | export function initUse (Vue: GlobalAPI) { 6 | Vue.use = function (plugin: Function | Object) { 7 | const installedPlugins = (this._installedPlugins || (this._installedPlugins = [])) 8 | if (installedPlugins.indexOf(plugin) > -1) { 9 | return this 10 | } 11 | 12 | // additional parameters 13 | const args = toArray(arguments, 1) 14 | args.unshift(this) 15 | if (typeof plugin.install === 'function') { 16 | plugin.install.apply(plugin, args) 17 | } else if (typeof plugin === 'function') { 18 | plugin.apply(null, args) 19 | } 20 | installedPlugins.push(plugin) 21 | return this 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /VueCodes/vue/src/core/index.js: -------------------------------------------------------------------------------- 1 | import Vue from './instance/index' 2 | import { initGlobalAPI } from './global-api/index' 3 | import { isServerRendering } from 'core/util/env' 4 | 5 | initGlobalAPI(Vue) 6 | 7 | Object.defineProperty(Vue.prototype, '$isServer', { 8 | get: isServerRendering 9 | }) 10 | 11 | Object.defineProperty(Vue.prototype, '$ssrContext', { 12 | get () { 13 | /* istanbul ignore next */ 14 | return this.$vnode && this.$vnode.ssrContext 15 | } 16 | }) 17 | 18 | Vue.version = '__VERSION__' 19 | 20 | export default Vue 21 | -------------------------------------------------------------------------------- /VueCodes/vue/src/core/instance/index.js: -------------------------------------------------------------------------------- 1 | import { initMixin } from './init' 2 | import { stateMixin } from './state' 3 | import { renderMixin } from './render' 4 | import { eventsMixin } from './events' 5 | import { lifecycleMixin } from './lifecycle' 6 | import { warn } from '../util/index' 7 | 8 | function Vue (options) { 9 | if (process.env.NODE_ENV !== 'production' && 10 | !(this instanceof Vue) 11 | ) { 12 | warn('Vue is a constructor and should be called with the `new` keyword') 13 | } 14 | this._init(options) 15 | } 16 | 17 | initMixin(Vue) 18 | stateMixin(Vue) 19 | eventsMixin(Vue) 20 | lifecycleMixin(Vue) 21 | renderMixin(Vue) 22 | 23 | export default Vue 24 | -------------------------------------------------------------------------------- /VueCodes/vue/src/core/instance/render-helpers/bind-object-listeners.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { warn, extend, isPlainObject } from 'core/util/index' 4 | 5 | export function bindObjectListeners (data: any, value: any): VNodeData { 6 | if (value) { 7 | if (!isPlainObject(value)) { 8 | process.env.NODE_ENV !== 'production' && warn( 9 | 'v-on without argument expects an Object value', 10 | this 11 | ) 12 | } else { 13 | const on = data.on = data.on ? extend({}, data.on) : {} 14 | for (const key in value) { 15 | const existing = on[key] 16 | const ours = value[key] 17 | on[key] = existing ? [].concat(existing, ours) : ours 18 | } 19 | } 20 | } 21 | return data 22 | } 23 | -------------------------------------------------------------------------------- /VueCodes/vue/src/core/instance/render-helpers/check-keycodes.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import config from 'core/config' 4 | import { hyphenate } from 'shared/util' 5 | 6 | /** 7 | * Runtime helper for checking keyCodes from config. 8 | * exposed as Vue.prototype._k 9 | * passing in eventKeyName as last argument separately for backwards compat 10 | */ 11 | export function checkKeyCodes ( 12 | eventKeyCode: number, 13 | key: string, 14 | builtInAlias?: number | Array, 15 | eventKeyName?: string 16 | ): ?boolean { 17 | const keyCodes = config.keyCodes[key] || builtInAlias 18 | if (keyCodes) { 19 | if (Array.isArray(keyCodes)) { 20 | return keyCodes.indexOf(eventKeyCode) === -1 21 | } else { 22 | return keyCodes !== eventKeyCode 23 | } 24 | } else if (eventKeyName) { 25 | return hyphenate(eventKeyName) !== key 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /VueCodes/vue/src/core/instance/render-helpers/resolve-filter.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { identity, resolveAsset } from 'core/util/index' 4 | 5 | /** 6 | * Runtime helper for resolving filters 7 | */ 8 | export function resolveFilter (id: string): Function { 9 | return resolveAsset(this.$options, 'filters', id, true) || identity 10 | } 11 | -------------------------------------------------------------------------------- /VueCodes/vue/src/core/util/index.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | export * from 'shared/util' 4 | export * from './lang' 5 | export * from './env' 6 | export * from './options' 7 | export * from './debug' 8 | export * from './props' 9 | export * from './error' 10 | export * from './next-tick' 11 | export { defineReactive } from '../observer/index' 12 | -------------------------------------------------------------------------------- /VueCodes/vue/src/core/util/perf.js: -------------------------------------------------------------------------------- 1 | import { inBrowser } from './env' 2 | 3 | export let mark 4 | export let measure 5 | 6 | if (process.env.NODE_ENV !== 'production') { 7 | const perf = inBrowser && window.performance 8 | /* istanbul ignore if */ 9 | if ( 10 | perf && 11 | perf.mark && 12 | perf.measure && 13 | perf.clearMarks && 14 | perf.clearMeasures 15 | ) { 16 | mark = tag => perf.mark(tag) 17 | measure = (name, startTag, endTag) => { 18 | perf.measure(name, startTag, endTag) 19 | perf.clearMarks(startTag) 20 | perf.clearMarks(endTag) 21 | perf.clearMeasures(name) 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /VueCodes/vue/src/core/vdom/helpers/get-first-component-child.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { isDef } from 'shared/util' 4 | import { isAsyncPlaceholder } from './is-async-placeholder' 5 | 6 | export function getFirstComponentChild (children: ?Array): ?VNode { 7 | if (Array.isArray(children)) { 8 | for (let i = 0; i < children.length; i++) { 9 | const c = children[i] 10 | if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) { 11 | return c 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /VueCodes/vue/src/core/vdom/helpers/index.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | export * from './merge-hook' 4 | export * from './extract-props' 5 | export * from './update-listeners' 6 | export * from './normalize-children' 7 | export * from './resolve-async-component' 8 | export * from './get-first-component-child' 9 | export * from './is-async-placeholder' 10 | -------------------------------------------------------------------------------- /VueCodes/vue/src/core/vdom/helpers/is-async-placeholder.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | export function isAsyncPlaceholder (node: VNode): boolean { 4 | return node.isComment && node.asyncFactory 5 | } 6 | -------------------------------------------------------------------------------- /VueCodes/vue/src/core/vdom/modules/index.js: -------------------------------------------------------------------------------- 1 | import directives from './directives' 2 | import ref from './ref' 3 | 4 | export default [ 5 | ref, 6 | directives 7 | ] 8 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/compiler/directives/html.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { addProp } from 'compiler/helpers' 4 | 5 | export default function html (el: ASTElement, dir: ASTDirective) { 6 | if (dir.value) { 7 | addProp(el, 'innerHTML', `_s(${dir.value})`) 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/compiler/directives/index.js: -------------------------------------------------------------------------------- 1 | import model from './model' 2 | import text from './text' 3 | import html from './html' 4 | 5 | export default { 6 | model, 7 | text, 8 | html 9 | } 10 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/compiler/directives/text.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { addProp } from 'compiler/helpers' 4 | 5 | export default function text (el: ASTElement, dir: ASTDirective) { 6 | if (dir.value) { 7 | addProp(el, 'textContent', `_s(${dir.value})`) 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/compiler/index.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { baseOptions } from './options' 4 | import { createCompiler } from 'compiler/index' 5 | 6 | const { compile, compileToFunctions } = createCompiler(baseOptions) 7 | 8 | export { compile, compileToFunctions } 9 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/compiler/modules/index.js: -------------------------------------------------------------------------------- 1 | import klass from './class' 2 | import style from './style' 3 | import model from './model' 4 | 5 | export default [ 6 | klass, 7 | style, 8 | model 9 | ] 10 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/compiler/options.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { 4 | isPreTag, 5 | mustUseProp, 6 | isReservedTag, 7 | getTagNamespace 8 | } from '../util/index' 9 | 10 | import modules from './modules/index' 11 | import directives from './directives/index' 12 | import { genStaticKeys } from 'shared/util' 13 | import { isUnaryTag, canBeLeftOpenTag } from './util' 14 | 15 | export const baseOptions: CompilerOptions = { 16 | expectHTML: true, 17 | modules, 18 | directives, 19 | isPreTag, 20 | isUnaryTag, 21 | mustUseProp, 22 | canBeLeftOpenTag, 23 | isReservedTag, 24 | getTagNamespace, 25 | staticKeys: genStaticKeys(modules) 26 | } 27 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/entry-compiler.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | export { parseComponent } from 'sfc/parser' 4 | export { compile, compileToFunctions } from './compiler/index' 5 | export { ssrCompile, ssrCompileToFunctions } from './server/compiler' 6 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/entry-runtime.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import Vue from './runtime/index' 4 | 5 | export default Vue 6 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/entry-server-basic-renderer.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import modules from './server/modules/index' 4 | import directives from './server/directives/index' 5 | import { isUnaryTag, canBeLeftOpenTag } from './compiler/util' 6 | import { createBasicRenderer } from 'server/create-basic-renderer' 7 | 8 | export default createBasicRenderer({ 9 | modules, 10 | directives, 11 | isUnaryTag, 12 | canBeLeftOpenTag 13 | }) 14 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/runtime/components/index.js: -------------------------------------------------------------------------------- 1 | import Transition from './transition' 2 | import TransitionGroup from './transition-group' 3 | 4 | export default { 5 | Transition, 6 | TransitionGroup 7 | } 8 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/runtime/directives/index.js: -------------------------------------------------------------------------------- 1 | import model from './model' 2 | import show from './show' 3 | 4 | export default { 5 | model, 6 | show 7 | } 8 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/runtime/modules/index.js: -------------------------------------------------------------------------------- 1 | import attrs from './attrs' 2 | import klass from './class' 3 | import events from './events' 4 | import domProps from './dom-props' 5 | import style from './style' 6 | import transition from './transition' 7 | 8 | export default [ 9 | attrs, 10 | klass, 11 | events, 12 | domProps, 13 | style, 14 | transition 15 | ] 16 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/runtime/patch.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import * as nodeOps from 'web/runtime/node-ops' 4 | import { createPatchFunction } from 'core/vdom/patch' 5 | import baseModules from 'core/vdom/modules/index' 6 | import platformModules from 'web/runtime/modules/index' 7 | 8 | // the directive module should be applied last, after all 9 | // built-in modules have been applied. 10 | const modules = platformModules.concat(baseModules) 11 | 12 | export const patch: Function = createPatchFunction({ nodeOps, modules }) 13 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/server/compiler.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { baseOptions } from '../compiler/options' 4 | import { createCompiler } from 'server/optimizing-compiler/index' 5 | 6 | const { compile, compileToFunctions } = createCompiler(baseOptions) 7 | 8 | export { 9 | compile as ssrCompile, 10 | compileToFunctions as ssrCompileToFunctions 11 | } 12 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/server/directives/index.js: -------------------------------------------------------------------------------- 1 | import show from './show' 2 | import model from './model' 3 | 4 | export default { 5 | show, 6 | model 7 | } 8 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/server/directives/show.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | export default function show (node: VNodeWithData, dir: VNodeDirective) { 4 | if (!dir.value) { 5 | const style: any = node.data.style || (node.data.style = {}) 6 | style.display = 'none' 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/server/modules/class.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { escape } from '../util' 4 | import { genClassForVnode } from 'web/util/index' 5 | 6 | export default function renderClass (node: VNodeWithData): ?string { 7 | const classList = genClassForVnode(node) 8 | if (classList !== '') { 9 | return ` class="${escape(classList)}"` 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/server/modules/index.js: -------------------------------------------------------------------------------- 1 | import attrs from './attrs' 2 | import domProps from './dom-props' 3 | import klass from './class' 4 | import style from './style' 5 | 6 | export default [ 7 | attrs, 8 | domProps, 9 | klass, 10 | style 11 | ] 12 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/util/compat.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { inBrowser } from 'core/util/index' 4 | 5 | // check whether current browser encodes a char inside attribute values 6 | let div 7 | function getShouldDecode (href: boolean): boolean { 8 | div = div || document.createElement('div') 9 | div.innerHTML = href ? `` : `
` 10 | return div.innerHTML.indexOf(' ') > 0 11 | } 12 | 13 | // #3663: IE encodes newlines inside attribute values while other browsers don't 14 | export const shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false 15 | // #6828: chrome encodes content in a[href] 16 | export const shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false 17 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/web/util/index.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { warn } from 'core/util/index' 4 | 5 | export * from './attrs' 6 | export * from './class' 7 | export * from './element' 8 | 9 | /** 10 | * Query an element selector if it's not an element already. 11 | */ 12 | export function query (el: string | Element): Element { 13 | if (typeof el === 'string') { 14 | const selected = document.querySelector(el) 15 | if (!selected) { 16 | process.env.NODE_ENV !== 'production' && warn( 17 | 'Cannot find element: ' + el 18 | ) 19 | return document.createElement('div') 20 | } 21 | return selected 22 | } else { 23 | return el 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/weex/compiler/directives/index.js: -------------------------------------------------------------------------------- 1 | import model from './model' 2 | 3 | export default { 4 | model 5 | } 6 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/weex/compiler/modules/append.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { makeMap } from 'shared/util' 4 | 5 | // The "unitary tag" means that the tag node and its children 6 | // must be sent to the native together. 7 | const isUnitaryTag = makeMap('cell,header,cell-slot,recycle-list', true) 8 | 9 | function preTransformNode (el: ASTElement, options: CompilerOptions) { 10 | if (isUnitaryTag(el.tag) && !el.attrsList.some(item => item.name === 'append')) { 11 | el.attrsMap.append = 'tree' 12 | el.attrsList.push({ name: 'append', value: 'tree' }) 13 | } 14 | if (el.attrsMap.append === 'tree') { 15 | el.appendAsTree = true 16 | } 17 | } 18 | 19 | function genData (el: ASTElement): string { 20 | return el.appendAsTree ? `appendAsTree:true,` : '' 21 | } 22 | 23 | export default { 24 | staticKeys: ['appendAsTree'], 25 | preTransformNode, 26 | genData 27 | } 28 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/weex/compiler/modules/index.js: -------------------------------------------------------------------------------- 1 | import klass from './class' 2 | import style from './style' 3 | import props from './props' 4 | import append from './append' 5 | import recycleList from './recycle-list/index' 6 | 7 | export default [ 8 | recycleList, 9 | klass, 10 | style, 11 | props, 12 | append 13 | ] 14 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/weex/compiler/modules/recycle-list/component-root.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { addAttr } from 'compiler/helpers' 4 | 5 | // mark component root nodes as 6 | export function postTransformComponentRoot ( 7 | el: ASTElement, 8 | options: WeexCompilerOptions 9 | ) { 10 | if (!el.parent) { 11 | // component root 12 | addAttr(el, '@isComponentRoot', 'true') 13 | addAttr(el, '@componentProps', '$props || {}') 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/weex/compiler/modules/recycle-list/component.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { addAttr } from 'compiler/helpers' 4 | import { RECYCLE_LIST_MARKER } from 'weex/util/index' 5 | 6 | // mark components as inside recycle-list so that we know we need to invoke 7 | // their special @render function instead of render in create-component.js 8 | export function postTransformComponent ( 9 | el: ASTElement, 10 | options: WeexCompilerOptions 11 | ) { 12 | // $flow-disable-line (we know isReservedTag is there) 13 | if (!options.isReservedTag(el.tag) && el.tag !== 'cell-slot') { 14 | addAttr(el, RECYCLE_LIST_MARKER, 'true') 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/weex/compiler/modules/recycle-list/text.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { addAttr } from 'compiler/helpers' 4 | 5 | function genText (node: ASTNode) { 6 | const value = node.type === 3 7 | ? node.text 8 | : node.type === 2 9 | ? node.tokens.length === 1 10 | ? node.tokens[0] 11 | : node.tokens 12 | : '' 13 | return JSON.stringify(value) 14 | } 15 | 16 | export function postTransformText (el: ASTElement, options: WeexCompilerOptions) { 17 | // weex can only contain text, so the parser 18 | // always generates a single child. 19 | if (el.children.length) { 20 | addAttr(el, 'value', genText(el.children[0])) 21 | el.children = [] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/weex/compiler/modules/recycle-list/v-bind.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { camelize } from 'shared/util' 4 | import { generateBinding } from 'weex/util/parser' 5 | import { bindRE } from 'compiler/parser/index' 6 | import { getAndRemoveAttr, addRawAttr } from 'compiler/helpers' 7 | 8 | function parseAttrName (name: string): string { 9 | return camelize(name.replace(bindRE, '')) 10 | } 11 | 12 | export function preTransformVBind (el: ASTElement, options: WeexCompilerOptions) { 13 | for (const attr in el.attrsMap) { 14 | if (bindRE.test(attr)) { 15 | const name: string = parseAttrName(attr) 16 | const value = generateBinding(getAndRemoveAttr(el, attr)) 17 | delete el.attrsMap[attr] 18 | addRawAttr(el, name, value) 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/weex/entry-compiler.js: -------------------------------------------------------------------------------- 1 | export { compile } from 'weex/compiler/index' 2 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/weex/entry-runtime-factory.js: -------------------------------------------------------------------------------- 1 | // this entry is built and wrapped with a factory function 2 | // used to generate a fresh copy of Vue for every Weex instance. 3 | 4 | import Vue from './runtime/index' 5 | 6 | exports.Vue = Vue 7 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/weex/runtime/components/index.js: -------------------------------------------------------------------------------- 1 | import Richtext from './richtext' 2 | import Transition from './transition' 3 | import TransitionGroup from './transition-group' 4 | 5 | export default { 6 | Richtext, 7 | Transition, 8 | TransitionGroup 9 | } 10 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/weex/runtime/components/transition.js: -------------------------------------------------------------------------------- 1 | // reuse same transition component logic from web 2 | export { 3 | transitionProps, 4 | extractTransitionData 5 | } from 'web/runtime/components/transition' 6 | 7 | import Transition from 'web/runtime/components/transition' 8 | 9 | export default Transition 10 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/weex/runtime/directives/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | } 3 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/weex/runtime/modules/index.js: -------------------------------------------------------------------------------- 1 | import attrs from './attrs' 2 | import klass from './class' 3 | import events from './events' 4 | import style from './style' 5 | import transition from './transition' 6 | 7 | export default [ 8 | attrs, 9 | klass, 10 | events, 11 | style, 12 | transition 13 | ] 14 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/weex/runtime/patch.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import * as nodeOps from 'weex/runtime/node-ops' 4 | import { createPatchFunction } from 'core/vdom/patch' 5 | import baseModules from 'core/vdom/modules/index' 6 | import platformModules from 'weex/runtime/modules/index' 7 | 8 | // the directive module should be applied last, after all 9 | // built-in modules have been applied. 10 | const modules = platformModules.concat(baseModules) 11 | 12 | export const patch: Function = createPatchFunction({ 13 | nodeOps, 14 | modules, 15 | LONG_LIST_THRESHOLD: 10 16 | }) 17 | -------------------------------------------------------------------------------- /VueCodes/vue/src/platforms/weex/runtime/text-node.js: -------------------------------------------------------------------------------- 1 | let latestNodeId = 1 2 | 3 | export default function TextNode (text) { 4 | this.instanceId = '' 5 | this.nodeId = latestNodeId++ 6 | this.parentNode = null 7 | this.nodeType = 3 8 | this.text = text 9 | } 10 | -------------------------------------------------------------------------------- /VueCodes/vue/src/server/optimizing-compiler/index.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | import { parse } from 'compiler/parser/index' 4 | import { generate } from './codegen' 5 | import { optimize } from './optimizer' 6 | import { createCompilerCreator } from 'compiler/create-compiler' 7 | 8 | export const createCompiler = createCompilerCreator(function baseCompile ( 9 | template: string, 10 | options: CompilerOptions 11 | ): CompiledResult { 12 | const ast = parse(template.trim(), options) 13 | optimize(ast, options) 14 | const code = generate(ast, options) 15 | return { 16 | ast, 17 | render: code.render, 18 | staticRenderFns: code.staticRenderFns 19 | } 20 | }) 21 | -------------------------------------------------------------------------------- /VueCodes/vue/src/server/util.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | export const isJS = (file: string): boolean => /\.js(\?[^.]+)?$/.test(file) 4 | 5 | export const isCSS = (file: string): boolean => /\.css(\?[^.]+)?$/.test(file) 6 | 7 | export function createPromiseCallback () { 8 | let resolve, reject 9 | const promise: Promise = new Promise((_resolve, _reject) => { 10 | resolve = _resolve 11 | reject = _reject 12 | }) 13 | const cb = (err: Error, res?: string) => { 14 | if (err) return reject(err) 15 | resolve(res || '') 16 | } 17 | return { promise, cb } 18 | } 19 | -------------------------------------------------------------------------------- /VueCodes/vue/src/shared/constants.js: -------------------------------------------------------------------------------- 1 | export const SSR_ATTR = 'data-server-rendered' 2 | 3 | export const ASSET_TYPES = [ 4 | 'component', 5 | 'directive', 6 | 'filter' 7 | ] 8 | 9 | export const LIFECYCLE_HOOKS = [ 10 | 'beforeCreate', 11 | 'created', 12 | 'beforeMount', 13 | 'mounted', 14 | 'beforeUpdate', 15 | 'updated', 16 | 'beforeDestroy', 17 | 'destroyed', 18 | 'activated', 19 | 'deactivated', 20 | 'errorCaptured' 21 | ] 22 | -------------------------------------------------------------------------------- /VueCodes/vue/test/e2e/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "indent": 0 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /VueCodes/vue/test/e2e/specs/basic-ssr.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
wtf
12 | 13 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /VueCodes/vue/test/e2e/specs/basic-ssr.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'basic SSR': function (browser) { 3 | browser 4 | .url('http://localhost:8080/test/e2e/specs/basic-ssr.html') 5 | .assert.containsText('#result', '
foo
') 6 | .end() 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /VueCodes/vue/test/e2e/specs/commits.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'commits': function (browser) { 3 | browser 4 | .url('http://localhost:8080/examples/commits/') 5 | .waitForElementVisible('li', 5000) 6 | .assert.count('input', 2) 7 | .assert.count('label', 2) 8 | .assert.containsText('label[for="master"]', 'master') 9 | .assert.containsText('label[for="dev"]', 'dev') 10 | .assert.checked('#master') 11 | .assert.checked('#dev', false) 12 | .assert.containsText('p', 'vuejs/vue@master') 13 | .assert.count('li', 3) 14 | .assert.count('li .commit', 3) 15 | .assert.count('li .message', 3) 16 | .click('#dev') 17 | .assert.containsText('p', 'vuejs/vue@dev') 18 | .assert.count('li', 3) 19 | .assert.count('li .commit', 3) 20 | .assert.count('li .message', 3) 21 | .end() 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /VueCodes/vue/test/e2e/specs/markdown.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'markdown': function (browser) { 3 | browser 4 | .url('http://localhost:8080/examples/markdown/') 5 | .waitForElementVisible('#editor', 1000) 6 | .assert.value('textarea', '# hello') 7 | .assert.hasHTML('#editor div', '

hello

') 8 | .setValue('textarea', '\n## foo\n\n- bar\n- baz') 9 | // assert the output is not updated yet because of debounce 10 | .assert.hasHTML('#editor div', '

hello

') 11 | .waitFor(500) 12 | .assert.hasHTML('#editor div', 13 | '

hello

\n' + 14 | '

foo

\n' + 15 | '
    \n
  • bar
  • \n
  • baz
  • \n
' 16 | ) 17 | .end() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /VueCodes/vue/test/helpers/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jasmine": true 4 | }, 5 | "globals": { 6 | "waitForUpdate": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /VueCodes/vue/test/helpers/classlist.js: -------------------------------------------------------------------------------- 1 | beforeEach(() => { 2 | jasmine.addMatchers({ 3 | // since classList may not be supported in all browsers 4 | toHaveClass: () => { 5 | return { 6 | compare: (el, cls) => { 7 | const pass = el.classList 8 | ? el.classList.contains(cls) 9 | : el.getAttribute('class').split(/\s+/g).indexOf(cls) > -1 10 | return { 11 | pass, 12 | message: `Expected element${pass ? ' ' : ' not '}to have class ${cls}` 13 | } 14 | } 15 | } 16 | } 17 | }) 18 | }) 19 | -------------------------------------------------------------------------------- /VueCodes/vue/test/helpers/test-object-option.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | export default function testObjectOption (name) { 4 | it(`Options ${name}: should warn non object value`, () => { 5 | const options = {} 6 | options[name] = () => {} 7 | new Vue(options) 8 | expect(`Invalid value for option "${name}"`).toHaveBeenWarned() 9 | }) 10 | 11 | it(`Options ${name}: should not warn valid object value`, () => { 12 | const options = {} 13 | options[name] = {} 14 | new Vue(options) 15 | expect(`Invalid value for option "${name}"`).not.toHaveBeenWarned() 16 | }) 17 | } 18 | -------------------------------------------------------------------------------- /VueCodes/vue/test/helpers/to-equal.js: -------------------------------------------------------------------------------- 1 | import { isEqual } from 'lodash' 2 | 3 | beforeEach(() => { 4 | jasmine.addMatchers({ 5 | // override built-in toEqual because it behaves incorrectly 6 | // on Vue-observed arrays in Safari 7 | toEqual: () => { 8 | return { 9 | compare: (a, b) => { 10 | const pass = isEqual(a, b) 11 | return { 12 | pass, 13 | message: `Expected ${a} to equal ${b}` 14 | } 15 | } 16 | } 17 | } 18 | }) 19 | }) 20 | -------------------------------------------------------------------------------- /VueCodes/vue/test/helpers/trigger-event.js: -------------------------------------------------------------------------------- 1 | window.triggerEvent = function triggerEvent (target, event, process) { 2 | var e = document.createEvent('HTMLEvents') 3 | e.initEvent(event, true, true) 4 | if (process) process(e) 5 | target.dispatchEvent(e) 6 | } 7 | -------------------------------------------------------------------------------- /VueCodes/vue/test/helpers/vdom.js: -------------------------------------------------------------------------------- 1 | import VNode from 'core/vdom/vnode' 2 | 3 | window.createTextVNode = function (text) { 4 | return new VNode(undefined, undefined, undefined, text) 5 | } 6 | -------------------------------------------------------------------------------- /VueCodes/vue/test/ssr/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jasmine": true 4 | }, 5 | "plugins": ["jasmine"], 6 | "rules": { 7 | "jasmine/no-focused-tests": 2 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /VueCodes/vue/test/ssr/async-loader.js: -------------------------------------------------------------------------------- 1 | const hash = require('hash-sum') 2 | 3 | module.exports = function (code) { 4 | const id = hash(this.request) // simulating vue-loader module id injection 5 | return code.replace('__MODULE_ID__', id) 6 | } 7 | -------------------------------------------------------------------------------- /VueCodes/vue/test/ssr/fixtures/app.js: -------------------------------------------------------------------------------- 1 | import Vue from '../../../dist/vue.runtime.common.js' 2 | 3 | export default context => { 4 | return new Promise(resolve => { 5 | context.msg = 'hello' 6 | resolve(new Vue({ 7 | render (h) { 8 | return h('div', context.url) 9 | } 10 | })) 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /VueCodes/vue/test/ssr/fixtures/async-bar.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | beforeCreate () { 3 | this.$vnode.ssrContext._registeredComponents.add('__MODULE_ID__') 4 | }, 5 | render (h) { 6 | return h('div', 'async bar') 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /VueCodes/vue/test/ssr/fixtures/async-foo.js: -------------------------------------------------------------------------------- 1 | // import image and font 2 | import './test.css' 3 | import font from './test.woff2' 4 | import image from './test.png' 5 | 6 | module.exports = { 7 | beforeCreate () { 8 | this.$vnode.ssrContext._registeredComponents.add('__MODULE_ID__') 9 | }, 10 | render (h) { 11 | return h('div', `async ${font} ${image}`) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /VueCodes/vue/test/ssr/fixtures/cache.js: -------------------------------------------------------------------------------- 1 | import Vue from '../../../dist/vue.runtime.common.js' 2 | 3 | const app = { 4 | name: 'app', 5 | props: ['id'], 6 | serverCacheKey: props => props.id, 7 | render (h) { 8 | return h('div', '/test') 9 | } 10 | } 11 | 12 | export default () => { 13 | return Promise.resolve(new Vue({ 14 | render: h => h(app, { props: { id: 1 }}) 15 | })) 16 | } 17 | -------------------------------------------------------------------------------- /VueCodes/vue/test/ssr/fixtures/error.js: -------------------------------------------------------------------------------- 1 | throw new Error('foo') 2 | -------------------------------------------------------------------------------- /VueCodes/vue/test/ssr/fixtures/promise-rejection.js: -------------------------------------------------------------------------------- 1 | export default () => { 2 | return Promise.reject(new Error('foo')) 3 | } 4 | -------------------------------------------------------------------------------- /VueCodes/vue/test/ssr/fixtures/split.js: -------------------------------------------------------------------------------- 1 | import Vue from '../../../dist/vue.runtime.common.js' 2 | 3 | // async component! 4 | const Foo = () => import('./async-foo') 5 | const Bar = () => import('./async-bar') // eslint-disable-line 6 | 7 | export default context => { 8 | return new Promise(resolve => { 9 | context.msg = 'hello' 10 | const vm = new Vue({ 11 | render (h) { 12 | return h('div', [ 13 | context.url, 14 | h(Foo) 15 | ]) 16 | } 17 | }) 18 | 19 | // simulate router.onReady 20 | Foo().then(comp => { 21 | // resolve now to make the render sync 22 | Foo.resolved = Vue.extend(comp) 23 | resolve(vm) 24 | }) 25 | }) 26 | } 27 | -------------------------------------------------------------------------------- /VueCodes/vue/test/ssr/fixtures/test.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/VueCodes/vue/test/ssr/fixtures/test.css -------------------------------------------------------------------------------- /VueCodes/vue/test/ssr/fixtures/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/VueCodes/vue/test/ssr/fixtures/test.png -------------------------------------------------------------------------------- /VueCodes/vue/test/ssr/fixtures/test.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/VueCodes/vue/test/ssr/fixtures/test.woff2 -------------------------------------------------------------------------------- /VueCodes/vue/test/ssr/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "test/ssr", 3 | "spec_files": [ 4 | "*.spec.js" 5 | ], 6 | "helpers": [ 7 | "../../node_modules/babel-register/lib/node.js" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /VueCodes/vue/test/unit/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jasmine": true 4 | }, 5 | "globals": { 6 | "waitForUpdate": true, 7 | "triggerEvent": true, 8 | "createTextVNode": true 9 | }, 10 | "plugins": ["jasmine"], 11 | "rules": { 12 | "jasmine/no-focused-tests": 2 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /VueCodes/vue/test/unit/features/directives/cloak.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | describe('Directive v-cloak', () => { 4 | it('should be removed after compile', () => { 5 | const el = document.createElement('div') 6 | el.setAttribute('v-cloak', '') 7 | const vm = new Vue({ el }) 8 | expect(vm.$el.hasAttribute('v-cloak')).toBe(false) 9 | }) 10 | }) 11 | -------------------------------------------------------------------------------- /VueCodes/vue/test/unit/features/directives/model-file.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | describe('Directive v-model file', () => { 4 | it('warn to use @change instead', () => { 5 | new Vue({ 6 | data: { 7 | file: '' 8 | }, 9 | template: '' 10 | }).$mount() 11 | expect('Use a v-on:change listener instead').toHaveBeenWarned() 12 | }) 13 | }) 14 | -------------------------------------------------------------------------------- /VueCodes/vue/test/unit/features/global-api/compile.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | describe('Global API: compile', () => { 4 | it('should compile render functions', () => { 5 | const res = Vue.compile('
{{ msg }}
') 6 | const vm = new Vue({ 7 | data: { 8 | msg: 'hello' 9 | }, 10 | render: res.render, 11 | staticRenderFns: res.staticRenderFns 12 | }).$mount() 13 | expect(vm.$el.innerHTML).toContain('hello') 14 | }) 15 | }) 16 | -------------------------------------------------------------------------------- /VueCodes/vue/test/unit/features/instance/init.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | describe('Initialization', () => { 4 | it('without new', () => { 5 | try { Vue() } catch (e) {} 6 | expect('Vue is a constructor and should be called with the `new` keyword').toHaveBeenWarned() 7 | }) 8 | 9 | it('with new', () => { 10 | expect(new Vue() instanceof Vue).toBe(true) 11 | }) 12 | }) 13 | -------------------------------------------------------------------------------- /VueCodes/vue/test/unit/features/options/comments.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | describe('Comments', () => { 4 | it('comments should be kept', () => { 5 | const vm = new Vue({ 6 | comments: true, 7 | data () { 8 | return { 9 | foo: 1 10 | } 11 | }, 12 | template: '
node1{{foo}}
' 13 | }).$mount() 14 | expect(vm.$el.innerHTML).toEqual('node11') 15 | }) 16 | }) 17 | -------------------------------------------------------------------------------- /VueCodes/vue/test/unit/features/options/propsData.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | describe('Options propsData', () => { 4 | it('should work', done => { 5 | const A = Vue.extend({ 6 | props: ['a'], 7 | template: '
{{ a }}
' 8 | }) 9 | const vm = new A({ 10 | propsData: { 11 | a: 123 12 | } 13 | }).$mount() 14 | expect(vm.a).toBe(123) 15 | expect(vm.$el.textContent).toBe('123') 16 | vm.a = 234 17 | waitForUpdate(() => { 18 | expect(vm.$el.textContent).toBe('234') 19 | }).then(done) 20 | }) 21 | 22 | it('warn non instantiation usage', () => { 23 | Vue.extend({ 24 | propsData: { 25 | a: 123 26 | } 27 | }) 28 | expect('option "propsData" can only be used during instance creation').toHaveBeenWarned() 29 | }) 30 | }) 31 | -------------------------------------------------------------------------------- /VueCodes/vue/test/unit/index.js: -------------------------------------------------------------------------------- 1 | require('es6-promise/auto') 2 | 3 | // import all helpers 4 | const helpersContext = require.context('../helpers', true) 5 | helpersContext.keys().forEach(helpersContext) 6 | 7 | // require all test files 8 | const testsContext = require.context('./', true, /\.spec$/) 9 | testsContext.keys().forEach(testsContext) 10 | -------------------------------------------------------------------------------- /VueCodes/vue/test/unit/karma.dev.config.js: -------------------------------------------------------------------------------- 1 | var base = require('./karma.base.config.js') 2 | 3 | module.exports = function (config) { 4 | config.set(Object.assign(base, { 5 | browsers: ['PhantomJS'], 6 | reporters: ['progress'], 7 | plugins: base.plugins.concat([ 8 | 'karma-phantomjs-launcher' 9 | ]) 10 | })) 11 | } 12 | -------------------------------------------------------------------------------- /VueCodes/vue/test/unit/karma.unit.config.js: -------------------------------------------------------------------------------- 1 | var base = require('./karma.base.config.js') 2 | 3 | module.exports = function (config) { 4 | config.set(Object.assign(base, { 5 | browsers: ['Chrome', 'Firefox', 'Safari'], 6 | reporters: ['progress'], 7 | singleRun: true, 8 | plugins: base.plugins.concat([ 9 | 'karma-chrome-launcher', 10 | 'karma-firefox-launcher', 11 | 'karma-safari-launcher' 12 | ]) 13 | })) 14 | } 15 | -------------------------------------------------------------------------------- /VueCodes/vue/test/unit/modules/server-compiler/optimizer.spec.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/VueCodes/vue/test/unit/modules/server-compiler/optimizer.spec.js -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jasmine": true 4 | }, 5 | "plugins": ["jasmine"], 6 | "rules": { 7 | "jasmine/no-focused-tests": 2 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/event/click.after.vdom.js: -------------------------------------------------------------------------------- 1 | ({ 2 | type: 'div', 3 | event: ['click'], 4 | children: [{ 5 | type: 'text', 6 | attr: { 7 | value: '43' 8 | } 9 | }] 10 | }) 11 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/event/click.before.vdom.js: -------------------------------------------------------------------------------- 1 | ({ 2 | type: 'div', 3 | event: ['click'], 4 | children: [{ 5 | type: 'text', 6 | attr: { 7 | value: '42' 8 | } 9 | }] 10 | }) 11 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/event/click.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 21 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/attrs.vdom.js: -------------------------------------------------------------------------------- 1 | ({ 2 | type: 'recycle-list', 3 | attr: { 4 | append: 'tree', 5 | listData: [ 6 | { type: 'A', count: 1, source: 'http://whatever.com/x.png' }, 7 | { type: 'A', count: 2, source: 'http://whatever.com/y.png' }, 8 | { type: 'A', count: 3, source: 'http://whatever.com/z.png' } 9 | ], 10 | switch: 'type', 11 | alias: 'item' 12 | }, 13 | children: [{ 14 | type: 'cell-slot', 15 | attr: { append: 'tree', case: 'A' }, 16 | children: [{ 17 | type: 'image', 18 | attr: { 19 | resize: 'cover', 20 | src: { 21 | '@binding': 'item.source' 22 | } 23 | } 24 | }, { 25 | type: 'text', 26 | attr: { 27 | lines: '3', 28 | count: { 29 | '@binding': 'item.count' 30 | } 31 | } 32 | }] 33 | }] 34 | }) 35 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/attrs.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 23 | 24 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/classname.vdom.js: -------------------------------------------------------------------------------- 1 | ({ 2 | type: 'recycle-list', 3 | attr: { 4 | append: 'tree', 5 | listData: [ 6 | { type: 'A', color: 'red' }, 7 | { type: 'A', color: 'blue' } 8 | ], 9 | switch: 'type', 10 | alias: 'item' 11 | }, 12 | children: [{ 13 | type: 'cell-slot', 14 | attr: { append: 'tree', case: 'A' }, 15 | style: { 16 | backgroundColor: '#FF6600' 17 | }, 18 | children: [{ 19 | type: 'text', 20 | attr: { 21 | // not supported yet 22 | // classList: ['text', { '@binding': 'item.color' }], 23 | value: 'content' 24 | } 25 | }] 26 | }] 27 | }) 28 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/classname.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 24 | 25 | 37 | 38 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/components/banner.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 20 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/components/counter.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 23 | 24 | 37 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/components/editor.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 18 | 19 | 32 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/components/footer.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/components/poster.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 22 | 23 | 34 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/components/stateful-lifecycle.vdom.js: -------------------------------------------------------------------------------- 1 | ({ 2 | type: 'recycle-list', 3 | attr: { 4 | append: 'tree', 5 | listData: [ 6 | { type: 'X' }, 7 | { type: 'X' } 8 | ], 9 | switch: 'type', 10 | alias: 'item' 11 | }, 12 | children: [{ 13 | type: 'cell-slot', 14 | attr: { append: 'tree', case: 'X' }, 15 | children: [{ 16 | type: 'div', 17 | attr: { 18 | '@isComponentRoot': true, 19 | '@componentProps': {} 20 | }, 21 | children: [{ 22 | type: 'text', 23 | attr: { 24 | value: { '@binding': 'number' } 25 | } 26 | }] 27 | }] 28 | }] 29 | }) 30 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/components/stateful-lifecycle.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 22 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/components/stateful-v-model.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 22 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/components/stateful.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 23 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/components/stateless-multi-components.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 31 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/components/stateless-with-props.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 23 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/components/stateless.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 23 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/inline-style.vdom.js: -------------------------------------------------------------------------------- 1 | ({ 2 | type: 'recycle-list', 3 | attr: { 4 | append: 'tree', 5 | listData: [ 6 | { type: 'A', color: '#606060' }, 7 | { type: 'A', color: '#E5E5E5' } 8 | ], 9 | switch: 'type', 10 | alias: 'item' 11 | }, 12 | children: [{ 13 | type: 'cell-slot', 14 | attr: { append: 'tree', case: 'A' }, 15 | style: { 16 | backgroundColor: '#FF6600' 17 | }, 18 | children: [{ 19 | type: 'text', 20 | style: { 21 | fontSize: '100px', 22 | color: { '@binding': 'item.color' } 23 | }, 24 | attr: { 25 | value: 'content' 26 | } 27 | }] 28 | }] 29 | }) 30 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/inline-style.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 21 | 22 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/text-node.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 23 | 24 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/v-else-if.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 23 | 24 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/v-else.vdom.js: -------------------------------------------------------------------------------- 1 | ({ 2 | type: 'recycle-list', 3 | attr: { 4 | append: 'tree', 5 | listData: [ 6 | { type: 'A' }, 7 | { type: 'A' } 8 | ], 9 | switch: 'type', 10 | alias: 'item' 11 | }, 12 | children: [{ 13 | type: 'cell-slot', 14 | attr: { append: 'tree', case: 'A' }, 15 | children: [{ 16 | type: 'image', 17 | attr: { 18 | '[[match]]': 'item.source', 19 | src: { '@binding': 'item.source' } 20 | } 21 | }, { 22 | type: 'image', 23 | attr: { 24 | '[[match]]': '!(item.source)', 25 | src: { '@binding': 'item.placeholder' } 26 | } 27 | }] 28 | }] 29 | }) 30 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/v-else.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 22 | 23 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/v-for-iterator.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 24 | 25 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/v-for.vdom.js: -------------------------------------------------------------------------------- 1 | ({ 2 | type: 'recycle-list', 3 | attr: { 4 | append: 'tree', 5 | listData: [ 6 | { type: 'A' }, 7 | { type: 'A' } 8 | ], 9 | switch: 'type', 10 | alias: 'item' 11 | }, 12 | children: [{ 13 | type: 'cell-slot', 14 | attr: { append: 'tree', case: 'A' }, 15 | children: [{ 16 | type: 'div', 17 | attr: { 18 | '[[repeat]]': { 19 | '@expression': 'item.list', 20 | '@alias': 'panel' 21 | } 22 | }, 23 | children: [{ 24 | type: 'text', 25 | attr: { 26 | value: { 27 | '@binding': 'panel.label' 28 | } 29 | } 30 | }] 31 | }] 32 | }] 33 | }) 34 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/v-for.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 23 | 24 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/v-if.vdom.js: -------------------------------------------------------------------------------- 1 | ({ 2 | type: 'recycle-list', 3 | attr: { 4 | append: 'tree', 5 | listData: [ 6 | { type: 'A' }, 7 | { type: 'A' } 8 | ], 9 | switch: 'type', 10 | alias: 'item' 11 | }, 12 | children: [{ 13 | type: 'cell-slot', 14 | attr: { append: 'tree', case: 'A' }, 15 | children: [{ 16 | type: 'image', 17 | attr: { 18 | '[[match]]': 'item.source', 19 | src: { '@binding': 'item.source' } 20 | } 21 | }, { 22 | type: 'text', 23 | attr: { 24 | '[[match]]': '!item.source', 25 | value: 'Title' 26 | } 27 | }] 28 | }] 29 | }) 30 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/v-if.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 22 | 23 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/v-on-inline.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 28 | 29 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/v-on.vdom.js: -------------------------------------------------------------------------------- 1 | ({ 2 | type: 'recycle-list', 3 | attr: { 4 | append: 'tree', 5 | listData: [ 6 | { type: 'A' }, 7 | { type: 'A' } 8 | ], 9 | switch: 'type', 10 | alias: 'item' 11 | }, 12 | children: [{ 13 | type: 'cell-slot', 14 | attr: { append: 'tree', case: 'A' }, 15 | children: [{ 16 | type: 'text', 17 | event: ['click', 'longpress'], 18 | attr: { value: 'A' } 19 | }, { 20 | type: 'text', 21 | event: ['touchend'], 22 | attr: { value: 'B' } 23 | }] 24 | }] 25 | }) 26 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/recycle-list/v-on.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 26 | 27 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/render/sample.vdom.js: -------------------------------------------------------------------------------- 1 | ({ 2 | type: 'div', 3 | style: { 4 | justifyContent: 'center' 5 | }, 6 | children: [{ 7 | type: 'text', 8 | attr: { 9 | value: 'Yo' 10 | }, 11 | style: { 12 | color: '#41B883', 13 | fontSize: '233px', 14 | textAlign: 'center' 15 | } 16 | }] 17 | }) 18 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/cases/render/sample.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 14 | 15 | 24 | -------------------------------------------------------------------------------- /VueCodes/vue/test/weex/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "test/weex", 3 | "spec_files": [ 4 | "**/*[sS]pec.js" 5 | ], 6 | "helpers": [ 7 | "../../node_modules/babel-register/lib/node.js" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /VueRouterDemo/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": ["transform-runtime"], 4 | "comments": false 5 | } 6 | -------------------------------------------------------------------------------- /VueRouterDemo/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /VueRouterDemo/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /VueRouterDemo/README.md: -------------------------------------------------------------------------------- 1 | # vue-router Demo 2 | 3 | 本项目写了关于vue-router的使用demo。本demo已经进行过优化,便于学习查看。 4 | 5 | ## 查看效果 6 | 7 | ``` 8 | $ npm install 9 | $ npm run dev 10 | ``` 11 | 12 | ## 文章地址 13 | 14 | [Vue.js学习系列一 —— vue-router2学习实践笔记(附DEMO)](http://www.jianshu.com/p/8013d8d37bd0) 15 | -------------------------------------------------------------------------------- /VueRouterDemo/build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /VueRouterDemo/config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /VueRouterDemo/config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /VueRouterDemo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | router 6 | 7 | 8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /VueRouterDemo/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/VueRouterDemo/src/assets/logo.png -------------------------------------------------------------------------------- /VueRouterDemo/src/components/childs/child01.vue: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /VueRouterDemo/src/components/childs/child02.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 19 | -------------------------------------------------------------------------------- /VueRouterDemo/src/components/page01.vue: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /VueRouterDemo/src/components/page02.vue: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /VueRouterDemo/src/components/page03.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 18 | -------------------------------------------------------------------------------- /VueRouterDemo/src/components/page04.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 24 | -------------------------------------------------------------------------------- /VueRouterDemo/src/components/page05.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 17 | -------------------------------------------------------------------------------- /VueRouterDemo/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import VueRouter from 'vue-router' 6 | import routes from './routes.js' 7 | 8 | Vue.use(VueRouter) 9 | 10 | const router = new VueRouter({ 11 | routes 12 | }) 13 | 14 | /* eslint-disable no-new */ 15 | new Vue({ 16 | el: '#app', 17 | template: '', 18 | components: { App }, 19 | router 20 | }) 21 | -------------------------------------------------------------------------------- /VueRouterDemo/src/routes.js: -------------------------------------------------------------------------------- 1 | import Page01 from './components/page01' 2 | import Page02 from './components/page02' 3 | import Page03 from './components/page03' 4 | import Page04 from './components/page04' 5 | import Page05 from './components/page05' 6 | 7 | import Child01 from './components/childs/child01' 8 | import Child02 from './components/childs/child02' 9 | 10 | export default [ 11 | //嵌套路由 12 | { path: '/', component: Page01 }, 13 | //动态路由 14 | { name: 'Page02', path: '/02/:id', component: Page02 }, 15 | //命名路由&路由传参 16 | { name: 'com03', path: '/03/:sex', component: Page03 }, 17 | { path: '/04', component: Page04, 18 | children: [ 19 | { name: 'child01', path: '/', component: Child01 }, 20 | { name: 'child02', path: '/c02', component: Child02 }, 21 | ] 22 | }, 23 | { name: 'Page05', path: '/05/:txt', component: Page05 }, 24 | ] 25 | -------------------------------------------------------------------------------- /VueRouterDemo/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/VueRouterDemo/static/.gitkeep -------------------------------------------------------------------------------- /VueTestDemo/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { "modules": false }], 4 | "stage-2" 5 | ], 6 | "plugins": ["transform-runtime"], 7 | "comments": false, 8 | "env": { 9 | "test": { 10 | "presets": ["env", "stage-2"], 11 | "plugins": [ "istanbul" ] 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /VueTestDemo/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /VueTestDemo/.eslintignore: -------------------------------------------------------------------------------- 1 | build/*.js 2 | config/*.js 3 | -------------------------------------------------------------------------------- /VueTestDemo/.eslintrc.js: -------------------------------------------------------------------------------- 1 | // http://eslint.org/docs/user-guide/configuring 2 | 3 | module.exports = { 4 | root: true, 5 | parser: 'babel-eslint', 6 | parserOptions: { 7 | sourceType: 'module' 8 | }, 9 | env: { 10 | browser: true, 11 | }, 12 | // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style 13 | extends: 'standard', 14 | // required to lint *.vue files 15 | plugins: [ 16 | 'html' 17 | ], 18 | // add your custom rules here 19 | 'rules': { 20 | // allow paren-less arrow functions 21 | 'arrow-parens': 0, 22 | // allow async-await 23 | 'generator-star-spacing': 0, 24 | // allow debugger during development 25 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /VueTestDemo/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | test/unit/coverage 8 | test/e2e/reports 9 | selenium-debug.log 10 | -------------------------------------------------------------------------------- /VueTestDemo/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | // to edit target browsers: use "browserlist" field in package.json 6 | "autoprefixer": {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /VueTestDemo/README.md: -------------------------------------------------------------------------------- 1 | # 测试Demo 2 | 3 | 本项目写了多个基于vue-cli的单元测试脚本。 4 | 5 | ## 查看效果 6 | 7 | ``` 8 | $ npm install 9 | $ npm run unit 10 | ``` 11 | 12 | ## 文章地址 13 | 14 | [Vue.js学习系列六——Vue单元测试Karma+Mocha学习笔记](http://www.jianshu.com/p/073d25a3bba0) 15 | 16 | ## TODO 17 | 18 | * 测试网络通信 19 | * 测试CSS 20 | * 测试触发事件 21 | -------------------------------------------------------------------------------- /VueTestDemo/build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /VueTestDemo/build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | var utils = require('./utils') 2 | var config = require('../config') 3 | var isProduction = process.env.NODE_ENV === 'production' 4 | 5 | module.exports = { 6 | loaders: utils.cssLoaders({ 7 | sourceMap: isProduction 8 | ? config.build.productionSourceMap 9 | : config.dev.cssSourceMap, 10 | extract: isProduction 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /VueTestDemo/config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /VueTestDemo/config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /VueTestDemo/config/test.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var devEnv = require('./dev.env') 3 | 4 | module.exports = merge(devEnv, { 5 | NODE_ENV: '"testing"' 6 | }) 7 | -------------------------------------------------------------------------------- /VueTestDemo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | testdemo 6 | 7 | 8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /VueTestDemo/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 23 | -------------------------------------------------------------------------------- /VueTestDemo/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/VueTestDemo/src/assets/logo.png -------------------------------------------------------------------------------- /VueTestDemo/src/components/Hello.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 21 | -------------------------------------------------------------------------------- /VueTestDemo/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import router from './router' 6 | 7 | Vue.config.productionTip = false 8 | 9 | /* eslint-disable no-new */ 10 | new Vue({ 11 | el: '#app', 12 | router, 13 | template: '', 14 | components: { App } 15 | }) 16 | -------------------------------------------------------------------------------- /VueTestDemo/src/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import Hello from '@/components/Hello' 4 | import Click from '@/components/Click' 5 | 6 | Vue.use(Router) 7 | 8 | export default new Router({ 9 | routes: [ 10 | { 11 | path: '/', 12 | name: 'Click', 13 | component: Click 14 | }, 15 | { 16 | path: '/hello', 17 | name: 'Hello', 18 | component: Hello 19 | } 20 | ] 21 | }) 22 | -------------------------------------------------------------------------------- /VueTestDemo/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/VueTestDemo/static/.gitkeep -------------------------------------------------------------------------------- /VueTestDemo/test/e2e/specs/test.js: -------------------------------------------------------------------------------- 1 | // For authoring Nightwatch tests, see 2 | // http://nightwatchjs.org/guide#usage 3 | 4 | module.exports = { 5 | 'default e2e tests': function (browser) { 6 | // automatically uses dev Server port from /config.index.js 7 | // default: http://localhost:8080 8 | // see nightwatch.conf.js 9 | const devServer = browser.globals.devServerURL 10 | 11 | browser 12 | .url(devServer) 13 | .waitForElementVisible('#app', 5000) 14 | .assert.elementPresent('.hello') 15 | .assert.containsText('h1', 'Welcome to Your Vue.js App') 16 | .assert.elementCount('img', 1) 17 | .end() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /VueTestDemo/test/unit/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "mocha": true 4 | }, 5 | "globals": { 6 | "expect": true, 7 | "sinon": true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /VueTestDemo/test/unit/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | Vue.config.productionTip = false 4 | 5 | // require all test files (files that ends with .spec.js) 6 | const testsContext = require.context('./specs', true, /\.spec$/) 7 | testsContext.keys().forEach(testsContext) 8 | 9 | // require all src files except main.js for coverage. 10 | // you can also change this to match only the subset of files that 11 | // you want coverage for. 12 | const srcContext = require.context('../../src', true, /^\.\/(?!main(\.js)?$)/) 13 | srcContext.keys().forEach(srcContext) 14 | -------------------------------------------------------------------------------- /VuexDemo/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": ["transform-runtime"], 4 | "comments": false 5 | } 6 | -------------------------------------------------------------------------------- /VuexDemo/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /VuexDemo/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /VuexDemo/README.md: -------------------------------------------------------------------------------- 1 | # Vuex Demo 2 | 3 | 本项目写了关于Vuex使用的demo。本demo已经进行过优化,便于学习查看。 4 | 5 | ## 查看效果 6 | 7 | ``` 8 | $ npm install 9 | $ npm run dev 10 | ``` 11 | 12 | ## 文章地址 13 | 14 | [Vue.js学习系列二 —— vuex学习实践笔记(附DEMO)](http://www.jianshu.com/p/d6f7e11f18af) 15 | -------------------------------------------------------------------------------- /VuexDemo/build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /VuexDemo/config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /VuexDemo/config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /VuexDemo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | hellovuex 6 | 7 | 8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /VuexDemo/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/VuexDemo/src/assets/logo.png -------------------------------------------------------------------------------- /VuexDemo/src/components/A.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 18 | -------------------------------------------------------------------------------- /VuexDemo/src/components/Arr.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /VuexDemo/src/components/B.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 19 | -------------------------------------------------------------------------------- /VuexDemo/src/components/Single.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 26 | -------------------------------------------------------------------------------- /VuexDemo/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import Vuex from 'vuex' 6 | import stores from './stores.js' 7 | 8 | Vue.use(Vuex) 9 | 10 | const store = new Vuex.Store(stores) 11 | 12 | /* eslint-disable no-new */ 13 | new Vue({ 14 | el: '#app', 15 | template: '', 16 | components: { App }, 17 | // 将store实例注入到根组件下的所有子组件中 18 | store 19 | // 子组件通过this.$store来方位store 20 | }) 21 | -------------------------------------------------------------------------------- /VuexDemo/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/VuexDemo/static/.gitkeep -------------------------------------------------------------------------------- /WebpackDemos/Demo04/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": ["transform-runtime"], 4 | "comments": false 5 | } 6 | -------------------------------------------------------------------------------- /WebpackDemos/Demo04/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /WebpackDemos/Demo04/app.js: -------------------------------------------------------------------------------- 1 | import bar from "./bar" 2 | 3 | bar() 4 | -------------------------------------------------------------------------------- /WebpackDemos/Demo04/bar.js: -------------------------------------------------------------------------------- 1 | export default function bar () { 2 | console.log("hello world") 3 | } 4 | -------------------------------------------------------------------------------- /WebpackDemos/Demo04/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demo3 6 | 7 | 8 |

hello world

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /WebpackDemos/Demo04/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | entry: "./app.js", 3 | output: { 4 | filename: "bundle.js" 5 | }, 6 | module: { 7 | loaders: [ 8 | { 9 | test: /\.vue$/, 10 | loader: 'vue' 11 | }, 12 | { 13 | test: /\.js$/, 14 | loader: 'babel', 15 | exclude: /node_modules/ 16 | }, 17 | { 18 | test: /\.json$/, 19 | loader: 'json' 20 | } 21 | ] 22 | }, 23 | 24 | } 25 | -------------------------------------------------------------------------------- /WebpackDemos/README.md: -------------------------------------------------------------------------------- 1 | # Webpack学习实例 2 | 3 | * demo01 最简单的webpack打包实例 4 | * demo02 webpack.config实践,使用babel-loader解析es6语法,实现多入口多出口。 5 | * demo03 vue官方cli,分析cli结构 6 | * demo04 逐步实现使用babel-loader解析es6的简单demo 7 | * demo05 vue简易脚手架 8 | 9 | ## 文章地址 10 | 11 | [Vue.js学习系列四 —— Webpack打包工具的使用](http://www.jianshu.com/p/aef34acd111f) -------------------------------------------------------------------------------- /WebpackDemos/demo01/app.js: -------------------------------------------------------------------------------- 1 | console.log("hello app"); 2 | require("./hello.js") 3 | -------------------------------------------------------------------------------- /WebpackDemos/demo01/hello.js: -------------------------------------------------------------------------------- 1 | console.log("hello~~") 2 | -------------------------------------------------------------------------------- /WebpackDemos/demo01/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | demo01 5 | 6 | 7 |

demo01

8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /WebpackDemos/demo02/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": ["transform-runtime"], 4 | "comments": false 5 | } 6 | -------------------------------------------------------------------------------- /WebpackDemos/demo02/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /WebpackDemos/demo02/app/entry.js: -------------------------------------------------------------------------------- 1 | import good from "./good.js" 2 | 3 | console.log("hello entry") 4 | good.helloES6() 5 | -------------------------------------------------------------------------------- /WebpackDemos/demo02/app/good.js: -------------------------------------------------------------------------------- 1 | export default { 2 | helloES6 () { 3 | console.log("hello ES6"); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /WebpackDemos/demo02/app/home.js: -------------------------------------------------------------------------------- 1 | console.log("hello home"); 2 | -------------------------------------------------------------------------------- /WebpackDemos/demo02/app/sign.js: -------------------------------------------------------------------------------- 1 | console.log("hello sign"); 2 | -------------------------------------------------------------------------------- /WebpackDemos/demo02/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | demo01 5 | 6 | 7 |

demo01

8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /WebpackDemos/demo02/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo02", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "webpack.config.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "devDependencies": { 12 | "babel-core": "^6.22.1", 13 | "babel-loader": "^6.2.10", 14 | "babel-plugin-transform-runtime": "^6.22.0", 15 | "babel-preset-es2015": "^6.0.0", 16 | "babel-preset-stage-2": "^6.0.0", 17 | "babel-register": "^6.0.0", 18 | "webpack": "^1.14.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /WebpackDemos/demo02/webpack.config.js: -------------------------------------------------------------------------------- 1 | const webpack = require("webpack") 2 | 3 | module.exports = { 4 | entry: { 5 | //app: ["./app/entry.js", "./app/home.js", "./app/sign.js"], 6 | entry: "./app/entry.js", 7 | home: "./app/home.js", 8 | sign: "./app/sign.js" 9 | }, 10 | output: { 11 | path: __dirname + "/dist", 12 | filename: '[name].js', 13 | }, 14 | module: { 15 | loaders: [ 16 | { 17 | test: /\.js$/, 18 | loader: 'babel', 19 | exclude: /node_modules/ 20 | }, 21 | ] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /WebpackDemos/demo03/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": ["transform-runtime"], 4 | "comments": false, 5 | "env": { 6 | "test": { 7 | "plugins": [ "istanbul" ] 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /WebpackDemos/demo03/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /WebpackDemos/demo03/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /WebpackDemos/demo03/README.md: -------------------------------------------------------------------------------- 1 | # demo03 2 | 3 | > A Vue.js project 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | ``` 17 | 18 | For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 19 | -------------------------------------------------------------------------------- /WebpackDemos/demo03/build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /WebpackDemos/demo03/config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /WebpackDemos/demo03/config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /WebpackDemos/demo03/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | demo03 6 | 7 | 8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /WebpackDemos/demo03/src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 18 | 19 | 29 | -------------------------------------------------------------------------------- /WebpackDemos/demo03/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/WebpackDemos/demo03/src/assets/logo.png -------------------------------------------------------------------------------- /WebpackDemos/demo03/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | 6 | /* eslint-disable no-new */ 7 | new Vue({ 8 | el: '#app', 9 | template: '', 10 | components: { App } 11 | }) 12 | -------------------------------------------------------------------------------- /WebpackDemos/demo03/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/WebpackDemos/demo03/static/.gitkeep -------------------------------------------------------------------------------- /WebpackDemos/demo05/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": ["transform-runtime"], 4 | "comments": false 5 | } 6 | -------------------------------------------------------------------------------- /WebpackDemos/demo05/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /WebpackDemos/demo05/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demo3 6 | 7 | 8 |
9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /WebpackDemos/demo05/src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 18 | 19 | 29 | -------------------------------------------------------------------------------- /WebpackDemos/demo05/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/violetjack/FEProjectDemos/d521f4fb3634f9767984ce87c31ca62579021a8b/WebpackDemos/demo05/src/assets/logo.png -------------------------------------------------------------------------------- /WebpackDemos/demo05/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | 6 | /* eslint-disable no-new */ 7 | new Vue({ 8 | el: '#app', 9 | template: '', 10 | components: { App } 11 | }) 12 | --------------------------------------------------------------------------------