Repository: airyland/vux Branch: v2 Commit: d66ec01d2a76 Files: 971 Total size: 3.1 MB Directory structure: gitextract_8ntehtvf/ ├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .github/ │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE.md │ └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .npmignore ├── .travis.yml ├── LICENSE ├── README.md ├── build/ │ ├── build-components.js │ ├── build-docs.js │ ├── build-main.js │ ├── build-styles.js │ ├── build.js │ ├── check-versions.js │ ├── dev-doc.js │ ├── document.js │ ├── fetch-github.js │ ├── less.js │ ├── pre-publish.js │ ├── simulate.sh │ ├── umd-helper.js │ ├── utils.js │ ├── vue-loader.conf.js │ ├── vux-config.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ ├── webpack.prod.conf.js │ └── webpack.test.conf.js ├── circle.yml ├── config/ │ ├── dev.env.js │ ├── index.js │ ├── prod.env.js │ └── test.env.js ├── docs/ │ ├── 404.md │ ├── about/ │ │ └── version.md │ ├── compile.js │ ├── component-contributors.js │ ├── en/ │ │ ├── .gitkeep │ │ ├── README.md │ │ ├── about/ │ │ │ ├── before-using-vux.md │ │ │ ├── contributors.vue │ │ │ ├── showcase.md │ │ │ └── thanks.md │ │ ├── contribution/ │ │ │ ├── donate.md │ │ │ ├── issue.md │ │ │ ├── pr.md │ │ │ └── vux-development.md │ │ ├── css/ │ │ │ ├── 1px.md │ │ │ └── close.md │ │ ├── css.md │ │ ├── development/ │ │ │ ├── i18n.md │ │ │ ├── remove-click-delay-fastclick.md │ │ │ ├── router.md │ │ │ ├── theme.md │ │ │ ├── typescript.md │ │ │ ├── vue-ajax.md │ │ │ ├── vue-global-method.md │ │ │ ├── vue-google-analytics.md │ │ │ ├── vue-loader-autoprefix.md │ │ │ ├── vue-loader-disable-eslint.md │ │ │ ├── vue-router-page-transition.md │ │ │ ├── vue-show-loading.md │ │ │ ├── vue-webpack-code-splitting-async.md │ │ │ ├── vue-webpack-env.md │ │ │ └── vux-nuxt-ssr.md │ │ ├── directives/ │ │ │ └── v-transfer-dom.md │ │ ├── faq/ │ │ │ ├── $t-is-not-defined.md │ │ │ ├── Uncaught-SyntaxError-Unexpected-token-export.md │ │ │ ├── can-vux-used-in-weapp.md │ │ │ ├── cannot-resolve-inline-desc.md │ │ │ ├── difference-between-vux-template-and-webpack-template.md │ │ │ ├── document-framework.md │ │ │ ├── does-vux-support-weex.md │ │ │ ├── dupicate-style.md │ │ │ ├── is-vux-wechat-official-project.md │ │ │ ├── vux-build-issue.md │ │ │ ├── vux-server-render-support.md │ │ │ ├── what-is-vux-virtual-component.md │ │ │ ├── why-cannot-i-import-all-components.md │ │ │ ├── why-cannot-i-use-vux-with-cdn.md │ │ │ ├── why-close-my-issue.md │ │ │ ├── why-delete-my-issue-comment.md │ │ │ ├── why-use-vue-file-for-distribution.md │ │ │ ├── why-use-x-prefix-for-components.md │ │ │ ├── why-using-vux-loader.md │ │ │ └── will-vux-stop-maintaining.md │ │ ├── install/ │ │ │ ├── biolerplate.md │ │ │ ├── manual-usage.md │ │ │ ├── npm.md │ │ │ ├── umd.md │ │ │ ├── upgrade-to-vux2.md │ │ │ └── usage.md │ │ ├── lab/ │ │ │ └── index.md │ │ ├── production/ │ │ │ └── inline-manifest.md │ │ ├── tools/ │ │ │ ├── base64.md │ │ │ ├── cookie.md │ │ │ ├── date.md │ │ │ ├── debounce-throttle.md │ │ │ ├── md5.md │ │ │ ├── number.md │ │ │ ├── querystring.md │ │ │ └── string.md │ │ ├── umd.md │ │ ├── upgrade-to-2.md │ │ ├── vux-loader/ │ │ │ ├── about.md │ │ │ ├── how-vux-loader-works.md │ │ │ ├── install.md │ │ │ └── plugins.md │ │ ├── vux-loader.md │ │ └── wechat/ │ │ ├── other.md │ │ ├── vue-wechat-jssdk.md │ │ └── wechat-document-title.md │ ├── examples/ │ │ ├── loading.html │ │ ├── umd_component_include_all.html │ │ ├── umd_component_include_single.html │ │ ├── umd_plugin_include_all.html │ │ └── umd_plugin_include_single.html │ ├── i18n.js │ ├── index.html │ ├── package.json │ ├── ream.config.js │ ├── server.js │ ├── src/ │ │ ├── App.vue │ │ ├── algolia-search.vue │ │ ├── app.css │ │ ├── component.vue │ │ ├── index.js │ │ ├── summary.js │ │ ├── tool-routes-en.json │ │ └── tool-routes-zh-CN.json │ ├── watch.js │ └── zh-CN/ │ ├── README.md │ ├── about/ │ │ ├── before-using-vux.md │ │ ├── contributors.vue │ │ ├── showcase.md │ │ └── thanks.md │ ├── contribution/ │ │ ├── donate.md │ │ ├── issue.md │ │ ├── pr.md │ │ └── vux-development.md │ ├── css/ │ │ ├── 1px.md │ │ └── close.md │ ├── css.md │ ├── development/ │ │ ├── i18n.md │ │ ├── remove-click-delay-fastclick.md │ │ ├── router.md │ │ ├── theme.md │ │ ├── typescript.md │ │ ├── vue-ajax.md │ │ ├── vue-global-method.md │ │ ├── vue-google-analytics.md │ │ ├── vue-loader-autoprefix.md │ │ ├── vue-loader-disable-eslint.md │ │ ├── vue-router-page-transition.md │ │ ├── vue-show-loading.md │ │ ├── vue-webpack-code-splitting-async.md │ │ ├── vue-webpack-env.md │ │ └── vux-nuxt-ssr.md │ ├── directives/ │ │ └── v-transfer-dom.md │ ├── faq/ │ │ ├── $t-is-not-defined.md │ │ ├── Uncaught-SyntaxError-Unexpected-token-export.md │ │ ├── can-vux-used-in-weapp.md │ │ ├── cannot-resolve-inline-desc.md │ │ ├── difference-between-vux-template-and-webpack-template.md │ │ ├── document-framework.md │ │ ├── does-vux-support-weex.md │ │ ├── dupicate-style.md │ │ ├── is-vux-wechat-official-project.md │ │ ├── vux-build-issue.md │ │ ├── vux-server-render-support.md │ │ ├── what-is-vux-virtual-component.md │ │ ├── why-cannot-i-import-all-components.md │ │ ├── why-cannot-i-use-vux-with-cdn.md │ │ ├── why-close-my-issue.md │ │ ├── why-delete-my-issue-comment.md │ │ ├── why-use-vue-file-for-distribution.md │ │ ├── why-use-x-prefix-for-components.md │ │ ├── why-using-vux-loader.md │ │ └── will-vux-stop-maintaining.md │ ├── install/ │ │ ├── biolerplate.md │ │ ├── manual-usage.md │ │ ├── npm.md │ │ ├── umd.md │ │ ├── upgrade-to-vux2.md │ │ └── usage.md │ ├── lab/ │ │ └── index.md │ ├── production/ │ │ └── inline-manifest.md │ ├── tools/ │ │ ├── base64.md │ │ ├── cookie.md │ │ ├── date.md │ │ ├── debounce-throttle.md │ │ ├── md5.md │ │ ├── number.md │ │ ├── querystring.md │ │ └── string.md │ ├── umd.md │ ├── upgrade-to-2.md │ ├── vux-loader/ │ │ ├── about.md │ │ ├── how-vux-loader-works.md │ │ ├── install.md │ │ └── plugins.md │ ├── vux-loader.md │ └── wechat/ │ ├── other.md │ ├── vue-wechat-jssdk.md │ └── wechat-document-title.md ├── index.html ├── index.js ├── package.json ├── packages/ │ ├── loader/ │ │ ├── README.md │ │ ├── libs/ │ │ │ ├── get-i18n-block.js │ │ │ ├── parse-i18n-function.js │ │ │ └── replace-i18n-for-script.js │ │ ├── package.json │ │ ├── parse.js │ │ ├── plugins/ │ │ │ ├── duplicate-style/ │ │ │ │ └── index.js │ │ │ └── html-build-callback/ │ │ │ └── index.js │ │ ├── src/ │ │ │ ├── after-less-loader.js │ │ │ ├── before-template-compiler-loader.js │ │ │ ├── i18n-loader.js │ │ │ ├── index.js │ │ │ ├── js-loader.js │ │ │ ├── libs/ │ │ │ │ ├── babel-transform-imports/ │ │ │ │ │ ├── .babelrc │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── README.md │ │ │ │ │ ├── index.js │ │ │ │ │ ├── package.json │ │ │ │ │ └── test/ │ │ │ │ │ ├── invalidTransform.js │ │ │ │ │ ├── tests.js │ │ │ │ │ └── transform.js │ │ │ │ ├── get-less-variables.js │ │ │ │ ├── getTag.js │ │ │ │ ├── import-parser-v2.js │ │ │ │ ├── import-parser.js │ │ │ │ ├── parse-demo-code.js │ │ │ │ ├── parse-virtual-component.js │ │ │ │ ├── parse-x-icon.js │ │ │ │ ├── report.js │ │ │ │ └── stripe-attributes.js │ │ │ ├── noop-loader.js │ │ │ ├── script-loader.js │ │ │ ├── style-loader.js │ │ │ └── template-loader.js │ │ └── test/ │ │ ├── fixtures/ │ │ │ ├── basic.vue │ │ │ ├── css-modules.vue │ │ │ ├── es2015.vue │ │ │ ├── extend.vue │ │ │ ├── extract-css.vue │ │ │ ├── inject.js │ │ │ ├── inject.vue │ │ │ ├── media-query.vue │ │ │ ├── postcss.vue │ │ │ ├── pre.vue │ │ │ ├── resolve.vue │ │ │ ├── scoped-css.vue │ │ │ ├── script-import.js │ │ │ ├── script-import.vue │ │ │ ├── service.js │ │ │ ├── style-import-scoped.css │ │ │ ├── style-import.css │ │ │ ├── style-import.vue │ │ │ ├── template-import.pug │ │ │ └── template-import.vue │ │ ├── test.js │ │ └── vux-fixtures/ │ │ ├── less-theme-001.less │ │ ├── less-theme-002.less │ │ ├── less-theme-basic.less │ │ ├── less-theme-basic.vue │ │ ├── less-theme-import.less │ │ ├── option-vux-dir.vue │ │ ├── script-parser-fn.vue │ │ ├── style-parser-basic.vue │ │ ├── template-feature-switch-basic.vue │ │ └── template-parser-fn.vue │ └── vue-cli-3-example/ │ ├── .browserslistrc │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── package.json │ ├── postcss.config.js │ ├── public/ │ │ └── index.html │ ├── src/ │ │ ├── App.vue │ │ ├── components/ │ │ │ ├── HelloWorld.js │ │ │ └── HelloWorld.vue │ │ ├── main.js │ │ ├── router.js │ │ ├── store.js │ │ ├── theme.less │ │ └── views/ │ │ ├── About.vue │ │ └── Home.vue │ └── vue.config.js ├── src/ │ ├── App.vue │ ├── components/ │ │ ├── actionsheet/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── agree/ │ │ │ ├── index.vue │ │ │ └── test.js │ │ ├── alert/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── badge/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── blur/ │ │ │ ├── blur.js │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── box/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── button-tab/ │ │ │ ├── button-tab-item.vue │ │ │ ├── button-tab.vue │ │ │ ├── index.js │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── calendar/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── card/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── cell/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ ├── props.js │ │ │ ├── test/ │ │ │ │ └── wrapper.vue │ │ │ └── test.js │ │ ├── cell-box/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── cell-form-preview/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── check-icon/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── checker/ │ │ │ ├── checker-item.vue │ │ │ ├── checker.vue │ │ │ ├── index.js │ │ │ └── metas.yml │ │ ├── checklist/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ ├── object-filter.js │ │ │ └── test.js │ │ ├── clocker/ │ │ │ ├── clocker.js │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── color-picker/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── confirm/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── countdown/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── countup/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── datetime/ │ │ │ ├── datetimepicker.js │ │ │ ├── format.js │ │ │ ├── index.vue │ │ │ ├── makeData.js │ │ │ ├── metas.yml │ │ │ ├── style.less │ │ │ ├── test.js │ │ │ └── util.js │ │ ├── datetime-range/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── datetime-view/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── dev-tip/ │ │ │ └── index.vue │ │ ├── divider/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── drawer/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── flexbox/ │ │ │ ├── flexbox-item.vue │ │ │ ├── flexbox.vue │ │ │ ├── index.js │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── flow/ │ │ │ ├── flow-line.vue │ │ │ ├── flow-state.vue │ │ │ ├── flow.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── form-preview/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── fullpage/ │ │ │ ├── DemoBasic.vue │ │ │ ├── index.vue │ │ │ └── lib.js │ │ ├── grid/ │ │ │ ├── grid-item.vue │ │ │ ├── grid.vue │ │ │ ├── index.js │ │ │ └── metas.yml │ │ ├── group/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── group-title/ │ │ │ ├── index.vue │ │ │ └── test.js │ │ ├── icon/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── inline-calendar/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ ├── props.js │ │ │ ├── test.js │ │ │ └── util.js │ │ ├── inline-desc/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── inline-loading/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── inline-x-number/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── inline-x-switch/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── style.less │ │ ├── load-more/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── loading/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── map.json │ │ ├── marquee/ │ │ │ ├── marquee-item.vue │ │ │ ├── marquee.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── masker/ │ │ │ ├── converter.js │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── metas.yml │ │ ├── msg/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── number-roller/ │ │ │ ├── index.vue │ │ │ └── lib.js │ │ ├── orientation/ │ │ │ ├── index.js │ │ │ └── orientation.js │ │ ├── panel/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── picker/ │ │ │ ├── animate.js │ │ │ ├── chain.js │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ ├── scroller.css │ │ │ ├── scroller.js │ │ │ ├── test.js │ │ │ └── util.js │ │ ├── popover/ │ │ │ ├── DemoIndex.vue │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── popup/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ ├── popup.js │ │ │ └── test.js │ │ ├── popup-header/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── popup-picker/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── popup-radio/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── previewer/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── qrcode/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── radio/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ ├── props.js │ │ │ └── test.js │ │ ├── range/ │ │ │ ├── index.vue │ │ │ ├── lib/ │ │ │ │ ├── classes.js │ │ │ │ ├── closest.js │ │ │ │ ├── delegate.js │ │ │ │ ├── emitter.js │ │ │ │ ├── event.js │ │ │ │ ├── events.js │ │ │ │ ├── matches-selector.js │ │ │ │ ├── mouse.js │ │ │ │ └── query.js │ │ │ ├── metas.yml │ │ │ ├── powerange.js │ │ │ ├── powerange.less │ │ │ └── utils.js │ │ ├── rater/ │ │ │ ├── index.vue │ │ │ └── metas.yml │ │ ├── scroller/ │ │ │ ├── index.vue │ │ │ └── metas.yml │ │ ├── search/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── selector/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── shake/ │ │ │ └── index.vue │ │ ├── spinner/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ ├── requestAnimationFrame.js │ │ │ └── spinner.js │ │ ├── step/ │ │ │ ├── index.js │ │ │ ├── metas.yml │ │ │ ├── step-item.vue │ │ │ └── step.vue │ │ ├── sticky/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── sticky.js │ │ ├── swipeout/ │ │ │ ├── index.js │ │ │ ├── metas.yml │ │ │ ├── swipeout-button.vue │ │ │ ├── swipeout-item.vue │ │ │ └── swipeout.vue │ │ ├── swiper/ │ │ │ ├── index.js │ │ │ ├── metas.yml │ │ │ ├── swiper-item.vue │ │ │ ├── swiper.js │ │ │ └── swiper.vue │ │ ├── tab/ │ │ │ ├── index.js │ │ │ ├── metas.yml │ │ │ ├── tab-item.vue │ │ │ └── tab.vue │ │ ├── tabbar/ │ │ │ ├── index.js │ │ │ ├── metas.yml │ │ │ ├── tabbar-item.vue │ │ │ └── tabbar.vue │ │ ├── timeline/ │ │ │ ├── index.js │ │ │ ├── metas.yml │ │ │ ├── timeline-item.vue │ │ │ └── timeline.vue │ │ ├── tip/ │ │ │ └── index.vue │ │ ├── toast/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── uploader/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── utils.js │ │ ├── v-chart/ │ │ │ ├── metas.yml │ │ │ ├── mixin.js │ │ │ ├── util.js │ │ │ ├── v-area.vue │ │ │ ├── v-axis.vue │ │ │ ├── v-bar.vue │ │ │ ├── v-chart.vue │ │ │ ├── v-guide.vue │ │ │ ├── v-legend.vue │ │ │ ├── v-line.vue │ │ │ ├── v-pie.vue │ │ │ ├── v-point.vue │ │ │ ├── v-scale.vue │ │ │ └── v-tooltip.vue │ │ ├── video/ │ │ │ ├── index.vue │ │ │ ├── zy.media.css │ │ │ └── zy.media.js │ │ ├── view-box/ │ │ │ ├── index.vue │ │ │ └── metas.yml │ │ ├── wechat-emotion/ │ │ │ ├── index.vue │ │ │ └── metas.yml │ │ ├── week-calendar/ │ │ │ └── index.vue │ │ ├── wepay-input/ │ │ │ └── index.vue │ │ ├── x-address/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── x-button/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── x-circle/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── x-dialog/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── x-form/ │ │ │ ├── field.vue │ │ │ ├── form.vue │ │ │ ├── index.js │ │ │ └── metas.yml │ │ ├── x-header/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── x-hr/ │ │ │ └── index.vue │ │ ├── x-icon/ │ │ │ └── metas.yml │ │ ├── x-img/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── x-input/ │ │ │ ├── fixtures/ │ │ │ │ └── Mask.vue │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── x-number/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── x-progress/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── x-switch/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ ├── x-table/ │ │ │ ├── index.vue │ │ │ ├── metas.yml │ │ │ └── test.js │ │ └── x-textarea/ │ │ ├── index.vue │ │ ├── metas.yml │ │ └── test.js │ ├── datas/ │ │ ├── china_address.json │ │ ├── china_address_v1.json │ │ ├── china_address_v2.json │ │ ├── china_address_v3.json │ │ ├── china_address_v4.json │ │ └── vux_component_list.json │ ├── demo_list.json │ ├── demos/ │ │ ├── Actionsheet.vue │ │ ├── Agree.vue │ │ ├── Alert.vue │ │ ├── AppTest.vue │ │ ├── Badge.vue │ │ ├── Blur.vue │ │ ├── ButtonTab.vue │ │ ├── Calendar.vue │ │ ├── Card.vue │ │ ├── Cell.vue │ │ ├── CellBox.vue │ │ ├── CellFormPreview.vue │ │ ├── Center.vue │ │ ├── CheckIcon.vue │ │ ├── Checker.vue │ │ ├── Checklist.vue │ │ ├── Clocker.vue │ │ ├── Close.vue │ │ ├── ColorPicker.vue │ │ ├── Comment.vue │ │ ├── Confirm.vue │ │ ├── Countdown.vue │ │ ├── Countup.vue │ │ ├── Datetime.vue │ │ ├── DatetimeRange.vue │ │ ├── DatetimeView.vue │ │ ├── Demo.vue │ │ ├── DemoList.vue │ │ ├── Device.vue │ │ ├── Divider.vue │ │ ├── Donate.vue │ │ ├── Drawer.vue │ │ ├── Flexbox.vue │ │ ├── Flow.vue │ │ ├── FormPreview.vue │ │ ├── FormatTime.vue │ │ ├── Grid.vue │ │ ├── GridComponent.vue │ │ ├── GridNumber.vue │ │ ├── Group.vue │ │ ├── Home.vue │ │ ├── Icon.vue │ │ ├── IconLoading.vue │ │ ├── Inline-calendar-start-date.vue │ │ ├── InlineCalendar.vue │ │ ├── InlineCalendarEachDaySlot.vue │ │ ├── InlineCalendarMulti.vue │ │ ├── InlineLoading.vue │ │ ├── InlineXNumber.vue │ │ ├── InlineXSwitch.vue │ │ ├── Issue1211.vue │ │ ├── Issue189.vue │ │ ├── Issue2365.vue │ │ ├── Issue2960.vue │ │ ├── Issue461.vue │ │ ├── Issue471.vue │ │ ├── Issue598.vue │ │ ├── Issue624.vue │ │ ├── Issue649.vue │ │ ├── Issue702.vue │ │ ├── Issue833.vue │ │ ├── Issue865.vue │ │ ├── Line.vue │ │ ├── LoadMore.vue │ │ ├── Loading.vue │ │ ├── Marquee.vue │ │ ├── Masker.vue │ │ ├── Msg.vue │ │ ├── NotFoundComponent.vue │ │ ├── NumberRoller.vue │ │ ├── OnePx.vue │ │ ├── Panel.vue │ │ ├── Picker.vue │ │ ├── Popover.vue │ │ ├── Popup.vue │ │ ├── PopupHeader.vue │ │ ├── PopupPicker.vue │ │ ├── PopupRadio.vue │ │ ├── Previewer.vue │ │ ├── Pulldown.vue │ │ ├── PulldownPullup.vue │ │ ├── Pullup.vue │ │ ├── Qrcode.vue │ │ ├── Querystring.vue │ │ ├── Radio.vue │ │ ├── Range.vue │ │ ├── Rater.vue │ │ ├── Reddot.vue │ │ ├── Scroller.vue │ │ ├── ScrollerFull.vue │ │ ├── ScrollerHeader.vue │ │ ├── ScrollerSwiper.vue │ │ ├── Search.vue │ │ ├── SearchStatic.vue │ │ ├── Selector.vue │ │ ├── Shake.vue │ │ ├── Spinner.vue │ │ ├── Step.vue │ │ ├── Sticky.vue │ │ ├── Swipeout.vue │ │ ├── Swiper.vue │ │ ├── Tab.vue │ │ ├── Tabbar.vue │ │ ├── TabbarIcon.vue │ │ ├── TabbarLink.vue │ │ ├── TabbarSimple.vue │ │ ├── Test.vue │ │ ├── Thanks.vue │ │ ├── Timeline.vue │ │ ├── Toast.vue │ │ ├── ToggleText.vue │ │ ├── Uploader.vue │ │ ├── ViewBox.vue │ │ ├── Wechat.vue │ │ ├── WechatEmotion.vue │ │ ├── WeekCalendar.vue │ │ ├── WepayInput.vue │ │ ├── XAddress.vue │ │ ├── XButton.vue │ │ ├── XCircle.vue │ │ ├── XDialog.vue │ │ ├── XForm.vue │ │ ├── XHeader.vue │ │ ├── XHr.vue │ │ ├── XIcon.vue │ │ ├── XImg.vue │ │ ├── XImgPopup.vue │ │ ├── XImgScroller.vue │ │ ├── XInput.vue │ │ ├── XNumber.vue │ │ ├── XProgress.vue │ │ ├── XSwitch.vue │ │ ├── XTable.vue │ │ ├── XTextarea.vue │ │ ├── countdown/ │ │ │ ├── basic.vue │ │ │ └── manually.vue │ │ ├── style.css │ │ ├── v-chart/ │ │ │ ├── area_basic.vue │ │ │ ├── area_compare.json │ │ │ ├── area_compare.vue │ │ │ ├── area_empty.json │ │ │ ├── area_empty.vue │ │ │ ├── area_gradient.vue │ │ │ ├── area_negative.vue │ │ │ ├── area_stack.vue │ │ │ ├── bar_basic.vue │ │ │ ├── bar_percent.vue │ │ │ ├── bar_series.vue │ │ │ ├── bar_stack.vue │ │ │ ├── line_basic.vue │ │ │ ├── line_color.json │ │ │ ├── line_color.vue │ │ │ ├── line_gradient.vue │ │ │ ├── line_realtime.vue │ │ │ ├── line_smooth_with_dot.vue │ │ │ ├── line_with_dot.vue │ │ │ ├── pie_annular.vue │ │ │ ├── pie_basic.vue │ │ │ ├── point.json │ │ │ ├── point.vue │ │ │ └── prevent_render.vue │ │ └── x-circle/ │ │ ├── basic.vue │ │ └── gradient.vue │ ├── directives/ │ │ ├── click-outside/ │ │ │ └── index.js │ │ ├── inview/ │ │ │ ├── index.js │ │ │ └── inview.js │ │ └── transfer-dom/ │ │ ├── index.js │ │ └── metas.yml │ ├── faq-routes.json │ ├── filters/ │ │ ├── array2String.js │ │ ├── format-time.js │ │ ├── friendly-time.js │ │ ├── name2value.js │ │ └── value2name.js │ ├── libs/ │ │ ├── base.js │ │ ├── clean-style.js │ │ ├── dom.js │ │ ├── eventor.js │ │ ├── get-parent-prop.js │ │ ├── is-array.js │ │ ├── mixin_uuid.js │ │ ├── passive_supported.js │ │ ├── plugin_helper.js │ │ ├── router.js │ │ ├── trim.js │ │ └── webp-support.js │ ├── lints/ │ │ └── shouleBeInGroup.js │ ├── locales/ │ │ ├── all.yml │ │ ├── en.yml │ │ └── zh-CN.yml │ ├── main.js │ ├── mixins/ │ │ ├── calendar-marks.js │ │ ├── multi-items.js │ │ ├── prevent-body-scroll.js │ │ ├── safari-fix.js │ │ └── uuid.js │ ├── plugins/ │ │ ├── ajax/ │ │ │ ├── index.js │ │ │ └── metas.yml │ │ ├── alert/ │ │ │ ├── index.js │ │ │ ├── module.js │ │ │ └── util.js │ │ ├── app/ │ │ │ └── index.js │ │ ├── bus/ │ │ │ ├── index.js │ │ │ └── metas.yml │ │ ├── close-dialogs/ │ │ │ ├── index.js │ │ │ └── metas.yml │ │ ├── config/ │ │ │ └── index.js │ │ ├── confirm/ │ │ │ └── index.js │ │ ├── datetime/ │ │ │ ├── index.js │ │ │ └── metas.yml │ │ ├── device/ │ │ │ ├── doc.md │ │ │ └── index.js │ │ ├── loading/ │ │ │ ├── index.js │ │ │ ├── metas.yaml │ │ │ ├── module.js │ │ │ └── util.js │ │ ├── locale/ │ │ │ └── index.js │ │ ├── toast/ │ │ │ ├── index.js │ │ │ └── metas.yaml │ │ └── wechat/ │ │ ├── 1.3.0.js │ │ ├── 1.3.2.js │ │ ├── index.js │ │ ├── metas.yml │ │ ├── origin.1.3.0.js │ │ └── origin.1.3.2.js │ ├── styles/ │ │ ├── 1px.less │ │ ├── 1px.yml │ │ ├── blank.less │ │ ├── center.less │ │ ├── close.less │ │ ├── close.yml │ │ ├── doc.md │ │ ├── index.less │ │ ├── index.vue │ │ ├── loading.less │ │ ├── reddot.less │ │ ├── reset.less │ │ ├── tap.less │ │ ├── transition.less │ │ ├── variable.less │ │ ├── vux-modal.css │ │ └── weui/ │ │ ├── base/ │ │ │ ├── fn.less │ │ │ ├── mixin/ │ │ │ │ ├── mobile.less │ │ │ │ ├── setArrow.less │ │ │ │ ├── setChecked.less │ │ │ │ ├── setOnepx.less │ │ │ │ └── text.less │ │ │ ├── reset.less │ │ │ └── variable/ │ │ │ ├── color.less │ │ │ ├── global.less │ │ │ ├── weui-cell.less │ │ │ ├── weui-dialog.less │ │ │ ├── weui_button.less │ │ │ ├── weui_grid.less │ │ │ ├── weui_msg.less │ │ │ └── weui_progress.less │ │ ├── icon/ │ │ │ ├── weui_font.less │ │ │ └── weui_icon_font.less │ │ ├── weui.less │ │ └── widget/ │ │ ├── weui-agree/ │ │ │ └── weui-agree.less │ │ ├── weui-animate/ │ │ │ └── weui-animate.less │ │ ├── weui-button/ │ │ │ ├── weui-btn_default.less │ │ │ ├── weui-btn_disabled.less │ │ │ ├── weui-btn_global.less │ │ │ ├── weui-btn_loading.less │ │ │ ├── weui-btn_plain.less │ │ │ ├── weui-btn_primary.less │ │ │ ├── weui-btn_warn.less │ │ │ └── weui-button.less │ │ ├── weui-flex/ │ │ │ └── weui-flex.less │ │ ├── weui-footer/ │ │ │ └── weui-footer.less │ │ ├── weui-grid/ │ │ │ └── weui-grid.less │ │ ├── weui-loading/ │ │ │ └── weui-loading.less │ │ ├── weui-picker/ │ │ │ └── weui-picker.less │ │ ├── weui-slider.less/ │ │ │ └── weui-slider.less │ │ ├── weui-uploader/ │ │ │ └── index.less │ │ ├── weui_cell/ │ │ │ ├── weui-gallery.less │ │ │ ├── weui_access.less │ │ │ ├── weui_cell_global.less │ │ │ ├── weui_check/ │ │ │ │ ├── weui_check_common.less │ │ │ │ ├── weui_checkbox.less │ │ │ │ └── weui_radio.less │ │ │ ├── weui_check.less │ │ │ ├── weui_form/ │ │ │ │ ├── weui-form-preview.less │ │ │ │ ├── weui_form_common.less │ │ │ │ ├── weui_select.less │ │ │ │ └── weui_vcode.less │ │ │ ├── weui_form.less │ │ │ ├── weui_switch.less │ │ │ └── weui_uploader.less │ │ ├── weui_media_box/ │ │ │ └── weui_media_box.less │ │ ├── weui_page/ │ │ │ ├── weui_article.less │ │ │ └── weui_msg.less │ │ ├── weui_panel/ │ │ │ └── weui_panel.less │ │ ├── weui_progress/ │ │ │ └── weui_progress.less │ │ ├── weui_searchbar/ │ │ │ └── weui_searchbar.less │ │ ├── weui_tab/ │ │ │ ├── navbar.less │ │ │ ├── vux-tabbar.less │ │ │ ├── weui-tabbar.less │ │ │ ├── weui_tab.less │ │ │ └── weui_tab_tabbar.less │ │ └── weui_tips/ │ │ ├── weui-badge.less │ │ ├── weui-loadmore.less │ │ ├── weui_actionsheet.less │ │ ├── weui_dialog.less │ │ ├── weui_mask.less │ │ └── weui_toast.less │ ├── theme.less │ ├── tools/ │ │ ├── base64/ │ │ │ └── index.js │ │ ├── cookie/ │ │ │ ├── index.js │ │ │ └── metas.yml │ │ ├── date/ │ │ │ ├── format.js │ │ │ ├── metas.yml │ │ │ └── range.js │ │ ├── debounce/ │ │ │ ├── index.js │ │ │ └── metas.yml │ │ ├── md5/ │ │ │ ├── index.js │ │ │ └── metas.yml │ │ ├── number/ │ │ │ ├── comma.js │ │ │ ├── metas.yml │ │ │ ├── pad.js │ │ │ ├── random.js │ │ │ └── range.js │ │ ├── querystring/ │ │ │ └── index.js │ │ ├── string/ │ │ │ ├── metas.yml │ │ │ └── trim.js │ │ ├── throttle/ │ │ │ ├── index.js │ │ │ └── metas.yml │ │ └── validator/ │ │ └── chinaMobile.js │ └── vuex/ │ └── store.js ├── ssr/ │ └── nuxt/ │ ├── .babelrc │ ├── layouts/ │ │ └── default.vue │ ├── nuxt.config.js │ ├── package.json │ ├── pages/ │ │ └── index.vue │ ├── plugins/ │ │ ├── vux-components.js │ │ └── vux-plugins.js │ └── styles/ │ └── theme.less ├── static/ │ └── .gitkeep └── test/ └── unit/ ├── dateFormat.spec.js ├── index.js └── karma.conf.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .babelrc ================================================ { "presets": [ ["es2015", { "modules": false }], "stage-2" ], "plugins": ["transform-runtime"], "comments": false, "env": { "test": { "plugins": [ "istanbul" ] } } } ================================================ FILE: .editorconfig ================================================ root = true [*] charset = utf-8 indent_style = space indent_size = 2 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true ================================================ FILE: .eslintignore ================================================ build/*.js src/assets/*/*.js src/libs/eventor.js config/*.js src/tools/*/*.js src/components/video/zy.media.js src/plugins/wechat/1.3.0.js src/plugins/wechat/1.3.2.js src/plugins/wechat/origin.1.3.0.js src/plugins/wechat/origin.1.3.2.js ================================================ FILE: .eslintrc.js ================================================ module.exports = { root: true, parser: 'babel-eslint', parserOptions: { sourceType: 'module' }, // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style extends: 'standard', globals: {'expect': true, 'it': true, 'describe': true, 'ga': true, 'window': true, 'document': true, 'alert': true, 'api': true, 'apiready': true}, env: { browser: true }, // required to lint *.vue files plugins: [ 'html' ], // add your custom rules here 'rules': { 'eol-last': 0, // allow paren-less arrow functions 'arrow-parens': 0, // allow async-await 'generator-star-spacing': 0, // allow debugger during development 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 } } ================================================ FILE: .github/FUNDING.yml ================================================ github: [airyland] ================================================ FILE: .github/ISSUE_TEMPLATE.md ================================================ ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ Please makes sure the items are checked before submitting your PR, thank you! * [ ] `Rebase` before creating a PR to keep commit history clear. * [ ] `Only One commit` * [ ] No `eslint` errors ================================================ FILE: .gitignore ================================================ .DS_Store node_modules/ bower_components/ npm-debug.log /demo build/milestone.json examples/webpack/ .idea dist/components-commonjs/ /site /docs/changes /docs/demos /docs/**/faq/index.md /docs/**/components /docs/**/demos /docs/**/changelog /docs/.ream/ *.vue.vux.* src/locales/components.yml /dist/**/* src/components/index.js test/unit/coverage/ docs/*.map v2/ changes.json .nuxt/ docs/releases.json docs/src/routes.json docs/src/faq-routes.json docs/src/tool-routes.json docs/src/_index.js docs/sitemap.txt docs/algolia.json /src/demos/**/_index.vue yarn-error.log .vscode ================================================ FILE: .npmignore ================================================ build/ demo/ dist/ docs/ node_modules/ packages/ examples/ test/ /src/*.vue /src/*.js /src/*.html /src/assets/ /src/demos/ favicon.ico logo.png CNAME circle.yml bower.json /assets/ .babelrc docs/ *.vue.vux.* nuxt/ yarn.lock ================================================ FILE: .travis.yml ================================================ language: node_js node_js: - 7 os: linux cache: yarn: true branches: only: - v2 install: - | yarn install script: - | npm run lint && npm run test after_success: - | cat ./test/unit/coverage/lcov.info | ./node_modules/.bin/codecov ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2016-present, Airyland Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================
Be Cool with Vue@^2.3.0 and WeUI.
## Sponsors ## Requirements + vue@^2.3.0(for .sync modifier) + webpack@^2.0 + node@^7.6(development) ## Docs + [中文文档](https://vux.li/) + English(working) ## Quick Start > [vux2 template](https://github.com/airyland/vux2) is directly modified from Vue official [webpack template](https://github.com/vuejs-templates/webpack). ``` bash npm install vue-cli -g vue init airyland/vux2 projectPath cd projectPath npm install // or yarn npm run dev // or yarn dev ``` ## Maintainers + [airyland](https://github.com/airyland) + [lichunqiang](https://github.com/lichunqiang) + [graysheeep](https://github.com/graysheeep) + [unclay](https://github.com/unclay) + [wg5945](https://github.com/wg5945) + [Sapphire2k](https://github.com/Sapphire2k) ## Vux is Inspired or Powered By: + [Vue](https://github.com/vuejs/vue) + [WeUI](https://github.com/weui/weui) + [FrozenUI](https://github.com/frozenui/frozenui) + [Ant Design](https://github.com/ant-design/ant-design) + [Ant Design Mobile](http://github.com/ant-design/ant-design-mobile) + [XScroll](https://github.com/huxiaoqi567/xscroll) + [Ionic](https://github.com/driftyco/ionic) + [SUI Mobile](https://github.com/sdc-alibaba/SUI-Mobile) + [PhotoSwipe](https://github.com/dimsemenov/PhotoSwipe) + [WePayUI](https://github.com/wepayui/wepayui) + [autosize](https://github.com/jackmoore/autosize)(MIT) + [buefy](https://github.com/buefy/buefy) ## License [MIT](https://github.com/airyland/vux/blob/v2/LICENSE) ================================================ FILE: build/build-components.js ================================================ 'use strict' process.env.NODE_ENV = 'production' /** * --locale='zh-CN' * --namespace='vux' * --components=Group,Cell */ var argv = require('yargs').argv var namespace = argv.namespace || 'vux' const { build } = require('./umd-helper') var isBuildAll = !argv.components var buildComponents = argv.components ? argv.components.split(',') : [] let config = require('./webpack.prod.conf.js') const vuxConfig = require('./vux-config') vuxConfig.plugins.forEach(function (plugin) { if (plugin.name === 'i18n') { plugin.vuxStaticReplace = true plugin.vuxLocale = argv['locale'] || 'zh-CN' } }) const webpack = require('webpack') const mkdirp = require('mkdirp') const fs = require('fs') const touch = require('touch') const path = require('path') mkdirp.sync(path.resolve(__dirname, '../dist/plugins')) mkdirp.sync(path.resolve(__dirname, '../dist/styles')) let list = require(path.resolve(__dirname, '../src/datas/vux_component_list.json')) const maps = require(path.resolve(__dirname, '../src/components/map.json')) // 查找在maps里但不在list里的组件 let others = [] for (let i in maps) { let match = list.filter(function (one) { return _camelCase(one.name) === i }) if (match.length === 0 && !/Plugin|Data|Directive|Filter|Item|NOTICE|Demo|Dev|Tool|String|Number|number|format|md5|base64|cookie/.test(i)) { others.push({ name: toDash(i), importName: i, path: maps[i] }) } } others.push({ name: 'swiper-item', importName: 'SwiperItem', path: maps['SwiperItem'] }) var ExtractTextPlugin = require('extract-text-webpack-plugin') var co = require('co') var thunkify = require('thunkify') var pkg = require(path.resolve(__dirname, '../package.json')) var utils = require('./utils') config.devtool = false config.plugins = config.plugins.slice(0, -2) config.plugins.forEach((one, index) => { if (one.constructor.name === 'HtmlWebpackPlugin') { config.plugins.splice(index, 1) } if (one.constructor.name === 'ExtractTextPlugin') { config.plugins.splice(index, 1) } }) config.output.assetsPublicPath = '/' let isBuilding = false co(function* () { if (!buildComponents.length) { try { yield build(buildMainConfig(), 'vux') } catch (e) { console.log(e) } try { for (let n = 0; n < others.length; n++) { yield build(buildConfig(others[n]), others[n].name) } } catch (e) { console.log(e) } try { const pluginList = ['Confirm', 'Toast', 'Device', 'Alert', 'Loading', ' Wechat', 'Ajax'] for (let j = 0; j < pluginList.length; j++) { yield build(buildPlugin(pluginList[j]), `Plugin ${pluginList[j]}`) } } catch (e) { console.log(e) } } if (buildComponents.length) { list = list.filter(function (one) { return buildComponents.indexOf(_camelCase(one.name)) > -1 }) } try { for (let i = 0; i < list.length; i++) { let one = list[i] const name = list[i].name if (one.items) { // build a commonjs bundle yield build(buildConfig({ name: list[i].name + '-pack', importName: _camelCase(list[i].name), path: `src/components/${name}/index.js` }), `pack: ${list[i].name}`) for (let j = 0; j < one.items.length; j++) { one.name = one.items[j] one.path = maps[_camelCase(one.items[j])] one.importName = _camelCase(one.items[j]) yield build(buildConfig(one), one.items[j]) } } else { yield build(buildConfig(one), one.name) } } } catch (e) { console.log(e) } }) function camelCase(input) { let str = input.toLowerCase().replace(/-(.)/g, function (match, group1) { return group1.toUpperCase(); }) str = str.replace(/_(.)/g, function (match, group1) { return group1.toUpperCase() }); return str } function _camelCase(input) { let str = camelCase(input) return str.slice(0, 1).toUpperCase() + str.slice(1) } function buildMainConfig() { // list all components const list = require('../src/components/map.json') let code = `const _vux = {}\n const isBrowser = typeof window !== 'undefined'\n` code += `isBrowser && (window.vux = _vux)\n\n` code += `import Style from '../styles/index.vue' // eslint-disable-line\n` delete list['NOTICE'] delete list['ChinaAddressV1Data'] delete list['vuxTransferDom'] for (let i in list) { const name = `${namespace}${i}` code += `import ${name} from '${list[i]}'\n _vux['${name}'] = ${name}\n` } code += ` if (isBrowser) { for (let i in _vux) { window[i] = _vux[i] } }\n` fs.writeFileSync(path.resolve(__dirname, '../src/components/index.js'), code) delete config.entry config.plugins.forEach((one, index) => { if (one.constructor.name === 'ExtractTextPlugin') { config.plugins.splice(index, 1) } }) config.plugins.push(new ExtractTextPlugin({ filename: `vux.min.css` })) config.entry = config.entry || {} config.entry['vux'] = 'src/components/index.js' config.output = {} config.output.libraryTarget = 'window' config.output.filename = `vux.min.js` config.output.path = path.resolve(__dirname, `../dist/`) delete config.__vueOptions__ return config } // build plugins function buildPlugin(name) { delete config.entry config.plugins.forEach((one, index) => { if (one.constructor.name === 'ExtractTextPlugin') { config.plugins.splice(index, 1) } }) config.plugins.push(new ExtractTextPlugin({ filename: 'index.min.css' })) config.entry = config.entry || {} config.entry['plugin'] = `src/plugins/${name.toLowerCase()}/index.js` config.output = {} config.output.libraryTarget = 'umd' config.output.library = `${namespace}${name}Plugin` config.output.filename = `index.min.js` config.output.path = path.resolve(__dirname, `../dist/plugins/${name.toLowerCase()}`) delete config.__vueOptions__ return config } function buildConfig(one, opts) { opts = opts || {} one.importName = one.importName || _camelCase(one.name) one.path = path.resolve(__dirname, '../' + (one.path || maps[one.importName])) delete config.entry config.plugins.forEach((one, index) => { if (one.constructor.name === 'ExtractTextPlugin') { config.plugins.splice(index, 1) } }) config.plugins.push(new ExtractTextPlugin({ filename: 'index.min.css' })) config.entry = {} config.entry[one.name] = one.path config.output = {} config.output.libraryTarget = 'umd' config.output.library = `${namespace}${one.importName}` config.output.filename = `index.min.js` config.output.path = path.resolve(__dirname, `../dist/components/${one.name}/`) delete config.__vueOptions__ return config } function toDash(str) { return str.replace(/([A-Z])/g, function (m, w) { return '-' + w.toLowerCase(); }).replace('-', '') } ================================================ FILE: build/build-docs.js ================================================ 'use strict' const glob = require("glob") const fs = require('fs') const yaml = require('js-yaml') const path = require('path') const _ = require('lodash') const mkdirp = require('mkdirp') const rimraf = require('rimraf') const semver = require('semver') const sortObj = require('sort-object') mkdirp.sync(path.resolve(__dirname, '../docs/zh-CN/changelog')) mkdirp.sync(path.resolve(__dirname, '../docs/en/changelog')) mkdirp.sync(path.resolve(__dirname, '../docs/zh-CN/components')) mkdirp.sync(path.resolve(__dirname, '../docs/en/components')) const aliasMap = { Base64Tool: 'base64', Md5Tool: 'md5', CookieTool: 'cookie', CommaTool: 'numberComma', PadTool: 'numberPad', RandomTool: 'numberRandom', FormatTool: 'dateFormat', TrimTool: 'stringTrim', QuerystringTool: 'querystring', DebounceTool: 'debounce', ThrottleTool: 'throttle' } let tMaps = { '组件列表': 'Components', '该组件已经停止维护。': 'This Component is Deprecated. ', '名字': 'name', '类型': 'type', '参数': 'params', '默认': 'default', '说明': 'description', '该文件为自动生成,请不要修改': 'THIS FILE IS AUTOGENERATED, DONOT EDIT IT', '进入demo页面': 'Demo page', '编辑文档': 'Edit document', 'demo源码': 'Demo source', '版本': 'version' } function getPath(dir) { return path.join(__dirname, dir) } let gComponents = [] let maps = {} saveMaps('numberRange', 'src/tools/number/range.js') saveMaps('dateRange', 'src/tools/date/range.js') saveMaps('TransferDom', 'src/directives/transfer-dom/index.js') saveMaps('trim', 'src/tools/string/trim') // add AlertModule saveMaps('AlertModule', 'src/plugins/alert/module') function saveMaps(key, value) { if (key === 'RangeTool') { return } if (/test|fixture/.test(value)) { return } if (/vux/.test(value)) { let index = value.indexOf('src/components') if (/Filter$/.test(key)) { index = value.indexOf('src/filters') } if (/Data$/.test(key)) { index = value.indexOf('src/datas') } if (/Plugin$/.test(key)) { index = value.indexOf('src/plugins') } if (/Directive$/.test(key)) { index = value.indexOf('src/directives') } if (/Tool$/.test(key)) { index = value.indexOf('src/tools') } value = value.slice(index, value.length) } maps[key] = value.replace('../', '') if (aliasMap[key]) { maps[aliasMap[key]] = maps[key] delete maps[key] } // sort const list = [] for (let i in maps) { list.push([i, maps[i]]) } list.sort(function (a, b) { return a[0].toLowerCase() > b[0].toLowerCase() ? 1 : -1 }) list.unshift(['NOTICE', 'THIS FILE IS AUTOGENERATED BY npm run build-docs']) const _list = {} list.forEach(function (one) { _list[one[0]] = one[1] }) fs.writeFileSync(getPath('../src/components/map.json'), JSON.stringify(_list, null, 2)) } glob(getPath("../src/plugins/**/index.js"), {}, function (er, files) { files.forEach(function (file) { let name = getComponentName(file) name = _camelCase(name) saveMaps(name + 'Plugin', file) }) }) glob(getPath("../src/tools/**/*.js"), {}, function (er, files) { files.forEach(function (file) { let name = getComponentName(file) name = _camelCase(name) saveMaps(name + 'Tool', file) }) }) glob(getPath("../src/directives/**/index.js"), {}, function (er, files) { files.forEach(function (file) { let name = getComponentName(file) name = _camelCase(name) saveMaps(name + 'Directive', file) }) }) glob(getPath("../src/filters/*.js"), {}, function (er, files) { files.forEach(function (file) { let name = getComponentName(file) name = _camelCase(name) saveMaps(name + 'Filter', file) }) }) glob(getPath("../src/datas/*.json"), {}, function (er, files) { files.forEach(function (file) { let name = getComponentName(file) name = _camelCase(name) saveMaps(name + 'Data', file) }) }) glob(getPath("../src/components/**/*.vue"), {}, function (er, files) { // 生成组件路径映射 // 语言配置 let rs = {} let enRs = {} let zhCnRs = {} files.forEach(function (file) { let name = getComponentName(file) const importName = _camelCase(name) saveMaps(importName, file) let content = fs.readFileSync(file, 'utf-8') if (content.indexOf('') > -1) { const name = getComponentName(file) const results = content.match(/${t('该组件已经停止维护。')}${one.deprecatedInfo ? one.deprecatedInfo[lang] : ''}
\n` } if (one.import_code) { if (one.import_code !== ' ') { docs += '\n``` js' docs += `\n${one.import_code}` docs += '\n```\n' } } else { docs += '\n``` js' docs += `\nimport { ${one.importName} } from 'vux'` docs += '\n```\n' } if (one.extra && typeof one.extra === 'string' && lang === 'zh-CN') { docs += '\n' + one.extra + '\n' } if (one.extra && typeof one.extra === 'object' && one.extra[lang]) { docs += '\n' + one.extra[lang] + '\n' } if (one.props || one.slots) { docs = getComponentInfo(one, lang, docs) } if (one.items) { docs = getComponentInfo({ name: one.name, hideDemo: one.items.length > 1, props: one.json[one.items[0]].props, sub_extra: one.json[one.items[0]].sub_extra, slots: one.json[one.items[0]].slots, events: one.json[one.items[0]].events, methods: one.json[one.items[0]].methods }, lang, docs, one.items[0]) docs = getComponentInfo({ name: one.name, json: one.json, hideDemo: one.items.length > 2, props: one.json[one.items[1]].props, sub_extra: one.json[one.items[1]].sub_extra, slots: one.json[one.items[1]].slots, events: one.json[one.items[1]].events, methods: one.json[one.items[1]].methods }, lang, docs, one.items[1]) if (one.items.length === 3) { docs = getComponentInfo({ name: one.name, json: one.json, props: one.json[one.items[2]].props, sub_extra: one.json[one.items[2]].sub_extra, slots: one.json[one.items[2]].slots, events: one.json[one.items[2]].events, methods: one.json[one.items[2]].methods }, lang, docs, one.items[2]) } } // after extra if (one.after_extra) { docs += '\n' + (one.after_extra[lang] || one.after_extra) + '\n' } /** docs += `\n`0.x` 版本文档不完整,并且已经不再维护。请更新或者直接使用`2.x`。
当前开发分支为 [v2](https://github.com/airyland/vux)。 `2.1.0` ~ `3.0.0` 之间版本不会有影响升级的 `break change`,请放心及时更新版本。 ================================================ FILE: docs/compile.js ================================================ 'use strict' const glob = require('glob') const path = require('path') const fs = require('fs') const yaml = require('js-yaml') const hljs = require('highlight.js') const MD = require('markdown-it') const argv = require('yargs').argv let langs = ['en', 'zh-CN'] const t = require('./i18n') const pkg = require('../package.json') const variables = {} const variableMap = {} const variablePath = path.join(__dirname, '../src/styles/variable.less') const variableContent = fs.readFileSync(variablePath, 'utf-8').split('\n') const isInclude = function (name, include) { let list = include.split(',') for (let i = 0; i < list.length; i++) { if (name.includes(list[i])) { return true } } return false } variableContent.forEach((line, index) => { if (/^@/.test(line)) { let temp = line.split(':') let component = temp[0].replace('@', '').split('-')[0] if (component === 'button' && /button-tab/.test(line)) { component = 'button-tab' } if (!variables[component]) { variables[component] = [] } const name = temp[0].replace('@', '') let value = temp[1].replace(';', '').trim().replace(/\/\*(.*?)\*\//, '') if (value.includes('//')) { value = value.split(' ')[0].trim() } let inherited_name = '' let is_inherited = false if (/@/.test(value)) { is_inherited = true inherited_name = value value = variableMap[value.replace('@', '')] } let t = {} if (variableContent[index - 1] === '*/' && /:/.test(variableContent[index - 2])) { let stop = false let i = 2 while (!stop) { const temp = variableContent[index - i] if (/:/.test(temp)) { let pair = temp.split(':') t[pair[0].replace('*', '').trim()] = pair[1].trim() } else { stop = true } i++ } } variables[component].push({ name, value, is_inherited, inherited_name, desc: t }) variableMap[name] = value } }) let contents = [] const getAlternate = function (lang, route) { return langs.filter(_lang => _lang !== lang).map(_lang => { return { rel: 'alternate', hreflang: _lang, href: route.replace(lang, _lang) } }) } const getPath = function (dir) { return path.join(__dirname, dir) } // for faster test with few languages if (argv.langs) { langs = argv.langs.split(',') } // filters routes let include if (argv.include) { include = argv.include } const customContainer = require('markdown-it-container') const md = new MD({ html: true, highlight: function (str, lang) { if (lang && hljs.getLanguage(lang)) { try { return '' +
hljs.highlight(lang, str, true).value +
'';
} catch (__) {}
}
return '' + md.utils.escapeHtml(str) + '';
}
})
.use(customContainer, 'tip', {
validate: function(params) {
return params.trim() === 'tip'
}
})
.use(customContainer, 'warning', {
validate: function(params) {
return params.trim() === 'warning'
}
})
.use(customContainer, 'danger', {
validate: function(params) {
return params.trim() === 'danger'
}
})
function getComponentName(path) {
let list = path.split('/')
if (list[list.length - 1] === 'index.vue' || list[list.length - 1] === 'index.js') {
return list[list.length - 2]
} else if (list[list.length - 1] === 'metas.yml') {
return list[list.length - 2]
} else if (/\.json/.test(path)) {
return list[list.length - 1].replace('.json', '')
} else if (/\.js/.test(path)) {
return list[list.length - 1].replace('.js', '')
} else {
return list[list.length - 1].replace('.vue', '')
}
}
let paths = []
langs.forEach(lang => {
const faqs = glob.sync(getPath(`./${lang}/faq/*.md`))
const faqRoutes = []
const commonTitle = `${t('title', lang)}`
let faqMd = `
---
title: ${t('faq', lang)} | ${commonTitle}
---
# ${t('faq', lang)}
`
faqs.forEach(one => {
one = '.' + one.replace(__dirname, '')
const content = fs.readFileSync(getPath(one), 'utf-8')
const titleRs = content.match(/\n#(.*?)\n/)
if (titleRs && titleRs[1] && one.indexOf('index.md') === -1) {
faqRoutes.push({
title: titleRs[1].trim(),
path: one.replace('./', '/').replace('.md', '.html')
})
contents.push({
lang,
category: '常见问题',
title: titleRs[1].trim(),
url: one.replace('./', '/').replace('.md', '.html'),
content: md.render(content)
})
}
})
faqRoutes.forEach(one => {
faqMd += `
* ' +
hljs.highlight(lang, code, true).value +
''
}
const routesList = require(getPath(`../src/demo_list.json`))
const map = {}
routesList.forEach(route => {
if (/#/.test(route)) {
let pair = route.split('#')
map[pair[0]] = pair[1]
}
})
components.forEach((file) => {
const rawMetas = fs.readFileSync(file, 'utf-8')
const metas = yaml.safeLoad(rawMetas)
const root = getPath('../')
const componentName = file.replace(root, '').replace('src/components/', '').replace('/metas.yml', '')
const importName = _camelCase(componentName)
let importList = [{
componentName: componentName,
importName: importName
}]
if (/meta/.test(componentName)) {
return
}
// 加入样式变量
metas.variables = variables[componentName.replace('x-', '')]
// demo 源码
const demoPath = path.join(__dirname, `../src/demos/${importName}.vue`)
let demoCode = ''
try {
demoCode = encodeURIComponent(colorCode('html', fs.readFileSync(demoPath, 'utf-8')))
} catch (e) {}
if (metas.items) {
importList = []
metas.items.forEach(one=> {
importList.push({
componentName: one,
importName: _camelCase(one)
})
})
}
const parseReg = '`(.*?)`'
const _localImportCode = `import { ${importList.map(one => one.importName).join(', ')} } from 'vux'
export default {
components: {
${importList.map(one => one.importName).join(',\n ')}
}
}`
const localImportCode = colorCode('js', _localImportCode)
let exampleCode = ''
if (metas.example) {
exampleCode = colorCode('html', metas.example)
}
if (metas.tips) {
langs.forEach(lang => {
if (metas.tips[lang]) {
for (let i = 0; i < metas.tips[lang].length; i++) {
metas.tips[lang][i].a = metas.tips[lang][i].a
.replace(/```\s+(css|js|bash|html)/g, '``` $1\n')
.replace(/```/g, '\n```')
metas.tips[lang][i].a = md.render(metas.tips[lang][i].a)
}
}
})
// add tip on last component
if (metas.items) {
const keys = metas.items
const last = keys[keys.length - 1]
metas[last].tips = metas.tips
}
}
// render child component description
if (metas.items) {
metas.items.forEach(item => {
if (metas[item].description) {
metas[item].description = md.render(metas[item].description)
}
})
}
langs.forEach(lang => {
// find demos
let demos = []
const reg = /' +
hljs.highlight('html', code.replace(reg, ''), true).value +
'',
oriHeight: height,
height: height,
noBackgroundColor,
order
}
})
demos = list.sort((a, b) => {
return a.order > b.order ? 1 : -1
})
}
let url = `https://vux.li/demos/v2/#/component/${componentName}`
if (demos.length) {
url = `https://vux.li/demos/v2/#/components/${componentName}/home`
}
// toc
let toc = []
if (demos.length) {
toc.push({
title: t('Intro', lang),
anchor: 'intro'
})
toc.push({
title: t('Install', lang),
anchor: 'install'
})
toc.push({
title: t('Examples', lang),
anchor: 'examples',
list: demos.map(one => {
return {
title: one.title,
anchor: 'examples:' + one.title
}
}).slice(0, 5)
})
if (metas.items) {
toc.push({
title: 'API',
anchor: 'api',
list: metas.items.map(item => {
return {
title: `<${item}>`,
anchor: 'components:' + item
}
})
})
} else {
toc.push({
title: 'API',
anchor: 'api'
})
}
toc.push({
title: t('Tips', lang),
anchor: 'tips'
})
toc.push({
title: t('Contributors', lang),
anchor: 'contributors'
})
toc.push({
title: t('Changelog', lang),
anchor: 'changelog'
})
}
const needImport = metas.need_import === false ? false : true
const gitMetas = require(`./${lang}/components/${componentName}_git_metas.json`)
// ldjson
const ldjson = {
"@context": "http://schema.org/",
"@type": "SoftwareApplication",
"name": `Vue Component ${componentName}`,
"screenshot": "",
"description": "Vue.js component for VUX",
"url": `/${lang}/components/${componentName}.html`,
"applicationCategory": t('Component', lang),
"author": {
"@type": "Organization",
"name": "VUX",
"url": "https://vux.li"
},
"downloadUrl": "https://vux.li",
"softwareVersion": pkg.version,
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": 5,
"reviewCount": gitMetas.commitCount
},
"operatingSystem": "iOS >= 7, Android >= 4.1",
"offers": {
"@type": "Offer",
"price": 0,
"priceCurrency": t('priceCurrency', lang),
"availability": "http://schema.org/InStock"
}
}
contents.push({
lang: lang,
category: t('Components', lang),
title: importName,
title_alias: componentName,
url: `/${lang}/components/${componentName}.html`
})
const list = ['Props', 'Events', 'Slots', 'Functions']
list.forEach(block => {
const key = block.toLowerCase()
if (metas[key]) {
for (let prop in metas[key]) {
contents.push({
lang: lang,
category: t('Component', lang) + ' ' + importName + ' ' + t(block.replace(/s$/, ''), lang),
title: prop,
url: `/${lang}/components/${componentName}.html#${key}-${prop}`,
content: metas[key][prop][lang]
})
}
}
})
let _globalImportCode = `// ${t('globally register', lang)}\n\nimport Vue from 'vue'\nimport { ${importList.map(one => one.importName).join(', ')} } from 'vux'\n\n`
const urlWithNoTransition = `https://vux.li/demos/v2?locale=${lang}&transition=none/#/component/${componentName}`
importList.forEach(one => {
_globalImportCode += `Vue.component('${one.componentName}', ${one.importName})\n`
})
const globalImportCode = colorCode('js', _globalImportCode)
let str = `
${t('demo url', lang)}
${t('demo source code', lang)}
${t('edit document', lang)}
${t('component source code', lang)}
${t('donot need import', lang)}
$1') : '' }
| ${t('name', lang)} | ${t('type', lang)} | ${t('default value', lang)} | ${t('description', lang)} | ${t('required version', lang)} |
|
|
{{ prop.default}} | {{ prop.version || '--'}} |
| ${t('name', lang)} | ${t('params', lang)} | ${t('description', lang)} | ${t('required version', lang)} |
|
|
{{ event['version'] || '--' }} |
| ${t('name', lang)} | ${t('description', lang)} | ${t('required version', lang)} |
|
|
{{ slot['version'] || '--' }} |
| ${t('name', lang)} | ${t('params', lang)} | ${t('description', lang)} | ${t('required version', lang)} |
|
|
{{ method['version'] }} |
| ${t('name', lang)} | ${t('default value', lang)} | ${t('description', lang)} | ${t('inherited name', lang)} |
|
|
{{ variable.value }} | {{ variable['desc']['${lang}'] || '--' }} | {{ variable.inherited_name }} |
${t('Total commits quantity:', lang)} {{ gitMetas.commitCount }},${t('Total contributors quantity:', lang)} {{gitMetas.commitUniqueCount}}
{{person.authorName}}
## 提示
::: tip
`VUX` 是`库`而非`框架`,虽然有专用的 `vux-loader`,但并不影响你自由地使用其他组件库或者工具库。
================================================
FILE: docs/en/about/thanks.md
================================================
---
title: 感谢
---
# Thanks
## VUX 参考或者使用了以下开源项目的代码
+ [Vue](https://github.com/vuejs/vue)
+ [WeUI](https://github.com/weui/weui)
+ [FrozenUI](https://github.com/frozenui/frozenui)
+ [Ant Design](https://github.com/ant-design/ant-design)
+ [Ant Design Mobile](http://github.com/ant-design/ant-design-mobile)
+ [XScroll](https://github.com/huxiaoqi567/xscroll)
+ [Ionic](https://github.com/driftyco/ionic)
+ [SUI Mobile](https://github.com/sdc-alibaba/SUI-Mobile)
+ [PhotoSwipe](https://github.com/dimsemenov/PhotoSwipe)
## 工具框架
- 世界上最好的语言 `JavaScript`
- 啥都能做的前端构建工具 [Webpack](https://webpack.js.org/)
- 简单好用的文档展示工具 [Docute](https://docute.js.org/#/)
================================================
FILE: docs/en/contribution/donate.md
================================================
---
title: 捐赠支持 VUX
---
## 捐赠
* [Patreon](https://www.patreon.com/airyland)
* [PayPal](https://paypal.me/airyland)
* 支付宝 airyland@qq.com
================================================
FILE: docs/en/contribution/issue.md
================================================
---
title: 如何提 issue
---
# 如何提 issue
::: tip
使用本项目意味着你也有义务帮助其变得更好。
:::
不要浪费维护者时间。
不要让维护者帮你学习`Vue`,帮你熟悉`vue-loader`,甚至帮你写代码。
不要认为随便一句话就能让维护者明白你的意思,我们没有你想象的那么厉害。
不要提没有任何意义的、代码中带有业务逻辑不方便重现的Issue。
直接关闭你的`issue`不是对你不满,是你提问题方式不对,没有必要再浪费时间说明为什么要关闭你的`issue`。
马虎的提问,缺少上下文和重现步骤是在浪费彼此时间。
================================================
FILE: docs/en/contribution/pr.md
================================================
---
title: 如何贡献
---
# 如何贡献
## 文档更新
如果修改了组件代码,需要在组件目录的`metas.yml`加上changes,直接使用`next`作为版本号(如果已经存在该版本号,则直接添加变更条目即可)。
中括号内为变更类型,可选值 `fix` `enhance` `feature` `change`
比如:
``` yml
changes:
next:
en:
- '[fix] fix *** bug #issueId'
- '[feature] new feature'
zh-CN:
- '[fix] 修复 *** bug #issueId'
```
::: tip
当文档相关的 `PR`被合并后,文档服务器会在`5分钟`内拉取最新代码并执行`npm run build-docs`及`npm run build`实现文档及`demo`更新。
:::
## 为什么使用 next 为版本号
`next` 表示下个版本,未发布时在 `changelog` 里显示 `next`,提醒用户一些开发中的代码尚未发布。
当进行版本发布时,文档中的 `next` 会被脚本代替成真正的版本号,至此发布完毕。
这样的最大好处是更新代码时可以直接写 `changelog` 不用在意要写哪个版本号,在发布时翻 commit 记录写 `changelog` 是件比较浪费时间的事。
================================================
FILE: docs/en/contribution/vux-development.md
================================================
---
title: VUX 源码本地运行
---
# VUX 源码本地运行
::: tip
请更新 `NodeJS` 版本到 `v7.6.0` 以上,`build` 命令逐步使用 `async`。
:::
``` bash
yarn // 使用 yarn.lock 保证依赖版本一致
yarn dev
```
## 本地查看文档
``` bash
npm run doc:build // 构建文档
cd docs
yarn
npm run dev // 耗时较长
```
## 文档相关命令
> docs 目录下的相关命令,它们是 npm run doc:build 的一部分,但是可以单独运行
``` bash
node compile // 生成文档路由
node component-contributions // 从 git 记录里获取每个组件提交历史
npm run doc:dev // 运行
```
## 构建部分文档
文档页面比较多等待 build 命令会长,因此可以只构建部分文档方便快速查看。
``` bash
cd docs
node compile --include datetime // 只构建 datetime 相关文档
npm run dev
```
================================================
FILE: docs/en/css/1px.md
================================================
---
title: 1px 解决方案
---
# 1px 解决方案
::: tip
1px 方案在 VUX 组件内应用广泛,包括 `Grid`, `ButtonTab`, `XTable`, `XButton`, `Cell` 等等。
利用 `Flexbox` + `1px` 你可以实现复杂的宫格布局。
:::
## 引入
在你项目的`App.vue`引入,组件内不需要再重复引入。
``` html
```
## 可用类名:
- `vux-1px-l` 左边框
- `vux-1px-r` 右边框
- `vux-1px-t` 上边框
- `vux-1px-b` 下边框
- `vux-1px-tb` 上下边框
- `vux-1px` 全边框
================================================
FILE: docs/en/css/close.md
================================================
---
title: 纯 css close 图标
---
# 纯 css close 图标
::: tip
关闭图标主要应用于弹窗(dialog)关闭按钮以及弹窗(popup)头部的关闭按钮。
:::
## 使用
在你项目的`App.vue`引入,组件内不需要再重复引入。
``` html
```
## 类名
- `vux-close`
``` html
```
可以参考 `XDialog` 演示。
## 颜色
当你想设置图标颜色时,直接设置 color 即可。
``` html
```
================================================
FILE: docs/en/css.md
================================================
---
nav: zh-CN
---
## 1px
::: tip
1px 方案在 VUX 组件内应用广泛,包括 Grid, ButtonTab, XTable, XButton, Cell 等等。
为什么不参照其他组件库全部加上`X`前缀,主要是因为觉得总要写个`X`相当不顺手。
因Vue2.0限制组件名不能与原有的html5标签一样,因此部分组件进行了重命名,加上 `x-`前缀,所有需要加前缀的组件如下: - `Progress` => `XProgress` - `Switch` => `XSwitch` - `Dialog` => `XDialog` - `Address` => `XAddress` - `Circle` => `XCircle` - `XButton` - `XImg` - `XInput` - `XTextarea` - `XHeader` ### 各个组件变更: #### Swiper 引入路径变化 目录结构变化,与其他有子组件的统一,导致引入方式变化: ``` js // 0.x import Swiper from 'vux/src/components/swiper' import SwiperItem from 'vux/src/components/swiper-item' // 2.0 import Swiper from 'vux/src/components/swiper/swiper' import SwiperItem from 'vux/src/components/swiper/swiper-item' // 或者 import { Swiper, SwiperItem } from 'vux/src/components/swiper' // with vux-loader ``` #### ColorPicker 废弃`2.0.0`可用用,但是后面不再维护。
这个组件可以由`cell`配合`slot`扩展出来,而且更灵活。没有做过统计,但是感觉使用人数应该挺少。 #### Countdown 废弃`2.0.0`可用,但是后面不再维护。
功能薄弱,比较鸡肋。 #### Scroller reset方法更新 由于 Vue@2.x 的`broadcast`方法已经废弃,并且之前的设计也并不是很好,uuid的绑定也其实是没必要的。 - reset方法变成使用ref的`reset()`方法 - pullup reset 变成 ref 的 `donePullup()`方法 - pullup disable 变成 ref 的 `disablePullup()`方法 - pullup enable 变成 ref 的 `enablePullup()`方法 - pulldown reset 变成 ref 的 `donePulldown()`方法 - pullup和pulldown的status绑定变成`v-model="status"`绑定,示例 ``` js status: { pullupStatus: 'default', pulldownStatus: 'default' } ``` 详细参照Scroller文档进行更新 #### 表单默认required为true 保持和`html`规范一致, 影响的组件有 `XInput` `Checklist` #### Checklist 不显示错误提示 考虑到错误样式目前并不优雅,而用户有自定义错误样式的需要,因此处理成emit一个错误事件+底部slot, 用户可自行处理。 #### XInput 的valid获取 由于Vue2的$ref不再是响应的,因此不能直接在模板中通过ref调用组件的valid值(会报undefined),所以需要变成在提交时再进行ref来获取valid值。 #### XAddress 默认地址数据更新 目前引用方式: ``` js import { XAddress, ChinaAddressData } from 'vux' ``` 如果你想继续使用旧版本数据 ``` js import { XAddress, ChinaAddressV1Data } from 'vux' ``` 按照[最新统计局数据](http://www.stats.gov.cn/tjsj/tjbz/xzqhdm/201608/t20160809_1386477.html)进行更新,部分区域已经不存在,部分id做了更新。因此请*谨慎*更新,评估后端数据存储设计和前端交互再进行更新,避免错误更新用户数据或者导致数据丢失。 完整更新如下图:
`前加入代码: ``` html <%=htmlWebpackPlugin.files.webpackManifest%> ``` ## 配置 vux-loader 在`vux-loader`配置的 `plugins` 列表中加入`inline-manifest`插件 ``` js plugins:[{ name: 'inline-manifest' }] ``` 或者简化写法直接使用名字: ``` js plugins:['inline-manifest'] ``` ================================================ FILE: docs/en/tools/base64.md ================================================ --- title: base64 --- # base64 ``` js import { base64 } from 'vux' base64.encode('VUX') base64.decode('VlVY') ``` ================================================ FILE: docs/en/tools/cookie.md ================================================ --- title: cookie --- # cookie ``` js import { cookie } from 'vux' ``` `get *cookie.get(name, [options])*` 获取 cookie 值。`options` 参数可选,取值如下: 1. `converter` 转换函数。如果所获取的 cookie 有值,会在返回前传给 `converter` 函数进行转换。 1. 选项对象。对象中可以有两个属性:`converter` 和 `raw`. `raw` 是布尔值,为真时,不会对获取到的 cookie 值进行 URI 解码。 **注**:如果要获取的 cookie 键值不存在,则返回 `undefined`. 例子: ```js // setup document.cookie = 'foo=1' document.cookie = 'bar=2' cookie.get('foo') // returns '1' cookie.get('bar', function(s) { return parseInt(s); } ) // returns 2 ``` `set *cookie.set(name, value, [options])` 设置 cookie 值。参数 `options` 可选,可以有以下属性:`path`(字符串)、`domain`(字符串)、 `expires`(数值或日期对象)、`raw`(布尔值)。当 `raw` 为真值时,在设置 cookie 值时,不会进行 URI 编码。 例子: ```js cookie.set('foo', 3) cookie.set('bar', 4, { domain: 'example.com', path: '/', expires: 30 }) ```` `remove *cookie.remove(name, [options])` 移除指定的 cookie. 例子: ```js cookie.remove('foo') cookie.remove('bar', { domain: 'example.com', path: '/' }) ``` ================================================ FILE: docs/en/tools/date.md ================================================ --- title: vue date format --- # date format Built-in dateFormat is much smaller size than `moment`。 ## Usage ``` js import { dateFormat } from 'vux' dateFormat(new Date(), 'YYYY-MM-DD HH:mm:ss') ``` ## Used as Vue filter ``` js import { dateFormat } from 'vux' export default { filters: { dateFormat } } ``` ================================================ FILE: docs/en/tools/debounce-throttle.md ================================================ --- title: debounce --- ## debounce ::: warning 请注意了解 `debounce` 和 `throttle` 的区别。如果尚不清楚,请`google`之。 ::: ``` js import { debounce } from 'vux' debounce(func, [wait=0], [options={}]) ``` [详细文档](https://lodash.com/docs/#debounce) ## throttle ``` js import { throttle } from 'vux' throttle(func, [wait=0], [options={}]) ``` [详细文档](https://lodash.com/docs/#throttle) ================================================ FILE: docs/en/tools/md5.md ================================================ --- title: md5 --- # md5 ::: tip 该工具直接依赖于 [blueimp-md5](https://github.com/blueimp/JavaScript-MD5) 注意: `md5`是消息摘要算法并非加密算法,用于需要加密的场景会有安全问题。 ::: ``` js import { md5 } from 'vux' md5('VUX') ``` ================================================ FILE: docs/en/tools/number.md ================================================ --- title: vue number format --- # number format `numberComma`用于分割数字,默认为3位分割,一般用于格式化`金额`。 `numberPad`用于按照位数补0 `numberRandom`用于生成两个整数范围内的随机整数 ``` js import { numberComma, numberPad, numberRandom } from 'vux' numberComma(21342132) // 21,342,132 numberComma(21342132, 4) // 2134,2132 numberComma(21342132.234) // 21,342,132.234 numberPad(1) // 01 numberPad(234, 4) // 0234 numberRandom(1, 7) // 2 ``` ================================================ FILE: docs/en/tools/querystring.md ================================================ --- title: Vue querystring url --- # url querystring ```js import { querystring } from 'vux' querystring.parse('a=b&c=d') // {a:'b',c:'d'}, 默认参数为 location.search querystring.stringify({a:'b',c:'d'}) // 'a=b&c=d',注意不支持复杂嵌套的结构 ``` ================================================ FILE: docs/en/tools/string.md ================================================ --- title: Vue trim string --- # trim string ``` js import { trim } from 'vux' trim(' 1024 ') // 1024 ``` ================================================ FILE: docs/en/umd.md ================================================ --- nav: zh-CN --- ## 组件 umd 文件
从`2.0`开始,推荐使用`webpack`来调用组件,因此不再在`repo`中保存`umd`文件,但提供了生成命令。
请更新 `NodeJS` 到版本 `7.6.0`及以上。
例子可查看:[https://github.com/airyland/vux/tree/v2/docs/examples](https://github.com/airyland/vux/tree/v2/docs/examples)
### 生成命令 ``` bash git clone https://github.com/airyland/vux.git --depth=1 // or just update: git pull cd vux npm install npm run build-components ``` 默认生成的语言是`zh-CN`,模块命名空间为`vux`,如`vuxGroup`,`vuxCell`,你可以在命令行中配置。 ``` npm run build-components -- --locale='en' --namespace='X' ``` ### 目录结构 生成的文件夹结构如:
出于目录结构一致性考虑,即使是子组件也是一个文件夹,并且会有一个空的`index.min.css`样式文件。
``` |- dist/ |- vux.min.js ------------ 所有组件打包,仅用于测试,不推荐在生产环境使用 |- vux.min.css ----------- 所有组件样式打包,同样仅用于测试 |- components |- actionsheet |- index.min.js -------- 组件js代码 |- index.min.css ------- 组件css代码 ```
vux.min.js 包括了所有的组件、插件及默认地址库,都挂载在全局变量vux上。当然为了使用方便同样直接挂载到了`window`上。
组件调用举例: `vuxCell`
插件调用举例:`vuxAlertPlugin`
默认地址库调用:`vuxChinaAddressData`
### 组件使用 ``` html