├── .eslintignore
├── .eslintrc.js
├── .gitattributes
├── .github
└── ISSUE_TEMPLATE
│ ├── ----.md
│ └── --bug.md
├── .gitignore
├── .gitmodules
├── .npmignore
├── .npmrc
├── .prettierrc.js
├── .travis.yml
├── CHANGELOG.md
├── LICENSE
├── README.md
├── babel.config.js
├── docs
├── README.md
├── actionsheet.md
├── badge.md
├── cell.md
├── cells.md
├── checkbox-group.md
├── dialog.md
├── form-page.md
├── form.md
├── gallery.md
├── half-screen-dialog.md
├── icon.md
├── img
│ ├── actionsheet.png
│ ├── badge.png
│ ├── cell.png
│ ├── cells.png
│ ├── checkbox-group.png
│ ├── demo.png
│ ├── dialog.png
│ ├── emoji.png
│ ├── flex.png
│ ├── form-page.png
│ ├── gallery.png
│ ├── half-screen-dialog.png
│ ├── icon.png
│ ├── iconList.jpg
│ ├── iconList1.jpg
│ ├── iconList2.jpg
│ ├── loading.png
│ ├── msg.png
│ ├── navigation.png
│ ├── searchbar.png
│ ├── slideview.png
│ ├── tabbar.png
│ ├── toptips.png
│ ├── uploader.png
│ └── video-swiper.png
├── loading.md
├── msg.md
├── navigation.md
├── other.md
├── quickstart.md
├── search.md
├── slideview.md
├── tabbar.md
├── toptips.md
└── uploader.md
├── gulpfile.js
├── jest.config.js
├── mpflow.config.js
├── package-lock.json
├── package.json
├── src
├── app.js
├── app.json
├── app.less
├── base
│ ├── CustomPage.js
│ └── behaviors
│ │ └── theme.js
├── components
│ ├── actionsheet
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── actionsheet.test.ts.snap
│ │ │ ├── actionsheet.test.ts
│ │ │ ├── index.json
│ │ │ ├── index.ts
│ │ │ └── index.wxml
│ │ ├── actionsheet.json
│ │ ├── actionsheet.less
│ │ ├── actionsheet.ts
│ │ └── actionsheet.wxml
│ ├── badge
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── badage.test.js.snap
│ │ │ └── badage.test.js
│ │ ├── badge.json
│ │ ├── badge.less
│ │ ├── badge.ts
│ │ └── badge.wxml
│ ├── cell
│ │ ├── cell.json
│ │ ├── cell.less
│ │ ├── cell.ts
│ │ └── cell.wxml
│ ├── cells
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── cells.test.js.snap
│ │ │ ├── cells.test.js
│ │ │ ├── index.js
│ │ │ ├── index.json
│ │ │ └── index.wxml
│ │ ├── cells.json
│ │ ├── cells.less
│ │ ├── cells.ts
│ │ └── cells.wxml
│ ├── checkbox-group
│ │ ├── checkbox-group.json
│ │ ├── checkbox-group.less
│ │ ├── checkbox-group.ts
│ │ └── checkbox-group.wxml
│ ├── checkbox
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── checkbox.test.js.snap
│ │ │ ├── checkbox.test.js
│ │ │ ├── index.js
│ │ │ ├── index.json
│ │ │ └── index.wxml
│ │ ├── checkbox.json
│ │ ├── checkbox.less
│ │ ├── checkbox.ts
│ │ └── checkbox.wxml
│ ├── dialog
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── dialog.test.js.snap
│ │ │ ├── dialog.test.js
│ │ │ ├── index.js
│ │ │ ├── index.json
│ │ │ └── index.wxml
│ │ ├── dialog.json
│ │ ├── dialog.less
│ │ ├── dialog.ts
│ │ └── dialog.wxml
│ ├── form-page
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── form-page.test.ts.snap
│ │ │ ├── form-page.test.ts
│ │ │ ├── index.js
│ │ │ ├── index.json
│ │ │ └── index.wxml
│ │ ├── form-page.json
│ │ ├── form-page.less
│ │ ├── form-page.ts
│ │ └── form-page.wxml
│ ├── form
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── form.test.ts.snap
│ │ │ ├── comp
│ │ │ │ ├── index.json
│ │ │ │ ├── index.ts
│ │ │ │ └── index.wxml
│ │ │ ├── form-validator.test.ts
│ │ │ ├── form.test.ts
│ │ │ └── validator.test.ts
│ │ ├── form-validator.ts
│ │ ├── form.json
│ │ ├── form.ts
│ │ ├── form.wxml
│ │ └── validator.ts
│ ├── gallery
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── gallery.test.ts.snap
│ │ │ └── gallery.test.ts
│ │ ├── gallery.json
│ │ ├── gallery.less
│ │ ├── gallery.ts
│ │ └── gallery.wxml
│ ├── grids
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── grid.test.ts.snap
│ │ │ └── grid.test.ts
│ │ ├── grids.json
│ │ ├── grids.less
│ │ ├── grids.ts
│ │ └── grids.wxml
│ ├── half-screen-dialog
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── half-screen-dialog.test.ts.snap
│ │ │ └── half-screen-dialog.test.ts
│ │ ├── half-screen-dialog.json
│ │ ├── half-screen-dialog.less
│ │ ├── half-screen-dialog.ts
│ │ └── half-screen-dialog.wxml
│ ├── icon
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── icon.test.ts.snap
│ │ │ └── icon.test.ts
│ │ ├── base64.ts
│ │ ├── icon.json
│ │ ├── icon.less
│ │ ├── icon.ts
│ │ ├── icon.wxml
│ │ └── icondata.ts
│ ├── index.json
│ ├── index.less
│ ├── index.ts
│ ├── index.wxml
│ ├── loading
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── loading.test.ts.snap
│ │ │ └── loading.test.ts
│ │ ├── loading-icon.svg
│ │ ├── loading.json
│ │ ├── loading.less
│ │ ├── loading.ts
│ │ └── loading.wxml
│ ├── msg
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── msg.test.ts.snap
│ │ │ └── msg.test.ts
│ │ ├── msg.json
│ │ ├── msg.less
│ │ ├── msg.ts
│ │ └── msg.wxml
│ ├── navigation-bar
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── navigation-bar.test.ts.snap
│ │ │ └── navigation-bar.test.ts
│ │ ├── navigation-bar.json
│ │ ├── navigation-bar.less
│ │ ├── navigation-bar.ts
│ │ └── navigation-bar.wxml
│ ├── patch.less
│ ├── searchbar
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── searchbar.test.ts.snap
│ │ │ └── searchbar.test.ts
│ │ ├── searchbar.json
│ │ ├── searchbar.less
│ │ ├── searchbar.ts
│ │ └── searchbar.wxml
│ ├── slideview
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── slideview.test.ts.snap
│ │ │ └── slideview.test.ts
│ │ ├── slideview-skyline.json
│ │ ├── slideview-skyline.less
│ │ ├── slideview-skyline.ts
│ │ ├── slideview-skyline.wxml
│ │ ├── slideview.json
│ │ ├── slideview.less
│ │ ├── slideview.ts
│ │ ├── slideview.wxml
│ │ └── slideview.wxs
│ ├── static
│ │ └── icon
│ │ │ ├── s-arrow-back.png
│ │ │ └── s-arrow-back.svg
│ ├── tabbar
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── tabbar.test.ts.snap
│ │ │ └── tabbar.test.ts
│ │ ├── tabbar.json
│ │ ├── tabbar.less
│ │ ├── tabbar.ts
│ │ └── tabbar.wxml
│ ├── toptips
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── toptips.test.ts.snap
│ │ │ └── toptips.test.ts
│ │ ├── toptips.json
│ │ ├── toptips.less
│ │ ├── toptips.ts
│ │ └── toptips.wxml
│ ├── uploader
│ │ ├── __test__
│ │ │ ├── __snapshots__
│ │ │ │ └── uploader.test.ts.snap
│ │ │ └── uploader.test.ts
│ │ ├── uploader.json
│ │ ├── uploader.less
│ │ ├── uploader.ts
│ │ └── uploader.wxml
│ └── utils
│ │ ├── object.ts
│ │ ├── string.ts
│ │ └── utils.less
├── example
│ ├── actionsheet
│ │ ├── actionsheet.js
│ │ ├── actionsheet.json
│ │ ├── actionsheet.wxml
│ │ └── actionsheet.wxss
│ ├── article
│ │ ├── article.js
│ │ ├── article.json
│ │ ├── article.wxml
│ │ └── article.wxss
│ ├── badge
│ │ ├── badge.js
│ │ ├── badge.json
│ │ ├── badge.wxml
│ │ └── badge.wxss
│ ├── button
│ │ ├── button.js
│ │ ├── button.json
│ │ ├── button.wxml
│ │ └── button.wxss
│ ├── cell
│ │ ├── cell.js
│ │ ├── cell.json
│ │ ├── cell.wxml
│ │ ├── cell.wxss
│ │ ├── icon_del.svg
│ │ ├── icon_love.svg
│ │ └── icon_star.svg
│ ├── common.less
│ ├── dialog
│ │ ├── dialog.js
│ │ ├── dialog.json
│ │ ├── dialog.wxml
│ │ └── dialog.wxss
│ ├── flex
│ │ ├── flex.js
│ │ ├── flex.json
│ │ ├── flex.wxml
│ │ └── flex.wxss
│ ├── footer
│ │ ├── footer.js
│ │ ├── footer.json
│ │ ├── footer.wxml
│ │ └── footer.wxss
│ ├── form-page
│ │ ├── form-page.js
│ │ ├── form-page.json
│ │ ├── form-page.wxml
│ │ └── form-page.wxss
│ ├── form
│ │ ├── form.js
│ │ ├── form.json
│ │ ├── form.wxml
│ │ └── form.wxss
│ ├── gallery
│ │ ├── gallery.js
│ │ ├── gallery.json
│ │ ├── gallery.wxml
│ │ └── gallery.wxss
│ ├── grid
│ │ ├── grid.js
│ │ ├── grid.json
│ │ ├── grid.wxml
│ │ └── grid.wxss
│ ├── half-screen-dialog
│ │ ├── half-screen-dialog.js
│ │ ├── half-screen-dialog.json
│ │ ├── half-screen-dialog.wxml
│ │ └── half-screen-dialog.wxss
│ ├── icons
│ │ ├── icons.js
│ │ ├── icons.json
│ │ ├── icons.wxml
│ │ └── icons.wxss
│ ├── images
│ │ ├── base64.js
│ │ ├── icon_del.svg
│ │ ├── icon_footer.png
│ │ ├── icon_footer_link.png
│ │ ├── icon_intro.png
│ │ ├── icon_love.svg
│ │ ├── icon_nav_feedback.png
│ │ ├── icon_nav_form.png
│ │ ├── icon_nav_layout.png
│ │ ├── icon_nav_nav.png
│ │ ├── icon_nav_search.png
│ │ ├── icon_nav_special.png
│ │ ├── icon_nav_widget.png
│ │ ├── icon_nav_z-index.png
│ │ ├── icon_star.svg
│ │ ├── icon_tabbar.png
│ │ ├── logo.png
│ │ ├── pic_160.png
│ │ ├── pic_article.png
│ │ ├── tabbar_icon_chat_active.png
│ │ ├── tabbar_icon_chat_active.svg
│ │ ├── tabbar_icon_chat_default.png
│ │ ├── tabbar_icon_chat_default.svg
│ │ ├── tabbar_icon_setting_active.png
│ │ ├── tabbar_icon_setting_active.svg
│ │ ├── tabbar_icon_setting_default.png
│ │ ├── tabbar_icon_setting_default.svg
│ │ └── vcode.jpg
│ ├── index.js
│ ├── index.json
│ ├── index.less
│ ├── index.wxml
│ ├── loading
│ │ ├── loading.js
│ │ ├── loading.json
│ │ ├── loading.wxml
│ │ └── loading.wxss
│ ├── loadmore
│ │ ├── loadmore.js
│ │ ├── loadmore.json
│ │ ├── loadmore.wxml
│ │ └── loadmore.wxss
│ ├── msg
│ │ ├── msg.js
│ │ ├── msg.json
│ │ ├── msg.wxml
│ │ ├── msg.wxss
│ │ ├── msg_fail.js
│ │ ├── msg_fail.json
│ │ ├── msg_fail.wxml
│ │ ├── msg_fail.wxss
│ │ ├── msg_success.js
│ │ ├── msg_success.json
│ │ ├── msg_success.wxml
│ │ ├── msg_success.wxss
│ │ ├── msg_text.js
│ │ ├── msg_text.json
│ │ ├── msg_text.wxml
│ │ ├── msg_text.wxss
│ │ ├── msg_text_primary.js
│ │ ├── msg_text_primary.json
│ │ ├── msg_text_primary.wxml
│ │ └── msg_text_primary.wxss
│ ├── navbar
│ │ ├── navbar.js
│ │ ├── navbar.json
│ │ ├── navbar.wxml
│ │ └── navbar.wxss
│ ├── navigation
│ │ ├── navigation.js
│ │ ├── navigation.json
│ │ ├── navigation.wxml
│ │ └── navigation.wxss
│ ├── panel
│ │ ├── panel.js
│ │ ├── panel.json
│ │ ├── panel.wxml
│ │ └── panel.wxss
│ ├── picker
│ │ ├── picker.js
│ │ ├── picker.json
│ │ ├── picker.wxml
│ │ └── picker.wxss
│ ├── preview
│ │ ├── preview.js
│ │ ├── preview.json
│ │ ├── preview.wxml
│ │ └── preview.wxss
│ ├── progress
│ │ ├── progress.js
│ │ ├── progress.json
│ │ ├── progress.wxml
│ │ └── progress.wxss
│ ├── searchbar
│ │ ├── searchbar.js
│ │ ├── searchbar.json
│ │ ├── searchbar.wxml
│ │ └── searchbar.wxss
│ ├── slider
│ │ ├── slider.js
│ │ ├── slider.json
│ │ ├── slider.wxml
│ │ └── slider.wxss
│ ├── slideview
│ │ ├── icon_del.svg
│ │ ├── icon_love.svg
│ │ ├── icon_star.svg
│ │ ├── slideview.js
│ │ ├── slideview.json
│ │ ├── slideview.wxml
│ │ └── slideview.wxss
│ ├── tabbar
│ │ ├── tabbar.js
│ │ ├── tabbar.json
│ │ ├── tabbar.wxml
│ │ └── tabbar.wxss
│ ├── toast
│ │ ├── toast.js
│ │ ├── toast.json
│ │ ├── toast.wxml
│ │ └── toast.wxss
│ ├── toptips
│ │ ├── toptips.js
│ │ ├── toptips.json
│ │ ├── toptips.wxml
│ │ └── toptips.wxss
│ └── uploader
│ │ ├── uploader.js
│ │ ├── uploader.json
│ │ ├── uploader.wxml
│ │ └── uploader.wxss
└── project.config.json
├── tools
├── build.js
├── checkcomponents.js
├── checkwxss.js
├── config.js
├── package.json
└── utils.js
└── tsconfig.json
/.eslintignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | src/weui-wxss
3 | miniprogram_dist
4 | miniprogram_dev
5 | tools
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | parser: '@typescript-eslint/parser',
4 | parserOptions: {
5 | ecmaVersion: 6,
6 | sourceType: 'module'
7 | },
8 | env: {
9 | es6: true,
10 | browser: true,
11 | jest: true,
12 | commonjs: true,
13 | node: true
14 | },
15 | plugins: [
16 | '@typescript-eslint',
17 | 'prettier'
18 | ],
19 | extends: [
20 | 'eslint:recommended',
21 | 'plugin:@typescript-eslint/eslint-recommended',
22 | 'plugin:@typescript-eslint/recommended',
23 | 'prettier/@typescript-eslint'
24 | ],
25 | globals: {
26 | wx: true,
27 | App: true,
28 | Page: true,
29 | Component: true
30 | },
31 | rules: {
32 | 'prettier/prettier': 'error',
33 | 'no-console': ["error", { allow: ["warn", "error"] } ],
34 | '@typescript-eslint/ban-ts-ignore': 'off',
35 | '@typescript-eslint/no-empty-function': 'off',
36 | '@typescript-eslint/explicit-function-return-type': 'off',
37 | '@typescript-eslint/no-explicit-any': 'off'
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/----.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 特性请求
3 | about: 提出一个好的特性
4 | title: "[FEATURE]"
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | ## 遇到的问题
11 | 描述你想要达到的效果,以及你的使用场景
12 |
13 | ## 特性方案
14 | 描述你希望的实现方案
15 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/--bug.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 报告Bug
3 | about: 创建一个Bug报告
4 | title: "[BUG]"
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | ## Bug描述
11 | 描述你遇到的Bug,所产生的非预期行为
12 |
13 | ## 复现方式
14 | 复现该Bug的方式,建议直接提供 [代码片段](https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
15 |
16 | ## 版本信息
17 | - weui 版本 [useExtendedLib 引入则直接填写 useExtendedLib] :
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_Store
3 |
4 | logs
5 | *.log
6 | npm-debug.log*
7 | yarn-debug.log*
8 | yarn-error.log*
9 |
10 | miniprogram_dist
11 | miniprogram_dev
12 | node_modules
13 | coverage
14 | dist
15 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wechat-miniprogram/weui-miniprogram/c2fe8e2598b345e7d663fa5ceda7bb9229d52fbd/.gitmodules
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_Store
3 | package-lock.json
4 |
5 | logs
6 | *.log
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | test
12 | tools
13 | docs
14 | miniprogram_dev
15 | node_modules
16 | coverage
17 | tsconfig.json
18 | tslint.json
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | registry=https://registry.npmjs.org
2 |
--------------------------------------------------------------------------------
/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | // 一行最多 100 字符
3 | printWidth: 100,
4 | // 使用 4 个空格缩进
5 | tabWidth: 4,
6 | // 不使用缩进符,而使用空格
7 | useTabs: false,
8 | // 行尾需要有分号
9 | semi: false,
10 | // 使用单引号
11 | singleQuote: true,
12 | // 对象的 key 仅在必要时用引号
13 | quoteProps: 'as-needed',
14 | // 末尾不需要逗号
15 | trailingComma: 'none',
16 | // 大括号内的首尾需要空格
17 | bracketSpacing: true,
18 | // 箭头函数,只有一个参数的时候,也需要括号
19 | arrowParens: 'always',
20 | // 每个文件格式化的范围是文件的全部内容
21 | rangeStart: 0,
22 | rangeEnd: Infinity,
23 | // 不需要写文件开头的 @prettier
24 | requirePragma: false,
25 | // 不需要自动在文件开头插入 @prettier
26 | insertPragma: false,
27 | // 使用默认的折行标准
28 | proseWrap: 'preserve',
29 | // 根据显示样式决定 html 要不要折行
30 | htmlWhitespaceSensitivity: 'css',
31 | // 换行符使用 lf
32 | endOfLine: 'lf'
33 | };
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "v12.16.3"
4 | script: npm run test
5 | after_script:
6 | - npm run codecov
7 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 cunjinli,rockhou,xushengni,tomylin
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## WeUI组件库简介
2 |
3 | [](https://www.npmjs.com/package/weui-miniprogram)
4 | [](https://www.npmjs.com/package/weui-miniprogram)
5 | [](https://github.com/wechat-miniprogram/weui-miniprogram)
6 | [](https://github.com/wechat-miniprogram/weui-miniprogram)
7 | [](https://github.com/wechat-miniprogram/weui-miniprogram)
8 |
9 | 这是一套基于样式库[weui-wxss](https://github.com/Tencent/weui-wxss/)开发的小程序扩展组件库,同微信原生视觉体验一致的扩展组件库,由微信官方设计团队和小程序团队为微信小程序量身设计,令用户的使用感知更加统一。
10 |
11 | ## 如何使用
12 | 详细使用参考[文档](https://wechat-miniprogram.github.io/weui/docs/)
13 |
14 | ## 开发
15 | 1. 初始化
16 | ```
17 | npm run init
18 | ```
19 |
20 | 2. 执行命令:
21 |
22 | ```
23 | npm run dev
24 | ```
25 |
26 | 3. 构建组件库:
27 |
28 | ```
29 | npm run build
30 | ```
31 |
32 | ## 适配 DarkMode
33 |
34 | 在根结点(或组件的外层结点)增加属性 `data-weui-theme="dark"`,即把 WeUI 组件切换到 DarkMode 的表现,如:
35 |
36 | ```html
37 |
38 | ...
39 |
40 | ```
41 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['@mpflow/plugin-babel/preset', '@mpflow/plugin-typescript/preset']
3 | }
4 |
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | ## WeUI组件库简介
2 | 这是一套基于样式库[weui-wxss](https://github.com/Tencent/weui-wxss/)开发的小程序扩展组件库,同微信原生视觉体验一致的UI组件库,由微信官方设计团队和小程序团队为微信小程序量身设计,令用户的使用感知更加统一。
3 |
4 | > 支持[扩展库](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#useExtendedLib)引入,不占用小程序包体积。
5 |
6 | ## 项目背景
7 | 随着小程序的普及,微信也有很多内部小程序在开发,每个小程序都需要从零到1进行开发设计,而这个过程中,有大量的UI交互是重复的,另外,微信内部已经有一套H5版本的WeUI样式库。综合考虑,我们基于WeUI样式库开发了小程序版本的UI组件库,在内部多个小程序项目已经使用OK的情况下,我们把这套组件库开源让外部开发者也可以使用,欢迎大家Star以及提Issue。
8 |
9 | ## 快速上手
10 | 请参考[快速上手](./quickstart.md)
11 |
12 | ## 在线预览
13 | 扫描下方小程序码可以预览该组件库
14 |
15 | 
16 |
17 | ## 参与贡献
18 | 欢迎给我们提出宝贵见的意见,[项目地址](https://github.com/wechat-miniprogram/weui-miniprogram)
19 |
--------------------------------------------------------------------------------
/docs/actionsheet.md:
--------------------------------------------------------------------------------
1 | # ActionSheet
2 | 底部弹起的操作按钮组件
3 |
4 | ## 代码引入
5 | 在 page.json 中引入组件
6 | ```json
7 | {
8 | "usingComponents": {
9 | "mp-actionSheet": "weui-miniprogram/actionsheet/actionsheet"
10 | }
11 | }
12 | ```
13 |
14 | ## 示例代码
15 | ```html
16 |
17 |
18 |
19 | ```
20 |
21 | ```js
22 | Page({
23 | data: {
24 | showActionsheet: false,
25 | groups: [
26 | { text: '示例菜单', value: 1 },
27 | { text: '示例菜单', value: 2 },
28 | { text: '负向菜单', type: 'warn', value: 3 }
29 | ]
30 | },
31 | close: function () {
32 | this.setData({
33 | showActionsheet: false
34 | })
35 | },
36 | btnClick(e) {
37 | console.log(e)
38 | this.close()
39 | }
40 | })
41 | ```
42 | ## 效果展示
43 | 
44 |
45 | ## 属性列表
46 | | 属性 | 类型 | 默认值 | 必填 | 说明 |
47 | | ---- | ---- | ------ | -------- | ---- |
48 | | title | string | | 否 | 标题 |
49 | | show-cancel | boolean | true | 否 | 是否显示取消按钮 |
50 | | cancel-text | string | | 否 | 取消按钮的文本 |
51 | | mask-class | string | | 否 | 背景蒙层的class |
52 | | ext-class | string | | 否 | ActionSheet额外的class |
53 | | mask-closable | boolean | true | 否 | 点击背景蒙层是否可以关闭ActionSheet |
54 | | mask | boolean | true | 否 | 是否显示背景蒙层 |
55 | | show | boolean | false | 否 | 是否显示ActionSheet |
56 | | actions | Array | false | 是 | ActionSheet的按钮项的配置,每一项是包含text、value、type的Object,type的取值为warn和default,表示两种样式 |
57 | | bindclose | eventhandler | | 否 | 点击背后的mask关闭掉ActionSheet触发的事件 |
58 | | bindactiontap | eventhandler | | 否 | 点击ActionSheet的按钮项触发的事件,detail为{ value, index } |
59 |
60 | ## Slot
61 | | 名称 | 描述 |
62 | | ---- | ---- |
63 | | title | 标题区域slot |
--------------------------------------------------------------------------------
/docs/badge.md:
--------------------------------------------------------------------------------
1 | # Badge徽章
2 | 出现在按钮、图标附近的数字或者状态标记。
3 |
4 | ## 代码引入
5 | 在 page.json 中引入组件
6 | ```json
7 | {
8 | "usingComponents": {
9 | "mp-badge": "weui-miniprogram/badge/badge"
10 | }
11 | }
12 | ```
13 |
14 | ## 属性列表
15 | | 属性 | 类型 | 默认值 | 必填 | 说明 |
16 | | ---- | ---- | ------ | -------- | ---- |
17 | | extClass | string | | 否 | 组件类名 |
18 | | content | string | | 否 | 内容区域 |
19 |
20 | ## 提示
21 | 不设置 content 属性时,默认展示小圆点
--------------------------------------------------------------------------------
/docs/cell.md:
--------------------------------------------------------------------------------
1 | # Cell
2 | Cell是列表或者是表单的一项,常用于设置页的展示,或者用在表单中,作为表单的每一个要填写的项,Cell必须要放在[Cells](./cells.md)组件的下面。
3 |
4 | ## 代码引入
5 | 在 page.json 中引入组件
6 | ```json
7 | {
8 | "usingComponents": {
9 | "mp-cells": "weui-miniprogram/cells/cells",
10 | "mp-cell": "weui-miniprogram/cell/cell"
11 | }
12 | }
13 | ```
14 |
15 | ## 属性列表
16 | | 属性 | 类型 | 默认值 | 必填 | 说明 |
17 | | ---- | ---- | ------ | -------- | ---- |
18 | | ext-class | string | | 否 | 添加在组件内部结构的class,可用于修改组件内部的样式 |
19 | | icon | string | | 否 | Cell的最左侧的icon,是本地图片的路径,icon和名为icon的slot互斥 |
20 | | title | string | | 否 | Cell最左侧的标题,一般用在[Form](./form.md)表单组件里面,icon和title二选一,title和名为title的slot互斥 |
21 | | hover | boolean | false | 否 | 是否有hover效果 |
22 | | link | boolean | false | 否 | 右侧是有跳转的箭头,`v1.0`后的版本,`link: true` 会自带 hover 效果 |
23 | | value | string | | 是 | Cell的值,和默认的slot互斥 |
24 | | show-error | boolean | false | 否 | 用在[Form](./form.md)表单组件里面,在表单校验出错的时候是否把Cell标为warn状态 |
25 | | prop | string | | 否 | 用在[Form](./form.md)表单组件里面,需要校验的表单的字段名 |
26 | | footer | string | | 否 | Cell右侧区域的内容,和名为footer的slot互斥 |
27 | | inline | boolean | | 否 | 用在[Form](./form.md)表单组件里面,表示表单项是左右显示还是上下显示 |
28 |
29 | ## Slot
30 | | 名称 | 描述 |
31 | | ---- | ---- |
32 | | icon | 左侧图标slot |
33 | | title | 标题slot |
34 | | 默认 | 内容slot |
35 | | footer | 右侧区域slot |
36 |
37 |
--------------------------------------------------------------------------------
/docs/cells.md:
--------------------------------------------------------------------------------
1 | # Cells
2 | Cells是列表分组,常用于嵌套一组Cell或者[Checkbox](./checkbox.md),注意,Checkbox-group和Cell组件都必须放在Cells组件下面,Cells效果如下图所示。
3 |
4 | 
5 |
6 | ## 代码引入
7 | 在 page.json 中引入组件
8 | ```json
9 | {
10 | "usingComponents": {
11 | "mp-cells": "weui-miniprogram/cells/cells",
12 | "mp-cell": "weui-miniprogram/cell/cell"
13 | }
14 | }
15 | ```
16 |
17 | ## 示例代码
18 | ```html
19 |
20 |
21 |
22 |
23 | 标题文字(使用slot)
24 | 说明文字
25 |
26 |
27 | ```
28 |
29 | ```js
30 | // page.js示例代码
31 | Page({
32 | });
33 | ```
34 |
35 |
36 | ## 属性列表
37 | | 属性 | 类型 | 默认值 | 必填 | 说明 |
38 | | ---- | ---- | ------ | -------- | ---- |
39 | | ext-class | string | | 否 | 添加在组件内部结构的class,可用于修改组件内部的样式 |
40 | | title | string | | 否 | Cells的标题 |
41 | | footer | string | | 否 | Cells底部的文字 |
42 |
43 | ## Slot
44 | | 名称 | 描述 |
45 | | ---- | ---- |
46 | | 默认 | 内容slot |
47 |
--------------------------------------------------------------------------------
/docs/dialog.md:
--------------------------------------------------------------------------------
1 | # Dialog
2 | Dialog弹窗组件。
3 |
4 | ## 代码引入
5 | 在 page.json 中引入组件
6 | ```json
7 | {
8 | "usingComponents": {
9 | "mp-dialog": "weui-miniprogram/dialog/dialog"
10 | }
11 | }
12 | ```
13 |
14 |
15 | ## 属性列表
16 | | 属性 | 类型 | 默认值 | 必填 | 说明 |
17 | | ---- | ---- | ------ | -------- | ---- |
18 | | ext-class | string | | 否 | 添加在组件内部结构的class,可用于修改组件内部的样式 |
19 | | title | string | | 否 | 弹窗的标题 |
20 | | buttons | array\