Merge branch 'dev' into dev

pull/21412/head
Ivan 2024-11-13 16:54:45 +07:00 committed by GitHub
commit b04766a094
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
135 changed files with 26136 additions and 276 deletions

View File

@ -1,5 +1,6 @@
src/utils/popper.js
src/utils/date.js
src/utils/lodash.js
examples/play
*.sh
node_modules

45
.github/workflows/preview-build.yml vendored Normal file
View File

@ -0,0 +1,45 @@
name: Preview Build
on: pull_request
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
PULL_REQUEST_NUMBER: ${{ github.event.number }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '10.15.0'
registry-url: https://registry.npmjs.com/
- name: Build
run: npm run bootstrap && npm run deploy:build
# share website dist
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: docs
path: examples/element-ui/
retention-days: 1
# write pr.txt for share
- name: Save pr number
if: ${{ always() }}
run: echo ${PULL_REQUEST_NUMBER} > ./pr.txt
# share pr number
- name: Upload pr number
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: pr
path: ./pr.txt
retention-days: 1

83
.github/workflows/preview-deploy.yml vendored Normal file
View File

@ -0,0 +1,83 @@
name: Preview Deploy
on:
workflow_run:
workflows: ['Preview Build']
types:
- completed
jobs:
success:
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
steps:
- name: download pr artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: pr
- name: save PR id
id: pr
run: echo "::set-output name=id::$(<pr.txt)"
- name: download docs artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: success
name: docs
- name: upload surge service
id: deploy
run: |
export DEPLOY_DOMAIN=https://preview-pr-${{ steps.pr.outputs.id }}-element-ui.surge.sh
npx surge --project ./ --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }}
- name: update status comment
uses: actions-cool/maintain-one-comment@v1.2.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
🎊 PR Preview has been successfully built and deployed to https://preview-pr-${{ steps.pr.outputs.id }}-element-ui.surge.sh
<img width="300" src="https://user-images.githubusercontent.com/507615/90250366-88233900-de6e-11ea-95a5-84f0762ffd39.png">
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'
number: ${{ steps.pr.outputs.id }}
- name: The job failed
if: ${{ failure() }}
uses: actions-cool/maintain-one-comment@v1.2.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
😭 Deploy PR Preview failed.
<img width="300" src="https://user-images.githubusercontent.com/507615/90250824-4e066700-de6f-11ea-8230-600ecc3d6a6b.png">
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'
number: ${{ steps.pr.outputs.id }}
failed:
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'failure'
steps:
- name: download pr artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: pr
- name: save PR id
id: pr
run: echo "::set-output name=id::$(<pr.txt)"
- name: The job failed
uses: actions-cool/maintain-one-comment@v1.2.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
😭 Deploy PR Preview failed.
<img width="300" src="https://user-images.githubusercontent.com/507615/90250824-4e066700-de6f-11ea-8230-600ecc3d6a6b.png">
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'
number: ${{ steps.pr.outputs.id }}

1
.gitignore vendored
View File

@ -22,3 +22,4 @@ coverage
waiter.config.js
build/bin/algolia-key.js
.envrc
.history/

View File

@ -1,5 +1,199 @@
## Changelog
### 2.15.14
*2023-08-24*
#### Bug fixes
- Img
- Delete referrerpolicy prop (#22651 by @xinguanhua)
#### Optimization
- Docs
- Update readme and website example links (#22642 by @lyfeyaj)
- Update popper links (#22539 by @brizer)
- I18n
- Update translation of Spanish (#22430 by @jcardus)
- Add sr-Latn translation (#22567 by @N-M)
- Update Uzbek translation (#22390 by @akahon)
- Statistics
- Fix doc; Optimized code (#22384 by @webvs2)
- Table
- Add highlight selection row (#22382 by @wangdaodao)
### 2.15.13
*2023-02-12*
#### Bug fixes
- Docs
- Fix Statistic docs (#22383 by @JUST-Limbo)
- Fix Input docs (#22093 by @lm312)
- Fix en-US docs (#22268 #22269 #22270 by @Hazel-Lin)
- Fix Pagination docs (#22288 by @xujintai123)
- Fix: Links docs (#22370 by @itmier)
- Statistics
- fix slot display bug (#22375 by @webvs2)
- Chore
- missing web-type after publishing (#22271 by @loosheng)
#### Optimization
- InputNumber
- Fix touch one click trigger twice on the window touch pad (#22185 by @mrsai)
- Image
- Add initialIndex prop (#22346 by @inkroom)
- Statistics
- Updated countdown feature to localize lodash Closes (#22260 by @webvs2)
- Update code and doc (#22276 by @webvs2)
- Other
- fix web-types type props (#22281 by @whzxc)
### 2.15.12
*2022-11-16*
#### Bug fixes
- Statistic
- Fixed the thousandth bit bug (#22252 by @webvs2)
- Other
- Fix 2.15.11 element-theme-chalk publish fail bug
### 2.15.11
*2022-11-15*
#### Bug fixes
- Docs
- Fix Radio docs (#22178 by @bchen1029)
- Fix Progress docs
#### Optimization
- I18n
- Update translation of Malaysian (#22185 by @z4q)
- Update translation of Norwegian (#22145 by @Barsnes)
- Progress
- Add defineBackColor and textColor prop (#22089 by @lm312)
- Statistics
- Add new component Statistics (#22159 by @webvs2)
- Other
- Add Web Types to improve code assistance in WebStorm IDE and other JetBrains IDEs (#22135 by @piotrtomiak)
### 2.15.10
*2022-09-13*
#### Bug fixes
- DatePicker
- Fix props placement error (#21908 by @lqzhgood)
- Loading
- Fix sticky DOM error (#22087 by @zzjjhh001)
- Docs
- Fix Popover docs (#22083 by @lm312)
- Fix Skeleton docs (#22092 by @lm312)
- Fix DatePicker docs (#21970 by @guojiongwei)
- Tree:
- fix lazy-load default check problem (#21934 by @kiss-yu)
#### Optimization
- I18n
- Add translation of Sinhalese (#21936 by @sayuri-gi)
- Update translation of Spanish (#21924 by @jcardus)
- Add translation of Malaysian (#22028 by @iorange0411)
- Update translation of Swahili (#21904 by @Cholowao)
- Utils
- update date-util.js (#22099 by @Due07)
- DatePicker
- add months And years type (#21918 by @akiko123456)
### 2.15.9
*2022-06-02*
#### Bug fixes
- Table
- Fix Tabl-header shake bug (#21863 by @bofeng)
- Fix when partial import show `el-checkbox not imported` error (#21828 by @bobohuochai)
- FormItem
- Fix change rules verification not reset bug (#21892 by @bofeng)
- Cascader
- Fix change options unexpect error (#21759 by @louiebb)
- Docs
- Fix Popover docs (#21843 by @lod61)
- Fix Calendar docs (#21814 by @GoJam11)
- Fix TimePicker docs (#21803 by @Alanscut)
- Fix DatePicker docs (#21877 by @Nirvanaiu)
- Other
- Fix codepen display bug (#21863 by @bofeng)
#### Optimization
- I18n
- Add translation of Swahili (#21895 by @quilltouch)
- Chore
- Use launch-editor-middleware in dev environment (#21633 by @polemices)
- DatePicker & Cascader
- Optimize the dropdown animation direction (#21806 by @XivLaw)
- Tooltip
- Optimize `getFirstElement` code (#21886 by @zhankang)
- Input
- Optimize scss code (#21558 by @cheese-git)
### 2.15.8
*2022-04-12*
#### Bug fixes
- Drawer
- Fix appendToBody failure problem (#21264 by @cs1707)
- Switch
- Fix toggling value problem(#19473 by @EdwinBetanc0urt)
- Docs
- Fix input docs (#21723 by @justforuse)
- Fix DatePicker docs (#21663 by @justforuse)
- Fix Skeleton docs (#21601 by @yanwydxf)
- Others
- Fix vue version (#21736 by @ckvv)
#### Optimization
- I18n
- add translation of Azerbaijani (#21012 by @ricardotondello)
- update translation of Slovenian (#21729 by @patik123)
- update translation of Slovak (#21711 by @sjaustirni )
- add translation of Icelandic (#21709 by @aronhr)
- add translation of Bengali (#21485 by @llwwtt)
#### Others
- Due to compatibility considerations, the PR on node-sass (#21019 by @linxsbox) of 2.15.7 release has been withdrawn and will be published in an appropriate version after re-evaluation.
### 2.15.7
*2021-11-18*
#### Bug fixes
- Select
- fix click icon triggering dropdown (#21314 by @dennyak47)
- fix keydown event when composition (#21336 by @bchen1029)
- Badge
- fix type class when is-dot (#21308 by @adaex)
- Form
- validate method reject error info (#21374 by @cs1707)
- Table
- fix resizeObserver loop limit exceeded (#21255 by @tomieric)
- fix toggleAllSelection bug when table is empty (#21456 by @cs1707)
- optimize performance (#21330 by @cs1707)
- Button
- fix disabled priority (#21375 by @cs1707)
- Descriptions
- fix label slot bug (#21462 by @cs1707)
- SASS
- replace node-sass with dart-sass (#21019 by @linxsbox)
- Docs
- fix skeleton typos (#21408 by @zhhbstudio)
### 2.15.6
*2021-09-02*

View File

@ -1,5 +1,199 @@
## Changelog
### 2.15.14
*2023-08-24*
#### Bug fixes
- Img
- Delete referrerpolicy prop (#22651 by @xinguanhua)
#### Optimization
- Docs
- Update readme and website example links (#22642 by @lyfeyaj)
- Update popper links (#22539 by @brizer)
- I18n
- Update translation of Spanish (#22430 by @jcardus)
- Add sr-Latn translation (#22567 by @N-M)
- Update Uzbek translation (#22390 by @akahon)
- Statistics
- Fix doc; Optimized code (#22384 by @webvs2)
- Table
- Add highlight selection row (#22382 by @wangdaodao)
### 2.15.13
*2023-02-12*
#### Bug fixes
- Docs
- Fix Statistic docs (#22383 by @JUST-Limbo)
- Fix Input docs (#22093 by @lm312)
- Fix en-US docs (#22268 #22269 #22270 by @Hazel-Lin)
- Fix Pagination docs (#22288 by @xujintai123)
- Fix: Links docs (#22370 by @itmier)
- Statistics
- fix slot display bug (#22375 by @webvs2)
- Chore
- missing web-type after publishing (#22271 by @loosheng)
#### Optimization
- InputNumber
- Fix touch one click trigger twice on the window touch pad (#22185 by @mrsai)
- Image
- Add initialIndex prop (#22346 by @inkroom)
- Statistics
- Updated countdown feature to localize lodash Closes (#22260 by @webvs2)
- Update code and doc (#22276 by @webvs2)
- Other
- fix web-types type props (#22281 by @whzxc)
### 2.15.12
*2022-11-16*
#### Bug fixes
- Statistic
- Fixed the thousandth bit bug (#22252 by @webvs2)
- Other
- Fix 2.15.11 element-theme-chalk publish fail bug
### 2.15.11
*2022-11-15*
#### Bug fixes
- Docs
- Fix Radio docs (#22178 by @bchen1029)
- Fix Progress docs
#### Optimization
- I18n
- Update translation of Malaysian (#22185 by @z4q)
- Update translation of Norwegian (#22145 by @Barsnes)
- Progress
- Add defineBackColor and textColor prop (#22089 by @lm312)
- Statistics
- Add new component Statistics (#22159 by @webvs2)
- Other
- Add Web Types to improve code assistance in WebStorm IDE and other JetBrains IDEs (#22135 by @piotrtomiak)
### 2.15.10
*2022-09-13*
#### Bug fixes
- DatePicker
- Fix props placement error (#21908 by @lqzhgood)
- Loading
- Fix sticky DOM error (#22087 by @zzjjhh001)
- Docs
- Fix Popover docs (#22083 by @lm312)
- Fix Skeleton docs (#22092 by @lm312)
- Fix DatePicker docs (#21970 by @guojiongwei)
- Tree:
- fix lazy-load default check problem (#21934 by @kiss-yu)
#### Optimization
- I18n
- Add translation of Sinhalese (#21936 by @sayuri-gi)
- Update translation of Spanish (#21924 by @jcardus)
- Add translation of Malaysian (#22028 by @iorange0411)
- Update translation of Swahili (#21904 by @Cholowao)
- Utils
- update date-util.js (#22099 by @Due07)
- DatePicker
- add months And years type (#21918 by @akiko123456)
### 2.15.9
*2022-06-02*
#### Bug fixes
- Table
- Fix Tabl-header shake bug (#21863 by @bofeng)
- Fix when partial import show `el-checkbox not imported` error (#21828 by @bobohuochai)
- FormItem
- Fix change rules verification not reset bug (#21892 by @bofeng)
- Cascader
- Fix change options unexpect error (#21759 by @louiebb)
- Docs
- Fix Popover docs (#21843 by @lod61)
- Fix Calendar docs (#21814 by @GoJam11)
- Fix TimePicker docs (#21803 by @Alanscut)
- Fix DatePicker docs (#21877 by @Nirvanaiu)
- Other
- Fix codepen display bug (#21863 by @bofeng)
#### Optimization
- I18n
- Add translation of Swahili (#21895 by @quilltouch)
- Chore
- Use launch-editor-middleware in dev environment (#21633 by @polemices)
- DatePicker & Cascader
- Optimize the dropdown animation direction (#21806 by @XivLaw)
- Tooltip
- Optimize `getFirstElement` code (#21886 by @zhankang)
- Input
- Optimize scss code (#21558 by @cheese-git)
### 2.15.8
*2022-04-12*
#### Bug fixes
- Drawer
- Fix appendToBody failure problem (#21264 by @cs1707)
- Switch
- Fix toggling value problem(#19473 by @EdwinBetanc0urt)
- Docs
- Fix input docs (#21723 by @justforuse)
- Fix DatePicker docs (#21663 by @justforuse)
- Fix Skeleton docs (#21601 by @yanwydxf)
- Others
- Fix vue version (#21736 by @ckvv)
#### Optimization
- I18n
- add translation of Azerbaijani (#21012 by @ricardotondello)
- update translation of Slovenian (#21729 by @patik123)
- update translation of Slovak (#21711 by @sjaustirni )
- add translation of Icelandic (#21709 by @aronhr)
- add translation of Bengali (#21485 by @llwwtt)
#### Others
- Due to compatibility considerations, the PR on node-sass (#21019 by @linxsbox) of 2.15.7 release has been withdrawn and will be published in an appropriate version after re-evaluation.
### 2.15.7
*2021-11-18*
#### Bug fixes
- Select
- fix click icon triggering dropdown (#21314 by @dennyak47)
- fix keydown event when composition (#21336 by @bchen1029)
- Badge
- fix type class when is-dot (#21308 by @adaex)
- Form
- validate method reject error info (#21374 by @cs1707)
- Table
- fix resizeObserver loop limit exceeded (#21255 by @tomieric)
- fix toggleAllSelection bug when table is empty (#21456 by @cs1707)
- optimize performance (#21330 by @cs1707)
- Button
- fix disabled priority (#21375 by @cs1707)
- Descriptions
- fix label slot bug (#21462 by @cs1707)
- SASS
- replace node-sass with dart-sass (#21019 by @linxsbox)
- Docs
- fix skeleton typos (#21408 by @zhhbstudio)
### 2.15.6
*2021-09-02*

View File

@ -1,5 +1,199 @@
## Changelog
### 2.15.14
*2023-08-24*
#### Bug fixes
- Img
- Delete referrerpolicy prop (#22651 by @xinguanhua)
#### Optimization
- Docs
- Update readme and website example links (#22642 by @lyfeyaj)
- Update popper links (#22539 by @brizer)
- I18n
- Update translation of Spanish (#22430 by @jcardus)
- Add sr-Latn translation (#22567 by @N-M)
- Update Uzbek translation (#22390 by @akahon)
- Statistics
- Fix doc; Optimized code (#22384 by @webvs2)
- Table
- Add highlight selection row (#22382 by @wangdaodao)
### 2.15.13
*2023-02-12*
#### Bug fixes
- Docs
- Fix Statistic docs (#22383 by @JUST-Limbo)
- Fix Input docs (#22093 by @lm312)
- Fix en-US docs (#22268 #22269 #22270 by @Hazel-Lin)
- Fix Pagination docs (#22288 by @xujintai123)
- Fix: Links docs (#22370 by @itmier)
- Statistics
- fix slot display bug (#22375 by @webvs2)
- Chore
- missing web-type after publishing (#22271 by @loosheng)
#### Optimization
- InputNumber
- Fix touch one click trigger twice on the window touch pad (#22185 by @mrsai)
- Image
- Add initialIndex prop (#22346 by @inkroom)
- Statistics
- Updated countdown feature to localize lodash Closes (#22260 by @webvs2)
- Update code and doc (#22276 by @webvs2)
- Other
- fix web-types type props (#22281 by @whzxc)
### 2.15.12
*2022-11-16*
#### Bug fixes
- Statistic
- Fixed the thousandth bit bug (#22252 by @webvs2)
- Other
- Fix 2.15.11 element-theme-chalk publish fail bug
### 2.15.11
*2022-11-15*
#### Bug fixes
- Docs
- Fix Radio docs (#22178 by @bchen1029)
- Fix Progress docs
#### Optimization
- I18n
- Update translation of Malaysian (#22185 by @z4q)
- Update translation of Norwegian (#22145 by @Barsnes)
- Progress
- Add defineBackColor and textColor prop (#22089 by @lm312)
- Statistics
- Add new component Statistics (#22159 by @webvs2)
- Other
- Add Web Types to improve code assistance in WebStorm IDE and other JetBrains IDEs (#22135 by @piotrtomiak)
### 2.15.10
*2022-09-13*
#### Bug fixes
- DatePicker
- Fix props placement error (#21908 by @lqzhgood)
- Loading
- Fix sticky DOM error (#22087 by @zzjjhh001)
- Docs
- Fix Popover docs (#22083 by @lm312)
- Fix Skeleton docs (#22092 by @lm312)
- Fix DatePicker docs (#21970 by @guojiongwei)
- Tree:
- fix lazy-load default check problem (#21934 by @kiss-yu)
#### Optimization
- I18n
- Add translation of Sinhalese (#21936 by @sayuri-gi)
- Update translation of Spanish (#21924 by @jcardus)
- Add translation of Malaysian (#22028 by @iorange0411)
- Update translation of Swahili (#21904 by @Cholowao)
- Utils
- update date-util.js (#22099 by @Due07)
- DatePicker
- add months And years type (#21918 by @akiko123456)
### 2.15.9
*2022-06-02*
#### Bug fixes
- Table
- Fix Tabl-header shake bug (#21863 by @bofeng)
- Fix when partial import show `el-checkbox not imported` error (#21828 by @bobohuochai)
- FormItem
- Fix change rules verification not reset bug (#21892 by @bofeng)
- Cascader
- Fix change options unexpect error (#21759 by @louiebb)
- Docs
- Fix Popover docs (#21843 by @lod61)
- Fix Calendar docs (#21814 by @GoJam11)
- Fix TimePicker docs (#21803 by @Alanscut)
- Fix DatePicker docs (#21877 by @Nirvanaiu)
- Other
- Fix codepen display bug (#21863 by @bofeng)
#### Optimization
- I18n
- Add translation of Swahili (#21895 by @quilltouch)
- Chore
- Use launch-editor-middleware in dev environment (#21633 by @polemices)
- DatePicker & Cascader
- Optimize the dropdown animation direction (#21806 by @XivLaw)
- Tooltip
- Optimize `getFirstElement` code (#21886 by @zhankang)
- Input
- Optimize scss code (#21558 by @cheese-git)
### 2.15.8
*2022-04-12*
#### Bug fixes
- Drawer
- Fix appendToBody failure problem (#21264 by @cs1707)
- Switch
- Fix toggling value problem(#19473 by @EdwinBetanc0urt)
- Docs
- Fix input docs (#21723 by @justforuse)
- Fix DatePicker docs (#21663 by @justforuse)
- Fix Skeleton docs (#21601 by @yanwydxf)
- Others
- Fix vue version (#21736 by @ckvv)
#### Optimization
- I18n
- add translation of Azerbaijani (#21012 by @ricardotondello)
- update translation of Slovenian (#21729 by @patik123)
- update translation of Slovak (#21711 by @sjaustirni )
- add translation of Icelandic (#21709 by @aronhr)
- add translation of Bengali (#21485 by @llwwtt)
#### Others
- Due to compatibility considerations, the PR on node-sass (#21019 by @linxsbox) of 2.15.7 release has been withdrawn and will be published in an appropriate version after re-evaluation.
### 2.15.7
*2021-11-18*
#### Bug fixes
- Select
- fix click icon triggering dropdown (#21314 by @dennyak47)
- fix keydown event when composition (#21336 by @bchen1029)
- Badge
- fix type class when is-dot (#21308 by @adaex)
- Form
- validate method reject error info (#21374 by @cs1707)
- Table
- fix resizeObserver loop limit exceeded (#21255 by @tomieric)
- fix toggleAllSelection bug when table is empty (#21456 by @cs1707)
- optimize performance (#21330 by @cs1707)
- Button
- fix disabled priority (#21375 by @cs1707)
- Descriptions
- fix label slot bug (#21462 by @cs1707)
- SASS
- replace node-sass with dart-sass (#21019 by @linxsbox)
- Docs
- fix skeleton typos (#21408 by @zhhbstudio)
### 2.15.6
*2021-09-02*

View File

@ -1,5 +1,199 @@
## 更新日志
### 2.15.14
*2023-08-24*
#### Bug 修复
- Img
- 删除 referrerpolicy 属性 (#22651 by @xinguanhua)
#### 优化
- Docs
- 更新 readme and website example links (#22642 by @lyfeyaj)
- 更新 popper 官方文档链接 (#22539 by @brizer)
- I18n
- 更新 西班牙语 翻译 (#22430 by @jcardus)
- 新增 塞尔维亚语(拉丁) 翻译 (#22567 by @N-M)
- 更新 乌兹别克语 翻译 (#22390 by @akahon)
- Statistics
- 文档更新; 代码优化 (#22384 by @webvs2)
- Table
- 增加高亮选中行属性 (#22382 by @wangdaodao)
### 2.15.13
*2023-02-12*
#### Bug 修复
- Docs
- 修复 Statistic 文案 (#22383 by @JUST-Limbo)
- 修复 Input 文案 (#22093 by @lm312)
- 修复 en-US 文案 (#22268 #22269 #22270 by @Hazel-Lin)
- 修复 Pagination 文案 (#22288 by @xujintai123)
- 修复 Links 文案 (#22370 by @itmier)
- Statistics
- 修复 slot 显示问题 (#22375 by @webvs2)
- Chore
- 修复 web-type 文件丢失问题 (#22271 by @loosheng)
#### 优化
- InputNumber
- windows触摸屏响应优化 (#22185 by @mrsai)
- Image
- 新增 initialIndex 属性 (#22346 by @inkroom)
- Statistics
- countdown 特性更新 (#22260 by @webvs2)
- 代码优化及doc更新 (#22276 by @webvs2)
- 其他
- web-type代码优化 (#22281 by @whzxc)
### 2.15.12
*2022-11-16*
#### Bug 修复
- Statistics
- 修改 千分位 问题 (#22252 by @webvs2)
- 其他
- 修复 2.15.11版本element-theme-chalk未成功发布 问题
### 2.15.11
*2022-11-15*
#### Bug 修复
- Docs
- 修复 Radio 文案 (#22178 by @bchen1029)
- 修复 Progress 文案
#### 优化
- I18n
- 更新 马来西亚语 翻译 (#22185 by @z4q)
- 更新 挪威语 翻译 (#22145 by @Barsnes)
- Progress
- 新增 defineBackColor 和 textColor 属性 (#22089 by @lm312)
- Statistics
- 新增组件 Statistics (#22159 by @webvs2)
- Other
- 改进WebStorm IDE和其他JetBrains IDE中的代码帮助 (#22135 by @piotrtomiak)
### 2.15.10
*2022-09-13*
#### Bug 修复
- DatePicker
- 修复 props placement 报错信息 问题 (#21908 by @lqzhgood)
- Loading
- 修复 使用 Loading 的DOM元素 sticky失效 问题 (#22087 by @zzjjhh001)
- Docs
- 修复 Popover 文案 (#22083 by @lm312)
- 修复 Skeleton 文案 (#22092 by @lm312)
- 修复 DatePicker 文案 (#21970 by @guojiongwei)
- Tree
- 修复 懒加载默认选中 问题 (#21934 by @kiss-yu)
#### 优化
- I18n
- 新增 僧伽罗语 翻译 (#21936 by @sayuri-gi)
- 更新 西班牙语 翻译 (#21924 by @jcardus)
- 新增 马来西亚语 翻译 (#22028 by @iorange0411)
- 更新 斯瓦希里语 翻译 (#21904 by @Cholowao)
- Utils
- 更新 date-util.js (#22099 by @Due07)
- DatePicker
- 新增 months 和 years 类型 (#21918 by @akiko123456)
### 2.15.9
*2022-06-02*
#### Bug 修复
- Table
- 表头抖动修复 (#21863 by @bofeng)
- 按需引用时 `el-checkbox not imported` 修复 (#21828 by @bobohuochai)
- FormItem
- 修复 rules 切换为 null 时校验未重置 问题 (#21892 by @bofeng)
- Cascader
- 修复 切换 options 时错误报错信息 问题 (#21759 by @louiebb)
- Docs
- 修复 Popover 文案 (#21843 by @lod61)
- 修复 Calendar 文案 (#21814 by @GoJam11)
- 修复 TimePicker 文案 (#21803 by @Alanscut)
- 修复 DatePicker 文案 (#21877 by @Nirvanaiu)
- 其他
- 官网在线演示功能修复 (#21863 by @bofeng)
#### 优化
- I18n
- 新增 斯瓦希里语 翻译 (#21895 by @quilltouch)
- Chore
- 本地开发时可从 devTools 工具跳转源代码 (#21633 by @polemices)
- DatePicker & Cascader
- 弹窗方向优化 (#21806 by @XivLaw)
- Tooltip
- 优化 `getFirstElement` 代码 (#21886 by @zhankang)
- Input
- 优化 scss 代码 (#21558 by @cheese-git)
### 2.15.8
*2022-04-12*
#### Bug 修复
- Drawer
- 修复 appendToBody 失效问题 (#21264 by @cs1707)
- Switch
- 修复 toggling value 问题(#19473 by @EdwinBetanc0urt)
- Docs
- 修复 input 文案 (#21723 by @justforuse)
- 修复 DatePicker 文案 (#21663 by @justforuse)
- 修复 Skeleton 文案 (#21601 by @yanwydxf)
- 其他
- 修复 vue 版本(#21736 by @ckvv)
#### 优化
- I18n
- 新增 阿塞拜疆语 翻译 (#21012 by @ricardotondello)
- 更新 斯洛文尼亚语 翻译 (#21729 by @patik123)
- 更新 斯洛伐克语 翻译 (#21711 by @sjaustirni )
- 新增 冰岛语 的翻译 (#21709 by @aronhr)
- 新增 孟加拉 语的翻译 (#21485 by @llwwtt)
#### 其他
- 因兼容性考虑撤回2.15.7关于node-sass的更新(#21019 by @linxsbox),重新评估后会在后续合适版本上线
### 2.15.7
*2021-11-18*
#### Bug 修复
- Select
- 修复 filter 模式下,点击图标不能触发下拉的 bug (#21314 by @dennyak47)
- 修复 composition 模式下 keydown 事件 (#21336 by @bchen1029)
- Badge
- 修复 is-dot class (#21308 by @adaex)
- Form
- validate 方法返回错误信息 (#21374 by @cs1707)
- Table
- 修复 resizeObserver loop limit exceeded (#21255 by @tomieric)
- 修复 toggleAllSelection (#21456 by @cs1707)
- 优化 table 性能 (#21330 by @cs1707)
- Button
- 修复 disabled 优先级 (#21375 by @cs1707)
- Descriptions
- 修复 label slot bug (#21462 by @cs1707)
- SASS
- node-sass 替换为 dart-sass (#21019 by @linxsbox)
- Docs
- 修复 skeleton 文案 (#21408 by @zhhbstudio)
### 2.15.6
*2021-09-02*

View File

@ -38,14 +38,16 @@
> A Vue.js 2.0 UI Toolkit for Web.
Element will stay with Vue 2.x
Element will stay with Vue 2.x
For Vue 3.0, we recommend using [Element Plus](https://github.com/element-plus/element-plus) from the same team
For Vue 3.0, we recommend using [Element Plus](https://github.com/element-plus/element-plus)(Element Plus is a community develop project)
For MiniProgram development, we recommend using [MorJS](https://github.com/eleme/morjs)
## Links
- Homepage and documentation
- [International users](http://element.eleme.io/#/en-US)
- [Chinese users](http://element-cn.eleme.io/#/zh-CN)
- [Chinese users](http://element.eleme.io/#/zh-CN)
- [Spanish users](http://element.eleme.io/#/es)
- [French users](http://element.eleme.io/#/fr-FR)
- [awesome-element](https://github.com/ElementUI/awesome-element)

View File

@ -46,4 +46,4 @@ exports.vue = {
amd: 'vue'
};
exports.jsexclude = /node_modules|utils\/popper\.js|utils\/date\.js/;
exports.jsexclude = /node_modules|utils\/popper\.js|utils\/date\.js|utils\/lodash\.js/;

View File

@ -7,6 +7,7 @@ const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const launchEditorMiddleware = require('launch-editor-middleware');
const config = require('./config');
@ -33,7 +34,16 @@ const webpackConfig = {
host: '0.0.0.0',
port: 8085,
publicPath: '/',
hot: true
hot: true,
before: (app) => {
/*
* 编辑器类型 :此处的指令表示的时各个各个编辑器在cmd或terminal中的命令
* webstorm
* code // vscode
* idea
*/
app.use('/__open-in-editor', launchEditorMiddleware('code'));
}
},
performance: {
hints: false

View File

@ -80,6 +80,7 @@
"cascader-panel": "./packages/cascader-panel/index.js",
"avatar": "./packages/avatar/index.js",
"drawer": "./packages/drawer/index.js",
"statistic": "./packages/statistic/index.js",
"popconfirm": "./packages/popconfirm/index.js",
"skeleton": "./packages/skeleton/index.js",
"skeleton-item": "./packages/skeleton-item/index.js",

View File

@ -205,7 +205,7 @@
goCodepen() {
// since 2.6.2 use code rather than jsfiddle https://blog.codepen.io/documentation/api/prefill/
const { script, html, style } = this.codepen;
const resourcesTpl = '<scr' + 'ipt src="//unpkg.com/vue/dist/vue.js"></scr' + 'ipt>' +
const resourcesTpl = '<scr' + 'ipt src="//unpkg.com/vue@2/dist/vue.js"></scr' + 'ipt>' +
'\n<scr' + `ipt src="//unpkg.com/element-ui@${ version }/lib/index.js"></scr` + 'ipt>';
let jsTpl = (script || '').replace(/export default/, 'var Main =').trim();
let htmlTpl = `${resourcesTpl}\n<div id="app">\n${html.trim()}\n</div>`;

View File

@ -10,6 +10,7 @@
<a :href="'/#/' + lang + '/component/custom-theme'" class="footer-main-link" target="_blank">{{ langConfig.theme }}</a>
<a href="https://github.com/elemefe/element-react" class="footer-main-link" target="_blank">Element-React</a>
<a href="https://github.com/ElemeFE/element-angular" class="footer-main-link" target="_blank">Element-Angular</a>
<a href="https://github.com/eleme/morjs" class="footer-main-link" target="_blank">MorJS</a>
</div>
<div class="footer-main">
<h4>{{ langConfig.community }}</h4>
@ -27,8 +28,17 @@
width="120"
popper-class="footer-popover"
trigger="hover">
<div class="footer-popover-title">{{ langConfig.eleme }} UED</div>
<img src="../assets/images/qrcode.png" alt="">
<div class="footer-popover-title">{{ langConfig.elemeTech }}</div>
<img src="https://gw.alicdn.com/imgextra/i4/O1CN01dBDgJP1t4R3qikGBP_!!6000000005848-0-tps-344-344.jpg" alt="">
</el-popover>
<el-popover
ref="weixin"
placement="top"
width="120"
popper-class="footer-popover"
trigger="hover">
<div class="footer-popover-title">{{ langConfig.elemeDesign }}</div>
<img src="https://gw.alicdn.com/imgextra/i4/O1CN015ha1O71yg3g1QaKEi_!!6000000006607-0-tps-1280-1280.jpg" alt="">
</el-popover>
<i class="doc-icon-weixin elementdoc" v-popover:weixin></i>
<a href="https://github.com/elemefe" target="_blank">
@ -134,7 +144,7 @@
}
img {
size: 100px;
width: 100px;
margin: 10px;
}
}

View File

@ -112,11 +112,11 @@
list-style: none;
position: relative;
cursor: pointer;
&.nav-algolia-search {
cursor: default;
}
&.lang-item,
&:last-child {
cursor: default;
@ -210,7 +210,7 @@
}
}
}
.nav-dropdown-list {
width: auto;
}
@ -230,7 +230,7 @@
&:last-child {
margin-left: 10px;
}
a {
padding: 0 5px;
}
@ -254,11 +254,11 @@
&.lang-item {
height: 100%;
.nav-lang {
display: flex;
align-items: center;
span {
padding-bottom: 0;
}
@ -284,8 +284,10 @@
<div class="headerWrapper">
<div id="v3-banner" v-if="isHome">
<template v-if="lang === 'zh-CN'">
您正在浏览基于 Vue 2.x Element UI 文档;
<a href="https://element-plus.org/#/zh-CN">点击这里</a> 查看 Vue 3.x 的升级版本
您正在浏览基于 Vue 2.x 的文档;
<a href="https://element-plus.org/#/zh-CN">点击查看 Vue 3.x 版本</a>
饿了么开源了自研多端框架 MorJS
<a href="https://github.com/eleme/morjs">欢迎点击查看或试用 👏🏻</a>
</template>
<template v-else>
Youre browsing the documentation of Element UI for Vue 2.x version.
@ -326,7 +328,7 @@
:to="`/${ lang }/component`">{{ langConfig.components }}
</router-link>
</li>
<li
<li
class="nav-item nav-item-theme"
>
<router-link

View File

@ -57,7 +57,7 @@ Display date.
|-----------------|------------------- |---------- |---------------------- |--------- |
| value / v-model | binding value | Date/string/number | — | — |
| range | time range, including start time and end time. Start time must be start day of week, end time must be end day of week, the time span cannot exceed two months. | Array | — | — |
| first-day-of-week | fisrt day of week| Number | 1 to 7 | 1 |
| first-day-of-week | first day of week| Number | 1 to 7 | 1 |
### dateCell Scoped Slot Parameters
| Attribute | Description | Type | Accepted Values | Default |

View File

@ -112,6 +112,24 @@ You can choose week, month, year or multiple dates by extending the standard dat
</el-date-picker>
</div>
</div>
<div class="container">
<div class="block">
<span class="demonstration">months</span>
<el-date-picker
type="months"
v-model="value5"
placeholder="Pick one or more months">
</el-date-picker>
</div>
<div class="block">
<span class="demonstration">years</span>
<el-date-picker
type="years"
v-model="value6"
placeholder="Pick one or more years">
</el-date-picker>
</div>
</div>
<script>
export default {
@ -120,7 +138,9 @@ You can choose week, month, year or multiple dates by extending the standard dat
value1: '',
value2: '',
value3: '',
value4: ''
value4: '',
value5: '',
value6: ''
};
}
};
@ -442,7 +462,7 @@ When picking a date range, you can assign the time part for start date and end d
| placeholder | placeholder in non-range mode | string | — | — |
| start-placeholder | placeholder for the start date in range mode | string | — | — |
| end-placeholder | placeholder for the end date in range mode | string | — | — |
| type | type of the picker | string | year/month/date/dates/datetime/ week/datetimerange/daterange/ monthrange | date |
| type | type of the picker | string | year/month/date/dates/months/years/datetime/ week/datetimerange/daterange/ monthrange | date |
| format | format of the displayed value in the input box | string | see [date formats](#/en-US/component/date-picker#date-formats) | yyyy-MM-dd |
| align | alignment | left/center/right | left |
| popper-class | custom class name for DatePicker's dropdown | string | — | — |
@ -456,6 +476,7 @@ When picking a date range, you can assign the time part for start date and end d
| prefix-icon | Custom prefix icon class | string | — | el-icon-date |
| clear-icon | Custom clear icon class | string | — | el-icon-circle-close |
| validate-event | whether to trigger form validation | boolean | - | true |
| append-to-body | whether to append DatePicker itself to body | boolean | — | true |
### Picker Options
| Attribute | Description | Type | Accepted Values | Default |

View File

@ -210,7 +210,7 @@ DateTimePicker is derived from DatePicker and TimePicker. For a more detailed ex
| default-time | the default time value after picking a date | non-range: string / range: string[] | non-range: a string like `12:00:00`, range: array of two strings, and the first item is for the start date and second for the end date. `00:00:00` will be used if not specified | — |
| value-format | optional, format of binding value. If not specified, the binding value will be a Date object | string | see [date formats](#/en-US/component/date-picker#date-formats) | — |
| name | same as `name` in native input | string | — | — |
| unlink-panels | unllink two date-panels in range-picker | boolean | — | false |
| unlink-panels | unlink two date-panels in range-picker | boolean | — | false |
| prefix-icon | Custom prefix icon class | string | — | el-icon-date |
| clear-icon | Custom clear icon class | string | — | el-icon-circle-close |

View File

@ -476,7 +476,7 @@ Custom validate callback function must be called. See more advanced usage at [as
{ type: 'number', message: 'age must be a number'}
]"
>
<el-input type="age" v-model.number="numberValidateForm.age" autocomplete="off"></el-input>
<el-input v-model.number="numberValidateForm.age" autocomplete="off"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('numberValidateForm')">Submit</el-button>
@ -520,7 +520,7 @@ When an `el-form-item` is nested in another `el-form-item`, its label width will
All components in a Form inherit their `size` attribute from that Form. Similarly, FormItem also has a `size` attribute.
:::demo Still you can fine tune each component's `size` if you don't want that component to inherit its size from From or FormIten.
:::demo Still you can fine tune each component's `size` if you don't want that component to inherit its size from From or FormItem.
```html
<el-form ref="form" :model="sizeForm" label-width="120px" size="mini">
<el-form-item label="Activity name">

View File

@ -144,7 +144,7 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
## Import via CDN
```html
<script src="//unpkg.com/vue"></script>
<script src="//unpkg.com/vue@2"></script>
<script src="//unpkg.com/element-ui"></script>
<script src="//unpkg.com/element-ui/lib/umd/locale/en.js"></script>
@ -156,7 +156,7 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
Compatible with `vue-i18n`
```html
<script src="//unpkg.com/vue"></script>
<script src="//unpkg.com/vue@2"></script>
<script src="//unpkg.com/vue-i18n/dist/vue-i18n.js"></script>
<script src="//unpkg.com/element-ui"></script>
<script src="//unpkg.com/element-ui/lib/umd/locale/zh-CN.js"></script>

View File

@ -147,6 +147,7 @@ Besides the native features of img, support lazy load, custom placeholder and lo
| scroll-container | The container to add scroll listener when using lazy load | string / HTMLElement | — | The nearest parent container whose overflow property is auto or scroll |
| preview-src-list | allow big image preview | Array | — | - |
| z-index | set image preview z-index | Number | — | 2000 |
| initial-index | set image preview array index | Number | — | - |
### Events
| Event Name | Description | Parameters |

View File

@ -263,7 +263,7 @@ export default {
### Sizes
:::demo Add `size` attribute to change the size of Input. In addition to the default size, there are three other options: `large`, `small` and `mini`.
:::demo Add `size` attribute to change the size of Input. In addition to the default size, there are three other options: `medium`, `small` and `mini`.
```html
<div class="demo-input-size">
<el-input

View File

@ -25,11 +25,11 @@ We recommend our users to lock Element's version when using CDN. Please refer to
### Hello world
If you are using CDN, a hello-world page is easy with Element. [Online Demo](https://codepen.io/ziyoung/pen/rRKYpd)
If you are using CDN, a hello-world page is easy with Element. [Online Demo](https://codepen.io/bofeng/pen/poaEmJY)
<iframe height="265" style="width: 100%;" scrolling="no" title="Element demo" src="//codepen.io/ziyoung/embed/rRKYpd/?height=265&theme-id=light&default-tab=html" frameborder="no" allowtransparency="true" allowfullscreen="true">
See the Pen <a href='https://codepen.io/ziyoung/pen/rRKYpd/'>Element demo</a> by hetech
(<a href='https://codepen.io/ziyoung'>@ziyoung</a>) on <a href='https://codepen.io'>CodePen</a>.
<iframe height="265" style="width: 100%;" scrolling="no" title="Element demo" src="//codepen.io/bofeng/embed/poaEmJY/?height=265&theme-id=light&default-tab=html" frameborder="no" allowtransparency="true" allowfullscreen="true">
See the Pen <a href='https://codepen.io/bofeng/pen/poaEmJY/'>Element demo</a> by hetech
(<a href='https://codepen.io/bofeng'>@bofeng</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe>
If you are using npm and wish to apply webpack, please continue to the next page: [Quick Start](/#/en-US/component/quickstart).

View File

@ -149,7 +149,7 @@ Of course, you can nest other operations. It's more light-weight than using a di
| offset | popover offset | number | — | 0 |
| transition | popover transition animation | string | — | el-fade-in-linear |
| visible-arrow | whether a tooltip arrow is displayed or not. For more info, please refer to [Vue-popper](https://github.com/element-component/vue-popper) | boolean | — | true |
| popper-options | parameters for [popper.js](https://popper.js.org/documentation.html) | object | please refer to [popper.js](https://popper.js.org/documentation.html) | `{ boundariesElement: 'body', gpuAcceleration: false }` |
| popper-options | parameters for [popper.js](https://popper.js.org/docs/v2/) | object | please refer to [popper.js](https://popper.js.org/docs/v2/) | `{ boundariesElement: 'body', gpuAcceleration: false }` |
| popper-class | custom class name for popover | string | — | — |
| open-delay | delay before appearing when `trigger` is hover, in milliseconds | number | — | — |
| close-delay | delay before disappearing when `trigger` is hover, in milliseconds | number | — | 200 |

View File

@ -171,4 +171,6 @@ You also can specify `type` attribute to `dashboard` to use dashboard progress b
| width | the canvas width of circle progress bar | number | — | 126 |
| show-text | whether to show percentage | boolean | — | true |
| stroke-linecap | circle/dashboard type shape at the end path | string | butt/round/square | round |
| format | custom text format | function(percentage) | — | — |
| format | custom text format | function(percentage) | — | — |
| define-back-color | background color of progress bar (hex format) | string | — | — |
| text-color | text color of progress bar (hex format) | string | — | — |

View File

@ -40,7 +40,7 @@ We have provided a switch flag indicating whether showing the loading animation,
:::
### Customized Template
ElementPlus only provides the most common template, sometimes that could be a problem, so you have a slot named `template` to do that work.
Element only provides the most common template, sometimes that could be a problem, so you have a slot named `template` to do that work.
Also we have provided different types skeleton unit that you can choose, for more detailed info, please scroll down to the bottom of this page to see the API description. Also, when building your own customized skeleton structure, you should be structuring them as closer to the real DOM as possible, which avoiding the DOM bouncing caused by the height difference.
@ -304,7 +304,7 @@ Sometimes API responds very quickly, when that happens, the skeleton just gets r
### Skeleton Item Attributes
| Attribute | Description | Type | Acceptable Value | Default |
| ------- | ---------------- | ------- | ------------ | ------ |
| variant | The current rendering skeleton type | Enum(string) | p / text / h1 / h3 / text / caption / button / image / circle / rect | text |
| variant | The current rendering skeleton type | Enum(string) | p / h1 / h3 / text / caption / button / image / circle / rect | text |
### Skeleton Slots

View File

@ -0,0 +1,252 @@
## Statistic
Used to highlight a certain number or group of numbers, such as showing a numerical value, such as a dollar amount, ranking, etc.
Countdown mode
### Basic usage
The component provides a thousandth place display, but you can use rate to set the 10,000th place, and so on
:::demo
```html
<template>
<div>
<el-row :gutter="20">
<el-col :span="6">
<div>
<el-statistic
group-separator=","
:precision="2"
:value="value2"
:title="title"
></el-statistic>
</div>
</el-col>
<el-col :span="6">
<div>
<el-statistic title="Gender Distribution">
<template slot="formatter">
456/2
</template>
</el-statistic>
</div>
</el-col>
<el-col :span="6">
<div>
<el-statistic
group-separator=","
:precision="2"
decimal-separator="."
:value="value1"
:title="title"
>
<template slot="prefix">
<i class="el-icon-s-flag" style="color: red"></i>
</template>
<template slot="suffix">
<i class="el-icon-s-flag" style="color: blue"></i>
</template>
</el-statistic>
</div>
</el-col>
<el-col :span="6">
<div>
<el-statistic :value="like ? 521 : 520" title="Feedback">
<template slot="suffix">
<span @click="like = !like" class="like">
<i
class="el-icon-star-on"
style="color:red"
v-show="!!like"
></i>
<i class="el-icon-star-off" v-show="!like"></i>
</span>
</template>
</el-statistic>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data() {
return {
like: true,
value1: 4154.564,
value2: 2222,
title: "Growth this year",
};
},
};
</script>
<style lang="scss">
.like {
cursor: pointer;
font-size: 25px;
display: inline-block;
}
</style>
```
:::
### Count down
:::warning
Suspend is tentative, it ** just pauses the countdown, not the time, because value points to a future time node **
If you need to add time to the original, please note that the overall time (the amount of time added and the original time) must be a ** future ** time node, otherwise it is still the end of the countdown
:::
:::demo Providing a future time via 'value' will enable the countdown function
```html
<template>
<div>
<el-row :gutter="20">
<el-col :span="14">
<el-card shadow="hover" style="width: 100%; ">
<div style="width: 100%; display: inline-block; ">
<el-statistic
:value="deadline2"
time-indices
title="🎉Price reduction of goods🎉"
>
<template slot="suffix">
panic purchase
</template>
</el-statistic>
</div>
</el-card>
<el-card shadow="hover" style="width: 100%;margin-top: 20px; ">
<div style="width: 100%; display: inline-block;">
<el-statistic
@finish="hilarity"
:value="deadline3"
time-indices
title="The Value of Time"
>
<template slot="suffix">
<el-button type="primary " size="small" @click="add"
>add 10s</el-button
>
</template>
</el-statistic>
</div>
</el-card>
</el-col>
<el-col :span="10">
<el-card shadow="hover" style="width: 100%;">
<div slot="header" class="clearfix">
<span style="font-size: 14px;">Henry·Wadsworth·Longfellow</span>
<el-button
style="float: right; padding: 3px 0"
type="text"
@click="clickFn"
>suspend</el-button
>
</div>
<div style="font-size: 16px;text-align: left;">
Don't sigh in the past, it is no longer back
</div>
<div style="font-size: 16px;text-align: left;margin-top: 15px;">
Be wise to improve the present
</div>
<div style="font-size: 16px;text-align: left;margin-top: 15px;">
To not worry not afraid of the firm will into the complicated future
</div>
<div style="margin-top: 40px;"></div>
<el-statistic
ref="statistic"
@finish="hilarity"
format="HH:mm:ss"
:value="deadline4"
title="Distance to Tomorrow:"
time-indices
>
</el-statistic>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data() {
return {
deadline2: Date.now() + 1000 * 60 * 60 * 8,
deadline3: Date.now() + 1000 * 60 * 30,
deadline4: Date.now() + (new Date().setHours(23, 59, 59) - Date.now()),
stop: true,
};
},
methods: {
hilarity() {
this.$notify({
title: "Prompt",
message:
"Time is up, do you know that an inch of gold can't buy an inch of time?",
duration: 0,
});
},
clickFn() {
this.$refs.statistic.suspend(this.stop);
this.stop = !this.stop;
},
add() {
this.deadline3 = this.deadline3 + 1000 * 10;
},
},
};
</script>
```
:::
### Statistic Attributes
| Attribute | Description | Type | Accepted Values | Default |
| ----------------- | ------------------------------ | --------------------------- | --------------- | ------- |
| value | Numerical content | string \| number | - | - |
| decimal-separator | Setting the decimal point | string | - | . |
| formatter | Custom numerical presentation | v-slot \|({value}) => VNode | - | - |
| group-separator | Sets the thousandth identifier | string | - | , |
| precision | numerical precision | number | - | - |
| prefix | Sets the prefix of a number | string \| v-slot | - | - |
| suffix | Sets the suffix of a number | string \| v-slot | - | - |
| title | Numeric titles | string \| v-slot | - | - |
| value-style | Styles numeric values | style | - | - |
| rate | Set the ratio | number | - | 1000 |
### Statistic Slots
| Name | Description |
| --------- | --------------------------- |
| prefix | Numeric prefix |
| suffix | Suffixes for numeric values |
| formatter | Numerical content |
| title | Numeric titles |
### Statistic.Countdown Attributes
| Attribute | Description | Type | Options | Default |
| ------------ | ---------------------------------------- | ------- | ----------- | ---------- |
| time-indices | Whether to enable the countdown function | boolean | true\|false | false |
| value | Required value, enter the bound value | string | — | — |
| format | Formatting the countdown display | string | — | 'HH:mm:ss' |
### Statistic.Countdown Events
| Method | Description | Parameters |
| ------ | ------------------------------------------ | ---------------- |
| change | Enable in the 'countdown' function | (value: Date) |
| finish | Launched after the 'countdown' is complete | (value: boolean) |
### Statistic Methods
| Method | Description | Parameters | CallBack |
| ------- | ------------------- | --------------- | ------------- |
| suspend | Pause the countdown | (value:boolean) | (value: Date) |

View File

@ -1088,7 +1088,7 @@ Filter the table to find desired data.
### Custom column template
Customize table column so it can be integrated with other components.
:::demo You have access to the following data: row, column, $index and store (state management of Table) by [Scoped slot](https://vuejs.org/v2/guide/components.html#Scoped-Slots).
:::demo You have access to the following data: row, column, $index and store (state management of Table) by [Scoped slot](https://v2.vuejs.org/v2/guide/components-slots#Scoped-Slots).
```html
<template>
<el-table
@ -1169,7 +1169,7 @@ Customize table column so it can be integrated with other components.
### Table with custom header
Customize table header so it can be even more customized.
:::demo You can customize how the header looks by header [scoped slots](https://vuejs.org/v2/guide/components-slots.html#Scoped-Slots).
:::demo You can customize how the header looks by header [scoped slots](https://v2.vuejs.org/v2/guide/components-slots#Scoped-Slots).
```html
<template>
<el-table
@ -1817,6 +1817,7 @@ You can customize row index in `type=index` columns.
| fit | whether width of column automatically fits its container | boolean | — | true |
| show-header | whether Table header is visible | boolean | — | true |
| highlight-current-row | whether current row is highlighted | boolean | — | false |
| highlight-selection-row | whether selection row is highlighted | boolean | — | false |
| current-row-key | key of current row, a set only prop | string,number | — | — |
| row-class-name | function that returns custom class names for a row, or a string assigning class names for every row | Function({row, rowIndex})/String | — | — |
| row-style | function that returns custom style for a row, or an object assigning custom style for every row | Function({row, rowIndex})/Object | — | — |

View File

@ -187,7 +187,7 @@ Disabled form elements are not supported for Tooltip, more information can be fo
| offset | offset of the Tooltip | number | — | 0 |
| transition | animation name | string | — | el-fade-in-linear |
| visible-arrow | whether an arrow is displayed. For more information, check [Vue-popper](https://github.com/element-component/vue-popper) page | boolean | — | true |
| popper-options | [popper.js](https://popper.js.org/documentation.html) parameters | Object | refer to [popper.js](https://popper.js.org/documentation.html) doc | `{ boundariesElement: 'body', gpuAcceleration: false }` |
| popper-options | [popper.js](https://popper.js.org/docs/v2/) parameters | Object | refer to [popper.js](https://popper.js.org/docs/v2/) doc | `{ boundariesElement: 'body', gpuAcceleration: false }` |
| open-delay | delay of appearance, in millisecond | number | — | 0 |
| manual | whether to control Tooltip manually. `mouseenter` and `mouseleave` won't have effects if set to `true` | boolean | — | false |
| popper-class | custom class name for Tooltip's popper | string | — | — |

View File

@ -1,6 +1,6 @@
## Built-in transition
You can use Element's built-in transitions directly. Before that, please read the [transition docs](https://vuejs.org/v2/api/#transition).
You can use Element's built-in transitions directly. Before that, please read the [transition docs](https://v2.vuejs.org/v2/api/#transition).
### fade

View File

@ -114,6 +114,24 @@ Puede elegir la semana, el mes, el año o varias fechas ampliando el componente
</el-date-picker>
</div>
</div>
<div class="container">
<div class="block">
<span class="demonstration">months</span>
<el-date-picker
type="months"
v-model="value5"
placeholder="Pick one or more months">
</el-date-picker>
</div>
<div class="block">
<span class="demonstration">years</span>
<el-date-picker
type="years"
v-model="value6"
placeholder="Pick one or more years">
</el-date-picker>
</div>
</div>
<script>
export default {
@ -122,7 +140,9 @@ Puede elegir la semana, el mes, el año o varias fechas ampliando el componente
value1: '',
value2: '',
value3: '',
value4: ''
value4: '',
value5: '',
value6: ''
};
}
};
@ -443,7 +463,7 @@ Al seleccionar un intervalo de fechas, puede asignar la hora para la fecha de in
| placeholder | placeholder cuando el modo NO es rango | string | — | — |
| start-placeholder | placeholder para la fecha de inicio en modo rango | string | — | — |
| end-placeholder | placeholder para la fecha final en modo rango | string | — | — |
| type | tipo de picker | string | year/month/date/dates/datetime/ week/datetimerange/daterange/ monthrange | date |
| type | tipo de picker | string | year/month/date/dates/months/years/datetime/ week/datetimerange/daterange/ monthrange | date |
| format | formato en que se muestra el valor en el input | string | ver [date formats](#/es/component/date-picker#date-formats) | yyyy-MM-dd |
| align | alineación | left/center/right | left | |
| popper-class | nombre de clase personalizada para el dropdown de DatePicker | string | — | — |
@ -456,6 +476,7 @@ Al seleccionar un intervalo de fechas, puede asignar la hora para la fecha de in
| unlink-panels | desvincular los dos paneles de fecha en el range-picker | boolean | — | false |
| prefix-icon | Clase personalizada para el icono prefijado | string | — | el-icon-date |
| clear-icon | Clase personalizada para el icono `clear` | string | — | el-icon-circle-close |
| append-to-body | Si adjuntar el cuadro de DatePicker al cuerpo | boolean | — | true |
### Opciones del Picker
| Atributo | Descripción | Tipo | Valores aceptados | Por defecto |

View File

@ -485,7 +485,7 @@ Se debe llamar a la función de validación de llamada de retorno personalizada.
{ type: 'number', message: 'age must be a number'}
]"
>
<el-input type="age" v-model.number="numberValidateForm.age" autocomplete="off"></el-input>
<el-input v-model.number="numberValidateForm.age" autocomplete="off"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('numberValidateForm')">Submit</el-button>

View File

@ -144,7 +144,7 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
## Importar via CDN
```html
<script src="//unpkg.com/vue"></script>
<script src="//unpkg.com/vue@2"></script>
<script src="//unpkg.com/element-ui"></script>
<script src="//unpkg.com/element-ui/lib/umd/locale/en.js"></script>
@ -156,7 +156,7 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
Compatible con `vue-i18n`
```html
<script src="//unpkg.com/vue"></script>
<script src="//unpkg.com/vue@2"></script>
<script src="//unpkg.com/vue-i18n/dist/vue-i18n.js"></script>
<script src="//unpkg.com/element-ui"></script>
<script src="//unpkg.com/element-ui/lib/umd/locale/zh-CN.js"></script>

View File

@ -149,6 +149,7 @@ Además de las características nativas de img, soporte de carga perezosa, marca
| scroll-container | El contenedor para añadir el scroll listener cuando se utiliza lazy load | string / HTMLElement | — | El contenedor padre más cercano cuya propiedad de desbordamiento es auto o scroll |
| preview-src-list | permitir una vista previa grande de la imagen | Array | — | - |
| z-index | establecer el z-index de la vista previa de la imagen | Number | — | 2000 |
| initial-index | set image preview array index | Number | — | - |
### Eventos
| Nombre del evento | Descripción | Parámetros |

View File

@ -269,7 +269,7 @@ export default {
### Tamaño
:::demo Añada el atributo `size` para cambiar el tamaño del Input. Además del tamaño predeterminado, hay otras tres opciones: `large`, `small` y `mini`.
:::demo Añada el atributo `size` para cambiar el tamaño del Input. Además del tamaño predeterminado, hay otras tres opciones: `medium`, `small` y `mini`.
```html
<div class="demo-input-size">
@ -617,7 +617,6 @@ export default {
| ------ | ------------------------------------------------------------ | ------------------------- |
| blur | Se dispara cuando se pierde el foco | (event: Event) |
| focus | Se dispara cuando se obtiene el foco | (event: Event) |
| change | se activa cuando cambia el valor de entrada | (value: string \| number) |
| change | se activa solo cuando el cuadro de entrada pierde el foco o el usuario presiona Enter | (value: string \| number) |
| input | se activa cuando cambia el valor de entrada | (value: string \| number) |
| clear | se dispara cuando la entrada es borrada por el botón generado por el atributo `clearable`. | — |

View File

@ -24,11 +24,11 @@ Recomendamos a nuestros usuarios congelar la versión de Element cuando usas un
### Hello world
Si esta usando un CDN, una página con Hello-World es fácil con Element. [Online Demo](https://codepen.io/ziyoung/pen/rRKYpd)
Si esta usando un CDN, una página con Hello-World es fácil con Element. [Online Demo](https://codepen.io/bofeng/pen/poaEmJY)
<iframe height="265" style="width: 100%;" scrolling="no" title="Element demo" src="//codepen.io/ziyoung/embed/rRKYpd/?height=265&theme-id=light&default-tab=html,result" frameborder="no" allowtransparency="true" allowfullscreen="true">
See the Pen <a href='https://codepen.io/ziyoung/pen/rRKYpd/'>Element demo</a> by hetech
(<a href='https://codepen.io/ziyoung'>@ziyoung</a>) on <a href='https://codepen.io'>CodePen</a>.
<iframe height="265" style="width: 100%;" scrolling="no" title="Element demo" src="//codepen.io/bofeng/embed/poaEmJY/?height=265&theme-id=light&default-tab=html,result" frameborder="no" allowtransparency="true" allowfullscreen="true">
See the Pen <a href='https://codepen.io/bofeng/pen/poaEmJY/'>Element demo</a> by hetech
(<a href='https://codepen.io/bofeng'>@bofeng</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe>
Si esta usando npm y desea combinarlo con webpack, por favor continué a la siguiente página: [Quick Start](/#/es/component/quickstart)

View File

@ -4,7 +4,7 @@
Similar a un Tooltip, Popover está construido con `Vue-popper`. Así que para atributos duplicados, por favor refiérase a la documentación de Tooltip.
:::demo El atributo `trigger` es usado para definir como el popover se dispara: `hover`, `click`, `focus` o `manual`. En cuanto al elemento desencadenante, puedes escribirlo de dos maneras diferentes: usando el `slot="reference"`[named slot](https://vuejs.org/v2/guide/components.html#Named-Slots), o usando la directiva `v-popover` y poniendo el `ref` de Popover.
:::demo El atributo `trigger` es usado para definir como el popover se dispara: `hover`, `click`, `focus` o `manual`. En cuanto al elemento desencadenante, puedes escribirlo de dos maneras diferentes: usando el `slot="reference"`[named slot](https://v2.vuejs.org/v2/guide/components-slots#Named-Slots), o usando la directiva `v-popover` y poniendo el `ref` de Popover.
```html
<template>
@ -148,7 +148,7 @@ Por supuesto, puedes anidar otras operaciones. Es más ligero que utilizar un `d
| offset | popover offset | number | — | 0 |
| transition | animación de transición del popover | string | — | el-fade-in-linear |
| visible-arrow | si una flecha del tooltip es mostrada o no. Para más información, por favor refiérase a [Vue-popper](https://github.com/element-component/vue-popper) | boolean | — | true |
| popper-options | parámetros para [popper.js](https://popper.js.org/documentation.html) | object | por favor, refiérase a [popper.js](https://popper.js.org/documentation.html) | `{ boundariesElement: 'body', gpuAcceleration: false }` |
| popper-options | parámetros para [popper.js](https://popper.js.org/docs/v2/) | object | por favor, refiérase a [popper.js](https://popper.js.org/docs/v2/) | `{ boundariesElement: 'body', gpuAcceleration: false }` |
| popper-class | clase propia para popover | string | — | — |
| open-delay | retraso de la aparición cuando `trigger` es hover, en mili segundos | number | — | — |
| close-delay | Retraso antes de desaparecer cuando el `trigger` es hover, en mili segundos. | number | — | 200 |

View File

@ -169,4 +169,6 @@ Puede utilizar el atributo `color` para establecer el color de la barra de progr
| width | ancho del canvas que contiene la barra de progreso circula | number | — | 126 |
| show-text | mostrar porcentaje | boolean | — | true |
| stroke-linecap | circle/dashboard tipo de diseño al final del camino | string | butt/round/square | round |
| format | personalizar el formato de texto estableciendo format | function(percentage) | — | — |
| format | personalizar el formato de texto estableciendo format | function(percentage) | — | — |
| define-back-color | background color of progress bar (hex format) | string | — | — |
| text-color | text color of progress bar (hex format) | string | — | — |

View File

@ -40,7 +40,7 @@ We have provided a switch flag indicating whether showing the loading animation,
:::
### Customized Template
ElementPlus only provides the most common template, sometimes that could be a problem, so you have a slot named `template` to do that work.
Element only provides the most common template, sometimes that could be a problem, so you have a slot named `template` to do that work.
Also we have provided different types skeleton unit that you can choose, for more detailed info, please scroll down to the bottom of this page to see the API description. Also, when building your own customized skeleton structure, you should be structuring them as closer to the real DOM as possible, which avoiding the DOM bouncing caused by the height difference.
@ -304,7 +304,7 @@ Sometimes API responds very quickly, when that happens, the skeleton just gets r
### Skeleton Item Attributes
| Attribute | Description | Type | Acceptable Value | Default |
| ------- | ---------------- | ------- | ------------ | ------ |
| variant | The current rendering skeleton type | Enum(string) | p / text / h1 / h3 / text / caption / button / image / circle / rect | text |
| variant | The current rendering skeleton type | Enum(string) | p / h1 / h3 / text / caption / button / image / circle / rect | text |
### Skeleton Slots

View File

@ -0,0 +1,252 @@
## Statistic
Used to highlight a certain number or group of numbers, such as showing a numerical value, such as a dollar amount, ranking, etc.
Countdown mode
### Basic usage
The component provides a thousandth place display, but you can use rate to set the 10,000th place, and so on
:::demo
```html
<template>
<div>
<el-row :gutter="20">
<el-col :span="6">
<div>
<el-statistic
group-separator=","
:precision="2"
:value="value2"
:title="title"
></el-statistic>
</div>
</el-col>
<el-col :span="6">
<div>
<el-statistic title="Gender Distribution">
<template slot="formatter">
456/2
</template>
</el-statistic>
</div>
</el-col>
<el-col :span="6">
<div>
<el-statistic
group-separator=","
:precision="2"
decimal-separator="."
:value="value1"
:title="title"
>
<template slot="prefix">
<i class="el-icon-s-flag" style="color: red"></i>
</template>
<template slot="suffix">
<i class="el-icon-s-flag" style="color: blue"></i>
</template>
</el-statistic>
</div>
</el-col>
<el-col :span="6">
<div>
<el-statistic :value="like ? 521 : 520" title="Feedback">
<template slot="suffix">
<span @click="like = !like" class="like">
<i
class="el-icon-star-on"
style="color:red"
v-show="!!like"
></i>
<i class="el-icon-star-off" v-show="!like"></i>
</span>
</template>
</el-statistic>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data() {
return {
like: true,
value1: 4154.564,
value2: 2222,
title: "Growth this year",
};
},
};
</script>
<style lang="scss">
.like {
cursor: pointer;
font-size: 25px;
display: inline-block;
}
</style>
```
:::
### Count down
:::warning
Suspend is tentative, it ** just pauses the countdown, not the time, because value points to a future time node **
If you need to add time to the original, please note that the overall time (the amount of time added and the original time) must be a **future** time node, otherwise it is still the end of the countdown
:::
:::demo Providing a future time via 'value' will enable the countdown function
```html
<template>
<div>
<el-row :gutter="20">
<el-col :span="14">
<el-card shadow="hover" style="width: 100%; ">
<div style="width: 100%; display: inline-block; ">
<el-statistic
:value="deadline2"
time-indices
title="🎉Price reduction of goods🎉"
>
<template slot="suffix">
panic purchase
</template>
</el-statistic>
</div>
</el-card>
<el-card shadow="hover" style="width: 100%;margin-top: 20px; ">
<div style="width: 100%; display: inline-block;">
<el-statistic
@finish="hilarity"
:value="deadline3"
time-indices
title="The Value of Time"
>
<template slot="suffix">
<el-button type="primary " size="small" @click="add"
>add 10s</el-button
>
</template>
</el-statistic>
</div>
</el-card>
</el-col>
<el-col :span="10">
<el-card shadow="hover" style="width: 100%;">
<div slot="header" class="clearfix">
<span style="font-size: 14px;">Henry·Wadsworth·Longfellow</span>
<el-button
style="float: right; padding: 3px 0"
type="text"
@click="clickFn"
>suspend</el-button
>
</div>
<div style="font-size: 16px;text-align: left;">
Don't sigh in the past, it is no longer back
</div>
<div style="font-size: 16px;text-align: left;margin-top: 15px;">
Be wise to improve the present
</div>
<div style="font-size: 16px;text-align: left;margin-top: 15px;">
To not worry not afraid of the firm will into the complicated future
</div>
<div style="margin-top: 40px;"></div>
<el-statistic
ref="statistic"
@finish="hilarity"
format="HH:mm:ss"
:value="deadline4"
title="Distance to Tomorrow:"
time-indices
>
</el-statistic>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data() {
return {
deadline2: Date.now() + 1000 * 60 * 60 * 8,
deadline3: Date.now() + 1000 * 60 * 30,
deadline4: Date.now() + (new Date().setHours(23, 59, 59) - Date.now()),
stop: true,
};
},
methods: {
hilarity() {
this.$notify({
title: "Prompt",
message:
"Time is up, do you know that an inch of gold can't buy an inch of time?",
duration: 0,
});
},
clickFn() {
this.$refs.statistic.suspend(this.stop);
this.stop = !this.stop;
},
add() {
this.deadline3 = this.deadline3 + 1000 * 10;
},
},
};
</script>
```
:::
### Statistic Attributes
| Attribute | Description | Type | Accepted Values | Default |
| ----------------- | ------------------------------ | --------------------------- | --------------- | ------- |
| value | Numerical content | string \| number | - | - |
| decimal-separator | Setting the decimal point | string | - | . |
| formatter | Custom numerical presentation | v-slot \|({value}) => VNode | - | - |
| group-separator | Sets the thousandth identifier | string | - | , |
| precision | numerical precision | number | - | - |
| prefix | Sets the prefix of a number | string \| v-slot | - | - |
| suffix | Sets the suffix of a number | string \| v-slot | - | - |
| title | Numeric titles | string \| v-slot | - | - |
| value-style | Styles numeric values | style | - | - |
| rate | Set the ratio | number | - | 1000 |
### Statistic Slots
| Name | Description |
| --------- | --------------------------- |
| prefix | Numeric prefix |
| suffix | Suffixes for numeric values |
| formatter | Numerical content |
| title | Numeric titles |
### Statistic.Countdown Attributes
| Attribute | Description | Type | Options | Default |
| ------------ | ---------------------------------------- | ------- | ----------- | ---------- |
| time-indices | Whether to enable the countdown function | boolean | true\|false | false |
| value | Required value, enter the bound value | string | — | — |
| format | Formatting the countdown display | string | — | 'HH:mm:ss' |
### Statistic.Countdown Events
| Method | Description | Parameters |
| ------ | ------------------------------------------ | ---------------- |
| change | Enable in the 'countdown' function | (value: Date) |
| finish | Launched after the 'countdown' is complete | (value: boolean) |
### Statistic Methods
| Method | Description | Parameters | CallBack |
| ------- | ------------------- | --------------- | ------------- |
| suspend | Pause the countdown | (value:boolean) | (value: Date) |

View File

@ -1089,7 +1089,7 @@ Filtra la tabla para encontrar la información que necesita.
Personalice la columna de la tabla para que pueda integrarse con otros componentes.
:::demo Tiene acceso a la siguiente información: row, column, $index, store (gestor de estados de la tabla) por [Scoped slots](https://vuejs.org/v2/guide/components.html#Scoped-Slots).
:::demo Tiene acceso a la siguiente información: row, column, $index, store (gestor de estados de la tabla) por [Scoped slots](https://v2.vuejs.org/v2/guide/components-slots#Scoped-Slots).
```html
<template>
<el-table
@ -1170,7 +1170,7 @@ Personalice la columna de la tabla para que pueda integrarse con otros component
### Table con cabecera personalizada
Se puede personalizar el encabezado de la tabla para que se pueda adaptar aún más.
:::demo Puede personalizar el aspecto del encabezado con header [scoped slots](https://vuejs.org/v2/guide/components-slots.html#Scoped-Slots).
:::demo Puede personalizar el aspecto del encabezado con header [scoped slots](https://v2.vuejs.org/v2/guide/components-slots#Scoped-Slots).
```html
<template>
<el-table
@ -1822,6 +1822,7 @@ Puede personalizar el índice de la fila con la propiedad `type=index` de las co
| fit | especifica si el ancho de la columna se adapta automáticamente a su contenedor | boolean | — | true |
| show-header | especifica si la cabecera de la tabla es visible | boolean | — | true |
| highlight-current-row | especifica si la fila actual es resaltado | boolean | — | false |
| highlight-selection-row | resaltar la selección de líneas de verificación | boolean | — | false |
| current-row-key | clave de la fila actual, un ajuste de propiedad única | string,number | — | — |
| row-class-name | función que devuelve nombres de clases personalizadas para una fila, o una cadena asignando nombres de clases para cada fila | Function({row, rowIndex})/String | — | — |
| row-style | función que devuelve el estilo personalizado para una fila, o un objeto asignando estilos personalizado para cada fila | Function({row, rowIndex})/Object | — | — |
@ -1921,4 +1922,4 @@ Puede personalizar el índice de la fila con la propiedad `type=index` de las co
| Name | Description |
|------|--------|
| — | Contenido personalizado para las columnas de la tabla. El parámetro del scope es { row, column, $index } |
| header | Contenido personalizado para el encabezado de la tabla. El parámetro del scope es { column, $index } |
| header | Contenido personalizado para el encabezado de la tabla. El parámetro del scope es { column, $index } |

View File

@ -187,7 +187,7 @@ Es necesario envolver los elementos de forma deshabilitados en un elemento conte
| offset | offset del Tooltip | number | — | 0 |
| transition | nombre de animación | string | — | el-fade-in-linear |
| visible-arrow | si una flecha es mostrada. Para mayor información, revisar la página de [Vue-popper](https://github.com/element-component/vue-popper) | boolean | — | true |
| popper-options | parámetros de [popper.js](https://popper.js.org/documentation.html) | Object | referirse a la documentación de [popper.js](https://popper.js.org/documentation.html) | `{ boundariesElement: 'body', gpuAcceleration: false }` |
| popper-options | parámetros de [popper.js](https://popper.js.org/docs/v2/) | Object | referirse a la documentación de [popper.js](https://popper.js.org/docs/v2/) | `{ boundariesElement: 'body', gpuAcceleration: false }` |
| open-delay | retraso de la apariencia, en mili segundos | number | — | 0 |
| manual | si el Tooltipo será controlado de forma manual. `mouseenter` y `mouseleave` no tendrán efecto si fue establecido como `true` | boolean | — | false |
| popper-class | nombre de clase personalizada para el popper del Tooltip | string | — | — |

View File

@ -1,6 +1,6 @@
## Transiciones incorporadas
Puede usar directamente las transiciones incorporadas en Element. Antes de hacerlo, por favor lea la [documentación](https://vuejs.org/v2/api/#transition).
Puede usar directamente las transiciones incorporadas en Element. Antes de hacerlo, por favor lea la [documentación](https://v2.vuejs.org/v2/api/#transition).
### Fade

View File

@ -456,6 +456,7 @@ Lorsque vous choisissez une plage de dates, vous pouvez assigner l'horaire de d
| prefix-icon | Icône de préfixe. | string | — | el-icon-date |
| clear-icon | Icône de reset. | string | — | el-icon-circle-close |
| validate-event | Si la validation doit être déclenchée. | boolean | - | true |
| append-to-body | S'il faut ajouter le DatePicker au body | boolean | — | true |
### Options du Picker
| Attribut | Description | Type | Valeurs acceptées | Défaut |

View File

@ -475,7 +475,7 @@ Les callback de validations personnalisées doivent être appelées. Un usage pl
{ type: 'number', message: 'l\'âge doit être un nombre'}
]"
>
<el-input type="age" v-model.number="numberValidateForm.age" autocomplete="off"></el-input>
<el-input v-model.number="numberValidateForm.age" autocomplete="off"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('numberValidateForm')">Soumettre</el-button>

View File

@ -147,7 +147,7 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
## Import via un CDN
```html
<script src="//unpkg.com/vue"></script>
<script src="//unpkg.com/vue@2"></script>
<script src="//unpkg.com/element-ui"></script>
<script src="//unpkg.com/element-ui/lib/umd/locale/en.js"></script>
@ -159,7 +159,7 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
Compatible avec `vue-i18n`
```html
<script src="//unpkg.com/vue"></script>
<script src="//unpkg.com/vue@2"></script>
<script src="//unpkg.com/vue-i18n/dist/vue-i18n.js"></script>
<script src="//unpkg.com/element-ui"></script>
<script src="//unpkg.com/element-ui/lib/umd/locale/zh-CN.js"></script>

View File

@ -148,6 +148,7 @@ En plus des propriétés natives de img, ce composant supporte le lazy loading,
| scroll-container | Le conteneur auquel ajouter le listener du scroll en mode lazy loading. | string / HTMLElement | — | Le conteneur parent le plus proche avec la propriété overflow à auto ou scroll. |
| preview-src-list | allow big image preview | Array | — | - |
| z-index | set image preview z-index | Number | — | 2000 |
| initial-index | set image preview array index | Number | — | - |
### Évènements
| Nom | Description | Paramètres |

View File

@ -262,7 +262,7 @@ export default {
### Tailles
:::demo Ajoutez l'attribut `size` pour changer la taille de l'input. En plus de la taille par défaut, il y a trois autres options: `large`, `small` et `mini`.
:::demo Ajoutez l'attribut `size` pour changer la taille de l'input. En plus de la taille par défaut, il y a trois autres options: `medium`, `small` et `mini`.
```html
<div class="demo-input-size">
<el-input
@ -603,7 +603,6 @@ export default {
|----| ----| ----|
| blur | Se déclenche quand Input perds le focus. | (event: Event) |
| focus | Se déclenche quand Input a le focus. | (event: Event) |
| change | Se déclenche quand la valeur change. | (value: string \ number) |
| change | Déclenché uniquement lorsque la zone de saisie perd le focus ou que l'utilisateur appuie sur Entrée. | (value: string \| number) |
| input | Déclenché lorsque la valeur d'entrée change. | (value: string \| number) |
| clear | Se déclenche quand le champ est effacé par le bouton de reset. | — |

View File

@ -25,11 +25,11 @@ Il est recommandé de fixer la version d'Element lors de l'utilisation du CDN. R
### Hello world
Si vous utilisez un CDN, une page hello-world peut être obtenue facilement avec Element ([démo en ligne](https://codepen.io/ziyoung/pen/rRKYpd)).
Si vous utilisez un CDN, une page hello-world peut être obtenue facilement avec Element ([démo en ligne](https://codepen.io/bofeng/pen/poaEmJY)).
<iframe height="265" style="width: 100%;" scrolling="no" title="Element demo" src="//codepen.io/ziyoung/embed/rRKYpd/?height=265&theme-id=light&default-tab=html" frameborder="no" allowtransparency="true" allowfullscreen="true">
See the Pen <a href='https://codepen.io/ziyoung/pen/rRKYpd/'>Element demo</a> by hetech
(<a href='https://codepen.io/ziyoung'>@ziyoung</a>) on <a href='https://codepen.io'>CodePen</a>.
<iframe height="265" style="width: 100%;" scrolling="no" title="Element demo" src="//codepen.io/bofeng/embed/poaEmJY/?height=265&theme-id=light&default-tab=html" frameborder="no" allowtransparency="true" allowfullscreen="true">
See the Pen <a href='https://codepen.io/bofeng/pen/poaEmJY/'>Element demo</a> by hetech
(<a href='https://codepen.io/bofeng'>@bofeng</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe>
Si vous utilisez npm et souhaitez ajouter webpack, continuez sur la page suivante: [Démarrer](/#/fr-FR/component/quickstart).

View File

@ -150,7 +150,7 @@ Vous pouvez aussi imbriquer des opérations. Procéder ainsi est plus léger que
| offset | Décalage du popover. | number | — | 0 |
| transition | Animation de transition du popover. | string | — | el-fade-in-linear |
| visible-arrow | Si une flèche doit être affichée ou non. Pour plus d'informations, référez-vous à [Vue-popper](https://github.com/element-component/vue-popper). | boolean | — | true |
| popper-options | Paramètres pour [popper.js](https://popper.js.org/documentation.html). | object | Référez-vous à [popper.js](https://popper.js.org/documentation.html). | `{ boundariesElement: 'body', gpuAcceleration: false }` |
| popper-options | Paramètres pour [popper.js](https://popper.js.org/docs/v2/). | object | Référez-vous à [popper.js](https://popper.js.org/docs/v2/). | `{ boundariesElement: 'body', gpuAcceleration: false }` |
| popper-class | Classe du popover. | string | — | — |
| open-delay | Délai d'affichage, lorsque `trigger` est 'hover', en millisecondes. | number | — | — |
| close-delay | delay before disappearing when `trigger` is hover, in milliseconds | number | — | 200 |

View File

@ -172,4 +172,6 @@ Vous pouvez également spécifier l'attribut `type` de `dashboard` pour utiliser
| width | La largeur du canvas dans le cas d'une barre circulaire. | number | — | 126 |
| show-text | Si le pourcentage doit être affiché. | boolean | — | true |
| stroke-linecap | circle/dashboard type shape at the end path | string | butt/round/square | round |
| format | Vous pouvez personnaliser le format du texte en définissant le format | function(percentage) | — | — |
| format | Vous pouvez personnaliser le format du texte en définissant le format | function(percentage) | — | — |
| define-back-color | background color of progress bar (hex format) | string | — | — |
| text-color | text color of progress bar (hex format) | string | — | — |

View File

@ -40,7 +40,7 @@ We have provided a switch flag indicating whether showing the loading animation,
:::
### Customized Template
ElementPlus only provides the most common template, sometimes that could be a problem, so you have a slot named `template` to do that work.
Element only provides the most common template, sometimes that could be a problem, so you have a slot named `template` to do that work.
Also we have provided different types skeleton unit that you can choose, for more detailed info, please scroll down to the bottom of this page to see the API description. Also, when building your own customized skeleton structure, you should be structuring them as closer to the real DOM as possible, which avoiding the DOM bouncing caused by the height difference.
@ -304,7 +304,7 @@ Sometimes API responds very quickly, when that happens, the skeleton just gets r
### Skeleton Item Attributes
| Attribute | Description | Type | Acceptable Value | Default |
| ------- | ---------------- | ------- | ------------ | ------ |
| variant | The current rendering skeleton type | Enum(string) | p / text / h1 / h3 / text / caption / button / image / circle / rect | text |
| variant | The current rendering skeleton type | Enum(string) | p / h1 / h3 / text / caption / button / image / circle / rect | text |
### Skeleton Slots

View File

@ -0,0 +1,252 @@
## Statistic
Used to highlight a certain number or group of numbers, such as showing a numerical value, such as a dollar amount, ranking, etc.
Countdown mode
### Basic usage
The component provides a thousandth place display, but you can use rate to set the 10,000th place, and so on
:::demo
```html
<template>
<div>
<el-row :gutter="20">
<el-col :span="6">
<div>
<el-statistic
group-separator=","
:precision="2"
:value="value2"
:title="title"
></el-statistic>
</div>
</el-col>
<el-col :span="6">
<div>
<el-statistic title="Gender Distribution">
<template slot="formatter">
456/2
</template>
</el-statistic>
</div>
</el-col>
<el-col :span="6">
<div>
<el-statistic
group-separator=","
:precision="2"
decimal-separator="."
:value="value1"
:title="title"
>
<template slot="prefix">
<i class="el-icon-s-flag" style="color: red"></i>
</template>
<template slot="suffix">
<i class="el-icon-s-flag" style="color: blue"></i>
</template>
</el-statistic>
</div>
</el-col>
<el-col :span="6">
<div>
<el-statistic :value="like ? 521 : 520" title="Feedback">
<template slot="suffix">
<span @click="like = !like" class="like">
<i
class="el-icon-star-on"
style="color:red"
v-show="!!like"
></i>
<i class="el-icon-star-off" v-show="!like"></i>
</span>
</template>
</el-statistic>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data() {
return {
like: true,
value1: 4154.564,
value2: 2222,
title: "Growth this year",
};
},
};
</script>
<style lang="scss">
.like {
cursor: pointer;
font-size: 25px;
display: inline-block;
}
</style>
```
:::
### Count down
:::warning
Suspend is tentative, it ** just pauses the countdown, not the time, because value points to a future time node **
If you need to add time to the original, please note that the overall time (the amount of time added and the original time) must be a ** future ** time node, otherwise it is still the end of the countdown
:::
:::demo Providing a future time via 'value' will enable the countdown function
```html
<template>
<div>
<el-row :gutter="20">
<el-col :span="14">
<el-card shadow="hover" style="width: 100%; ">
<div style="width: 100%; display: inline-block; ">
<el-statistic
:value="deadline2"
time-indices
title="🎉Price reduction of goods🎉"
>
<template slot="suffix">
panic purchase
</template>
</el-statistic>
</div>
</el-card>
<el-card shadow="hover" style="width: 100%;margin-top: 20px; ">
<div style="width: 100%; display: inline-block;">
<el-statistic
@finish="hilarity"
:value="deadline3"
time-indices
title="The Value of Time"
>
<template slot="suffix">
<el-button type="primary " size="small" @click="add"
>add 10s</el-button
>
</template>
</el-statistic>
</div>
</el-card>
</el-col>
<el-col :span="10">
<el-card shadow="hover" style="width: 100%;">
<div slot="header" class="clearfix">
<span style="font-size: 14px;">Henry·Wadsworth·Longfellow</span>
<el-button
style="float: right; padding: 3px 0"
type="text"
@click="clickFn"
>suspend</el-button
>
</div>
<div style="font-size: 16px;text-align: left;">
Don't sigh in the past, it is no longer back
</div>
<div style="font-size: 16px;text-align: left;margin-top: 15px;">
Be wise to improve the present
</div>
<div style="font-size: 16px;text-align: left;margin-top: 15px;">
To not worry not afraid of the firm will into the complicated future
</div>
<div style="margin-top: 40px;"></div>
<el-statistic
ref="statistic"
@finish="hilarity"
format="HH:mm:ss"
:value="deadline4"
title="Distance to Tomorrow:"
time-indices
>
</el-statistic>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data() {
return {
deadline2: Date.now() + 1000 * 60 * 60 * 8,
deadline3: Date.now() + 1000 * 60 * 30,
deadline4: Date.now() + (new Date().setHours(23, 59, 59) - Date.now()),
stop: true,
};
},
methods: {
hilarity() {
this.$notify({
title: "Prompt",
message:
"Time is up, do you know that an inch of gold can't buy an inch of time?",
duration: 0,
});
},
clickFn() {
this.$refs.statistic.suspend(this.stop);
this.stop = !this.stop;
},
add() {
this.deadline3 = this.deadline3 + 1000 * 10;
},
},
};
</script>
```
:::
### Statistic Attributes
| Attribute | Description | Type | Accepted Values | Default |
| ----------------- | ------------------------------ | --------------------------- | --------------- | ------- |
| value | Numerical content | string \| number | - | - |
| decimal-separator | Setting the decimal point | string | - | . |
| formatter | Custom numerical presentation | v-slot \|({value}) => VNode | - | - |
| group-separator | Sets the thousandth identifier | string | - | , |
| precision | numerical precision | number | - | - |
| prefix | Sets the prefix of a number | string \| v-slot | - | - |
| suffix | Sets the suffix of a number | string \| v-slot | - | - |
| title | Numeric titles | string \| v-slot | - | - |
| value-style | Styles numeric values | style | - | - |
| rate | Set the ratio | number | - | 1000 |
### Statistic Slots
| Name | Description |
| --------- | --------------------------- |
| prefix | Numeric prefix |
| suffix | Suffixes for numeric values |
| formatter | Numerical content |
| title | Numeric titles |
### Statistic.Countdown Attributes
| Attribute | Description | Type | Options | Default |
| ------------ | ---------------------------------------- | ------- | ----------- | ---------- |
| time-indices | Whether to enable the countdown function | boolean | true\|false | false |
| value | Required value, enter the bound value | string | — | — |
| format | Formatting the countdown display | string | — | 'HH:mm:ss' |
### Statistic.Countdown Events
| Method | Description | Parameters |
| ------ | ------------------------------------------ | ---------------- |
| change | Enable in the 'countdown' function | (value: Date) |
| finish | Launched after the 'countdown' is complete | (value: boolean) |
### Statistic Methods
| Method | Description | Parameters | CallBack |
| ------- | ------------------- | --------------- | ------------- |
| suspend | Pause the countdown | (value:boolean) | (value: Date) |

View File

@ -1089,7 +1089,7 @@ Vous pouvez filtrer la table pour obtenir rapidement les lignes désirées.
Vous pouvez customiser le contenu des colonnes afin de pouvoir utiliser d'autres composants.
:::demo Vous avez acccès aux données suivantes: `row`, `column`, `$index` et `store` (gestionnaire d'état de Table) grâce aux [Scoped slot](https://vuejs.org/v2/guide/components.html#Scoped-Slots).
:::demo Vous avez acccès aux données suivantes: `row`, `column`, `$index` et `store` (gestionnaire d'état de Table) grâce aux [Scoped slot](https://v2.vuejs.org/v2/guide/components-slots#Scoped-Slots).
```html
<template>
<el-table
@ -1171,7 +1171,7 @@ Vous pouvez customiser le contenu des colonnes afin de pouvoir utiliser d'autres
Vous pouvez également personnaliser le header de la table.
:::demo Vous pouvez personnaliser le header grâce aux [slots avec portée](https://vuejs.org/v2/guide/components-slots.html#Scoped-Slots).
:::demo Vous pouvez personnaliser le header grâce aux [slots avec portée](https://v2.vuejs.org/v2/guide/components-slots#Scoped-Slots).
```html
<template>
<el-table
@ -1824,6 +1824,7 @@ Vous pouvez personnaliser les indices des colonnes de type `index`.
| fit | Si la largeur des colonnes s'adapte au conteneur. | boolean | — | true |
| show-header | Si le header de la table est visible. | boolean | — | true |
| highlight-current-row | Si la ligne courante est mise en valeur. | boolean | — | false |
| highlight-selection-row | Sélectionner la ligne à cocher en surbrillance | boolean | — | false |
| current-row-key | Clé de la ligne actuelle. Propriété set-only. | string,number | — | — |
| row-class-name | Fonction qui retourne un nom de classe pour chaque ligne. Peut aussi être une simple chaîne de caractères assignant une classe à chaque ligne. | Function({row, rowIndex})/String | — | — |
| row-style | Fonction qui retourne un style pour chaque ligne. Peut aussi être un objet assignant un style à chaque ligne. | Function({row, rowIndex})/Object | — | — |

View File

@ -188,7 +188,7 @@ Les éléments de formulaire désactivés ne sont pas supportés par Tooltip, pl
| offset | Décalage du Tooltip. | number | — | 0 |
| transition | Animation de transition. | string | — | el-fade-in-linear |
| visible-arrow | Si une flèche doit être affichée. Pour plus d'information, voir [Vue-popper](https://github.com/element-component/vue-popper). | boolean | — | true |
| popper-options | Paramètres [popper.js](https://popper.js.org/documentation.html). | Object | Se référer à [popper.js](https://popper.js.org/documentation.html). | `{ boundariesElement: 'body', gpuAcceleration: false }` |
| popper-options | Paramètres [popper.js](https://popper.js.org/docs/v2/). | Object | Se référer à [popper.js](https://popper.js.org/docs/v2/). | `{ boundariesElement: 'body', gpuAcceleration: false }` |
| open-delay | Délai avant l'apparition en millisecondes. | number | — | 0 |
| manual | Si le contrôle du Tooltip doit être manuel. `mouseenter` et `mouseleave` n'auront pas d'effet si `true`. | boolean | — | false |
| popper-class | Classe du popper de Tooltip. | string | — | — |

View File

@ -1,6 +1,6 @@
## Transitions
Vous pouvez utiliser les transitions d'Element directement. Mais avant ça, merci de lire la [documentation](https://vuejs.org/v2/api/#transition).
Vous pouvez utiliser les transitions d'Element directement. Mais avant ça, merci de lire la [documentation](https://v2.vuejs.org/v2/api/#transition).
### Fade

View File

@ -1,4 +1,4 @@
## Calendar calendar
## Calendar 日历
显示日期

View File

@ -111,6 +111,24 @@
</el-date-picker>
</div>
</div>
<div class="container">
<div class="block">
<span class="demonstration">多个月</span>
<el-date-picker
type="months"
v-model="value5"
placeholder="选择一个或多个月">
</el-date-picker>
</div>
<div class="block">
<span class="demonstration">多个年</span>
<el-date-picker
type="years"
v-model="value6"
placeholder="选择一个或多个年">
</el-date-picker>
</div>
</div>
<script>
export default {
@ -119,7 +137,9 @@
value1: '',
value2: '',
value3: '',
value4: ''
value4: '',
value5: '',
value6: ''
};
}
};
@ -273,7 +293,7 @@
使用`format`指定输入框的格式;使用`value-format`指定绑定值的格式。
默认情况下,组件接受并返回`Date`对象。以下为可用的格式化字串,以 UTC 2017年1月2日 03:04:05 为例:
默认情况下,组件接受并返回`Date`对象。以下为可用的格式化字串,以 UTC 2017年1月2日 03:04:05 为例:
:::warning
请注意大小写
@ -395,7 +415,7 @@
| placeholder | 非范围选择时的占位内容 | string | — | — |
| start-placeholder | 范围选择时开始日期的占位内容 | string | — | — |
| end-placeholder | 范围选择时结束日期的占位内容 | string | — | — |
| type | 显示类型 | string | year/month/date/dates/ week/datetime/datetimerange/ daterange/monthrange | date |
| type | 显示类型 | string | year/month/date/dates/months/years week/datetime/datetimerange/ daterange/monthrange | date |
| format | 显示在输入框中的格式 | string | 见[日期格式](#/zh-CN/component/date-picker#ri-qi-ge-shi) | yyyy-MM-dd |
| align | 对齐方式 | string | left, center, right | left |
| popper-class | DatePicker 下拉框的类名 | string | — | — |
@ -409,6 +429,7 @@
| prefix-icon | 自定义头部图标的类名 | string | — | el-icon-date |
| clear-icon | 自定义清空图标的类名 | string | — | el-icon-circle-close |
| validate-event | 输入时是否触发表单的校验 | boolean | - | true |
| append-to-body | DetePicker 自身是否插入至 body 元素上。 | boolean | — | true |
### Picker Options
| 参数 | 说明 | 类型 | 可选值 | 默认值 |

View File

@ -470,7 +470,7 @@ W3C 标准中有如下[规定](https://www.w3.org/MarkUp/html-spec/html-spec_8.h
{ type: 'number', message: '年龄必须为数字值'}
]"
>
<el-input type="age" v-model.number="numberValidateForm.age" autocomplete="off"></el-input>
<el-input v-model.number="numberValidateForm.age" autocomplete="off"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('numberValidateForm')">提交</el-button>

View File

@ -146,7 +146,7 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
## 通过 CDN 的方式加载语言文件
```html
<script src="//unpkg.com/vue"></script>
<script src="//unpkg.com/vue@2"></script>
<script src="//unpkg.com/element-ui"></script>
<script src="//unpkg.com/element-ui/lib/umd/locale/en.js"></script>
@ -158,7 +158,7 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
搭配 `vue-i18n` 使用
```html
<script src="//unpkg.com/vue"></script>
<script src="//unpkg.com/vue@2"></script>
<script src="//unpkg.com/vue-i18n/dist/vue-i18n.js"></script>
<script src="//unpkg.com/element-ui"></script>
<script src="//unpkg.com/element-ui/lib/umd/locale/zh-CN.js"></script>

View File

@ -147,6 +147,7 @@
| scroll-container | 开启懒加载后,监听 scroll 事件的容器 | string / HTMLElement | — | 最近一个 overflow 值为 auto 或 scroll 的父元素 |
| preview-src-list | 开启图片预览功能 | Array | — | - |
| z-index | 设置图片预览的 z-index | Number | — | 2000 |
| initial-index | 图片预览初始图片index | Number | — | - |
### Events
| 事件名称 | 说明 | 回调参数 |

View File

@ -250,7 +250,7 @@ export default {
### 尺寸
:::demo 可通过 `size` 属性指定输入框的尺寸,除了默认的大小外,还提供了 large、small 和 mini 三种尺寸。
:::demo 可通过 `size` 属性指定输入框的尺寸,除了默认的大小外,还提供了 medium、small 和 mini 三种尺寸。
```html
<div class="demo-input-size">
<el-input

View File

@ -25,11 +25,11 @@ npm i element-ui -S
### Hello world
通过 CDN 的方式我们可以很容易地使用 Element 写出一个 Hello world 页面。[在线演示](https://codepen.io/ziyoung/pen/rRKYpd)
通过 CDN 的方式我们可以很容易地使用 Element 写出一个 Hello world 页面。[在线演示](https://codepen.io/bofeng/pen/poaEmJY)
<iframe height="265" style="width: 100%;" scrolling="no" title="Element demo" src="//codepen.io/ziyoung/embed/rRKYpd/?height=265&theme-id=light&default-tab=html" frameborder="no" allowtransparency="true" allowfullscreen="true">
See the Pen <a href='https://codepen.io/ziyoung/pen/rRKYpd/'>Element demo</a> by hetech
(<a href='https://codepen.io/ziyoung'>@ziyoung</a>) on <a href='https://codepen.io'>CodePen</a>.
<iframe height="265" style="width: 100%;" scrolling="no" title="Element demo" src="//codepen.io/bofeng/embed/poaEmJY/?height=265&theme-id=light&default-tab=html" frameborder="no" allowtransparency="true" allowfullscreen="true">
See the Pen <a href='https://codepen.io/bofeng/pen/poaEmJY/'>Element demo</a> by hetech
(<a href='https://codepen.io/bofeng'>@bofeng</a>) on <a href='https://codepen.io'>CodePen</a>.
</iframe>
如果是通过 npm 安装,并希望配合 webpack 使用,请阅读下一节:[快速上手](/#/zh-CN/component/quickstart)。

View File

@ -4,7 +4,7 @@
### 基础用法
:::demo 设置`layout`,表示需要显示的内容,用逗号分隔,布局元素会依次显示。`prev`表示上一页,`next`为下一页,`pager`表示页码列表,除此以外还提供了`jumper`和`total``size`和特殊的布局符号`->``->`后的元素会靠右显示,`jumper`表示跳页元素,`total`表示总条目数,`size`用于设置每页显示的页码数量。
:::demo 设置`layout`,表示需要显示的内容,用逗号分隔,布局元素会依次显示。`prev`表示上一页,`next`为下一页,`pager`表示页码列表,除此以外还提供了`jumper`和`total``sizes`和特殊的布局符号`->``->`后的元素会靠右显示,`jumper`表示跳页元素,`total`表示总条目数,`sizes`用于设置每页显示的页码数量。
```html
<div class="block">
<span class="demonstration">页数较少时的效果</span>

View File

@ -146,7 +146,7 @@ Popover 的属性与 Tooltip 很类似,它们都是基于`Vue-popper`开发的
| offset | 出现位置的偏移量 | Number | — | 0 |
| transition | 定义渐变动画 | String | — | fade-in-linear |
| visible-arrow | 是否显示 Tooltip 箭头,更多参数可见[Vue-popper](https://github.com/element-component/vue-popper) | Boolean | — | true |
| popper-options | [popper.js](https://popper.js.org/documentation.html) 的参数 | Object | 参考 [popper.js](https://popper.js.org/documentation.html) 文档 | `{ boundariesElement: 'body', gpuAcceleration: false }` |
| popper-options | [popper.js](https://popper.js.org/docs/v2/) 的参数 | Object | 参考 [popper.js](https://popper.js.org/docs/v2/) 文档 | `{ boundariesElement: 'body', gpuAcceleration: false }` |
| popper-class | 为 popper 添加类名 | String | — | — |
| open-delay | 触发方式为 hover 时的显示延迟,单位为毫秒 | Number | — | — |
| close-delay | 触发方式为 hover 时的隐藏延迟,单位为毫秒 | number | — | 200 |

View File

@ -175,4 +175,6 @@ Progress 组件可通过 `type` 属性来指定使用环形进度条,在环形
| width | 环形进度条画布宽度(只在 type 为 circle 或 dashboard 时可用) | number | | 126 |
| show-text | 是否显示进度条文字内容 | boolean | — | true |
| stroke-linecap | circle/dashboard 类型路径两端的形状 | string | butt/round/square | round |
| format | 指定进度条文字内容 | function(percentage) | — | — |
| format | 指定进度条文字内容 | function(percentage) | — | — |
| define-back-color | 指定进度条底色(支持 hex 格式) | string | — | — |
| text-color | 指定进度条字体颜色(支持 hex 格式) | string | — | — |

View File

@ -187,7 +187,7 @@
### Radio Events
| 事件名称 | 说明 | 回调参数 |
|---------- |-------- |---------- |
| change | 绑定值变化时触发的事件 | 选中的 Radio label 值 |
| input | 绑定值变化时触发的事件 | 选中的 Radio label 值 |
### Radio-group Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
@ -201,7 +201,7 @@
### Radio-group Events
| 事件名称 | 说明 | 回调参数 |
|---------- |-------- |---------- |
| change | 绑定值变化时触发的事件 | 选中的 Radio label 值 |
| input | 绑定值变化时触发的事件 | 选中的 Radio label 值 |
### Radio-button Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |

View File

@ -42,7 +42,7 @@
### 自定义样式
ElementPlus 提供的排版模式有时候并不满足要求,当您想要用自己定义的模板时,可以通过一个具名 Slot 来自己设定模板。
Element 提供的排版模式有时候并不满足要求,当您想要用自己定义的模板时,可以通过一个具名 Slot 来自己设定模板。
我们提供了不同的模板单元可供使用,具体可选值请看 API 详细描述。 建议在描述模板的时候,尽量靠近真实的 DOM 结构,这样可以避免 DOM 高度差距引起的抖动。
:::demo
@ -306,7 +306,7 @@ ElementPlus 提供的排版模式有时候并不满足要求,当您想要用
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
| ------- | ------------------------ | ------------ | -------------------------------------------------------------------- | ------ |
| variant | 当前显示的占位元素的样式 | Enum(string) | p / text / h1 / h3 / text / caption / button / image / circle / rect | text |
| variant | 当前显示的占位元素的样式 | Enum(string) | p / h1 / h3 / text / caption / button / image / circle / rect | text |
### Skeleton Slots

View File

@ -0,0 +1,254 @@
## Statistic 统计数值
用于突出某个或某组数字时,如显示数值,如金额,排名等。
倒计时模式
### 基础用法
组件提供千分位的展示,不过可以通过 rate 来设置相应万分位等
:::demo
```html
<template>
<div>
<el-row :gutter="20">
<el-col :span="6">
<div>
<el-statistic
group-separator=","
:precision="2"
:value="value2"
:title="title"
></el-statistic>
</div>
</el-col>
<el-col :span="6">
<div>
<el-statistic title="男女比">
<template slot="formatter">
456/2
</template>
</el-statistic>
</div>
</el-col>
<el-col :span="6">
<div>
<el-statistic
group-separator=","
:precision="2"
decimal-separator="."
:value="value1"
:title="title"
>
<template slot="prefix">
<i class="el-icon-s-flag" style="color: red"></i>
</template>
<template slot="suffix">
<i class="el-icon-s-flag" style="color: blue"></i>
</template>
</el-statistic>
</div>
</el-col>
<el-col :span="6">
<div>
<el-statistic :value="like ? 521 : 520" title="Feedback">
<template slot="suffix">
<span @click="like = !like" class="like">
<i
class="el-icon-star-on"
style="color:red"
v-show="!!like"
></i>
<i class="el-icon-star-off" v-show="!like"></i>
</span>
</template>
</el-statistic>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data() {
return {
like: true,
value1: 4154.564,
value2: 1314,
title: "增长人数",
};
},
};
</script>
<style lang="scss">
.like {
cursor: pointer;
font-size: 25px;
display: inline-block;
}
</style>
```
:::
### 倒计时
:::warning
如果需要在原基础上添加时间,请注意:整体的时间(添加的时间量和原定时间)必须是**未来**的时间节点,否则依旧是倒计时结束
:::
:::demo 通过 `value` 提供未来的时间,将开启倒计时功能
```html
<template>
<div>
<el-row :gutter="20">
<el-col :span="14">
<el-card shadow="hover" style="width: 100%;">
<div style="width: 100%; display: inline-block; ">
<el-statistic :value="deadline2" time-indices title="🎉商品降价🎉">
<template slot="suffix">
抢购即将开始
</template>
</el-statistic>
</div>
</el-card>
<el-card shadow="hover" style="width: 100%;margin-top: 20px; ">
<div style="width: 100%; display: inline-block; ">
<el-statistic
@finish="hilarity"
:value="deadline3"
time-indices
title="时间游戏"
>
<template slot="suffix">
<el-button type="primary " size="mini" @click="add"
>add 10s</el-button
>
</template>
</el-statistic>
</div>
</el-card>
<el-card shadow="hover" style="width: 100%;margin-top: 20px; ">
<div style="width: 100%; display: inline-block;">
<el-statistic
format="DD天HH小时mm分钟"
:value="deadline5"
time-indices
title="🚩距离立夏还有:"
>
</el-statistic>
</div>
</el-card>
</el-col>
<el-col :span="10">
<el-card shadow="hover" style="width: 100%;">
<div slot="header" class="clearfix">
<span>文嘉《明日歌》</span>
<el-button
style="float: right; padding: 3px 0"
type="text"
@click="clickFn"
>暂停</el-button
>
</div>
<div style="font-size: 18px;text-align: center; margin-top: 35px;">
明日复明日
</div>
<div style="font-size: 18px;text-align: center;">明日何其多</div>
<div style="font-size: 18px;text-align: center;">我生待明日</div>
<div style="font-size: 18px;text-align: center;">万事成蹉跎</div>
<div style="margin-top: 35px;"></div>
<el-statistic
ref="statistic"
@finish="hilarity"
format="HH:mm:ss"
:value="deadline4"
title="距离明日:"
time-indices
>
</el-statistic>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data() {
return {
deadline2: Date.now() + 1000 * 60 * 60 * 8,
deadline3: Date.now() + 1000 * 60 * 30,
deadline4: Date.now() + (new Date().setHours(23, 59, 59) - Date.now()),
deadline5: new Date("2023-05-06"),
stop: true,
};
},
methods: {
hilarity() {
this.$notify({
title: "提示",
message: "时间已到",
duration: 0,
});
},
clickFn() {
this.$refs.statistic.suspend(this.stop);
this.stop = !this.stop;
},
add() {
this.deadline3 = this.deadline3 + 1000 * 10;
},
},
};
</script>
```
:::
### Statistic Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
| ----------------- | ---------------- | --------------------------- | ------ | ------ |
| value | 数值内容 | string \| number | — | — |
| decimal-separator | 设置小数点 | string | — | . |
| formatter | 自定义数值展示 | v-slot \|({value}) => VNode | — | — |
| group-separator | 设置千分位标识符 | string | — | , |
| precision | 数值精度 | number | — | — |
| prefix | 设置数值的前缀 | string \| v-slot | — | — |
| suffix | 设置数值的后缀 | string \| v-slot | — | — |
| title | 数值的标题 | string \| v-slot | — | — |
| value-style | 设置数值的样式 | object | — | — |
| rate | 设置倍率 | number | — | 1000 |
### Statistic Slots
| name | 说明 |
| --------- | ---------- |
| prefix | 数值的前缀 |
| suffix | 数值的后缀 |
| formatter | 数值内容 |
| title | 数值的标题 |
### Statistic.Countdown Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
| ------------ | ------------------ | ------- | ----------- | ---------- |
| time-indices | 是否开启倒计时功能 | boolean | true\|false | false |
| value | 必填值,输入绑定值 | string | — | — |
| format | 格式化倒计时展示 | string | — | 'HH:mm:ss' |
### Statistic.Countdown Events
| 事件名称 | 说明 | 回调参数 |
| -------- | ---------------------- | ---------------- |
| change | 在`倒计时`的功能中开启 | (value: Date) |
| finish | 在`倒计时` 完成后启动 | (value: boolean) |
### Statistic Methods
| 方法名 | 说明 | 参数 | 回调参数 |
| ------- | ---------- | --------------- | ------------- |
| suspend | 暂停倒计时 | (value:boolean) | (value: Date) |

View File

@ -1420,7 +1420,7 @@
表头支持自定义。
:::demo 通过设置 [Scoped slot](https://cn.vuejs.org/v2/guide/components-slots.html#%E4%BD%9C%E7%94%A8%E5%9F%9F%E6%8F%92%E6%A7%BD) 来自定义表头。
:::demo 通过设置 [Scoped slot](https://v2.cn.vuejs.org/v2/guide/components-slots.html#%E4%BD%9C%E7%94%A8%E5%9F%9F%E6%8F%92%E6%A7%BD) 来自定义表头。
```html
<template>
<el-table
@ -1860,6 +1860,7 @@
| fit | 列的宽度是否自撑开 | boolean | — | true |
| show-header | 是否显示表头 | boolean | — | true |
| highlight-current-row | 是否要高亮当前行 | boolean | — | false |
| highlight-selection-row | 是否要高亮复选框选中行(仅针对开启 `selection` 有效) | boolean | — | false |
| current-row-key | 当前行的 key只写属性 | String,Number | — | — |
| row-class-name | 行的 className 的回调方法,也可以使用字符串为所有行设置一个固定的 className。 | Function({row, rowIndex})/String | — | — |
| row-style | 行的 style 的回调方法,也可以使用一个固定的 Object 为所有行设置一样的 Style。 | Function({row, rowIndex})/Object | — | — |

View File

@ -1,6 +1,6 @@
## TimePicker 时间选择器
用于选择或输入日期
用于选择或输入时间
### 固定时间点

View File

@ -168,7 +168,7 @@ tooltip 内不支持 disabled form 元素,参考[MDN](https://developer.mozill
| offset | 出现位置的偏移量 | Number | — | 0 |
| transition | 定义渐变动画 | String | — | el-fade-in-linear |
| visible-arrow | 是否显示 Tooltip 箭头,更多参数可见[Vue-popper](https://github.com/element-component/vue-popper) | Boolean | — | true |
| popper-options | [popper.js](https://popper.js.org/documentation.html) 的参数 | Object | 参考 [popper.js](https://popper.js.org/documentation.html) 文档 | { boundariesElement: 'body', gpuAcceleration: false } |
| popper-options | [popper.js](https://popper.js.org/docs/v2/) 的参数 | Object | 参考 [popper.js](https://popper.js.org/docs/v2/) 文档 | { boundariesElement: 'body', gpuAcceleration: false } |
| open-delay | 延迟出现,单位毫秒 | Number | — | 0 |
| manual | 手动控制模式,设置为 true 后mouseenter 和 mouseleave 事件将不会生效 | Boolean | — | false |
| popper-class | 为 Tooltip 的 popper 添加类名 | String | — | — |

View File

@ -1,6 +1,6 @@
## 内置过渡动画
Element 内应用在部分组件的过渡动画,你也可以直接使用。在使用之前请阅读 [transition 组件文档](https://cn.vuejs.org/v2/api/#transition) 。
Element 内应用在部分组件的过渡动画,你也可以直接使用。在使用之前请阅读 [transition 组件文档](https://v2.cn.vuejs.org/v2/api/#transition) 。
### fade 淡入淡出

View File

@ -18,7 +18,9 @@
"starter": "脚手架",
"feedback": "反馈建议",
"contribution": "贡献指南",
"eleme": "饿了么"
"eleme": "饿了么",
"elemeTech": "饿了么技术",
"elemeDesign": "饿了么设计"
},
"header": {
"guide": "指南",
@ -49,7 +51,9 @@
"starter": "Starter kit",
"feedback": "Feedback",
"contribution": "Contribution",
"eleme": "Eleme"
"eleme": "Eleme",
"elemeTech": "Eleme Tech",
"elemeDesign": "Eleme Design"
},
"header": {
"guide": "Guide",
@ -80,7 +84,9 @@
"starter": "Kit de inicio",
"feedback": "Comentarios",
"contribution": "Contribución",
"eleme": "Eleme"
"eleme": "Eleme",
"elemeTech": "Eleme Tecnología",
"elemeDesign": "Eleme Diseño"
},
"header": {
"guide": "Guía",
@ -111,7 +117,9 @@
"starter": "Kit de démarrage",
"feedback": "Commentaires",
"contribution": "Contribution",
"eleme": "Eleme"
"eleme": "Eleme",
"elemeTech": "Eleme Technologie",
"elemeDesign": "Eleme Conception"
},
"header": {
"guide": "Guide",

View File

@ -192,6 +192,10 @@
{
"path": "/result",
"title": "Result 结果"
},
{
"path": "/statistic",
"title": "Statistic 统计数值"
}
]
},
@ -506,6 +510,10 @@
{
"path": "/result",
"title": "Result"
},
{
"path": "/statistic",
"title": "Statistic"
}
]
},
@ -824,6 +832,10 @@
{
"path": "/result",
"title": "Result"
},
{
"path": "/statistic",
"title": "Statistic"
}
]
},
@ -1142,6 +1154,10 @@
{
"path": "/result",
"title": "Result"
},
{
"path": "/statistic",
"title": "Statistic"
}
]
},

View File

@ -1 +1 @@
{"1.4.13":"1.4","2.0.11":"2.0","2.1.0":"2.1","2.2.2":"2.2","2.3.9":"2.3","2.4.11":"2.4","2.5.4":"2.5","2.6.3":"2.6","2.7.2":"2.7","2.8.2":"2.8","2.9.2":"2.9","2.10.1":"2.10","2.11.1":"2.11","2.12.0":"2.12","2.13.2":"2.13","2.14.1":"2.14","2.15.6":"2.15"}
{"1.4.13":"1.4","2.0.11":"2.0","2.1.0":"2.1","2.2.2":"2.2","2.3.9":"2.3","2.4.11":"2.4","2.5.4":"2.5","2.6.3":"2.6","2.7.2":"2.7","2.8.2":"2.8","2.9.2":"2.9","2.10.1":"2.10","2.11.1":"2.11","2.12.0":"2.12","2.13.2":"2.13","2.14.1":"2.14","2.15.14":"2.15"}

View File

@ -1,13 +1,14 @@
{
"name": "element-ui",
"version": "2.15.6",
"version": "2.15.14",
"description": "A Component Library for Vue.js.",
"main": "lib/element-ui.common.js",
"files": [
"lib",
"src",
"packages",
"types"
"types",
"web-types.json"
],
"typings": "types/index.d.ts",
"scripts": {
@ -59,6 +60,7 @@
},
"unpkg": "lib/index.js",
"style": "lib/theme-chalk/index.css",
"web-types": "./web-types.json",
"dependencies": {
"async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0",
@ -115,6 +117,7 @@
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "^0.0.32",
"karma-webpack": "^3.0.5",
"launch-editor-middleware": "^2.3.0",
"markdown-it": "^8.4.1",
"markdown-it-anchor": "^5.0.2",
"markdown-it-chain": "^1.3.0",

View File

@ -65,7 +65,7 @@
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
},
buttonDisabled() {
return this.disabled || (this.elForm || {}).disabled;
return this.$options.propsData.hasOwnProperty('disabled') ? this.disabled : (this.elForm || {}).disabled;
}
},

View File

@ -136,6 +136,10 @@ export default {
},
watch: {
value() {
this.syncCheckedValue();
this.checkStrictly && this.calculateCheckedNodePaths();
},
options: {
handler: function() {
this.initStore();
@ -143,10 +147,6 @@ export default {
immediate: true,
deep: true
},
value() {
this.syncCheckedValue();
this.checkStrictly && this.calculateCheckedNodePaths();
},
checkedValue(val) {
if (!isEqual(val, this.value)) {
this.checkStrictly && this.calculateCheckedNodePaths();

View File

@ -159,7 +159,8 @@ const PopperMixin = {
arrowOffset: Popper.props.arrowOffset,
offset: Popper.props.offset,
boundariesPadding: Popper.props.boundariesPadding,
popperOptions: Popper.props.popperOptions
popperOptions: Popper.props.popperOptions,
transformOrigin: Popper.props.transformOrigin
},
methods: Popper.methods,
data: Popper.data,

View File

@ -37,6 +37,14 @@
return NaN;
}
};
// remove the first element that satisfies `pred` from arr
// return a new array if modification occurs
// return the original array otherwise
const removeFromArray = function(arr, pred) {
const idx = typeof pred === 'function' ? arrayFindIndex(arr, pred) : arr.indexOf(pred);
return idx >= 0 ? [...arr.slice(0, idx), ...arr.slice(idx + 1)] : arr;
};
export default {
props: {
disabledDate: {},
@ -205,6 +213,13 @@
}
this.rangeState.selecting = false;
}
} else if (this.selectionMode === 'months') {
const value = this.value || [];
const year = this.date.getFullYear();
const newValue = arrayFindIndex(value, date => date.getFullYear() === year && date.getMonth() === month) >= 0
? removeFromArray(value, date => date.getTime() === newDate.getTime())
: [...value, newDate];
this.$emit('pick', newValue);
} else {
this.$emit('pick', month);
}

View File

@ -218,16 +218,16 @@
},
bindScrollEvent() {
const bindFuntion = (type) => {
const bindFunction = (type) => {
this.$refs[type].wrap.onscroll = (e) => {
// TODO: scroll is emitted when set scrollTop programatically
// should find better solutions in the future!
this.handleScroll(type, e);
};
};
bindFuntion('hours');
bindFuntion('minutes');
bindFuntion('seconds');
bindFunction('hours');
bindFunction('minutes');
bindFunction('seconds');
},
handleScroll(type) {

View File

@ -64,7 +64,8 @@
return val === null || (val instanceof Date && isDate(val));
}
},
date: {}
date: {},
selectionMode: {}
},
computed: {
@ -93,7 +94,16 @@
if (target.tagName === 'A') {
if (hasClass(target.parentNode, 'disabled')) return;
const year = target.textContent || target.innerText;
this.$emit('pick', Number(year));
if (this.selectionMode === 'years') {
const value = this.value || [];
const idx = arrayFindIndex(value, date => date.getFullYear() === Number(year));
const newValue = idx > -1
? [...value.slice(0, idx), ...value.slice(idx + 1)]
: [...value, new Date(year)];
this.$emit('pick', newValue);
} else {
this.$emit('pick', Number(year));
}
}
}
}

View File

@ -102,6 +102,7 @@
<year-table
v-show="currentView === 'year'"
@pick="handleYearPick"
:selection-mode="selectionMode"
:value="value"
:default-value="defaultValue ? new Date(defaultValue) : null"
:date="date"
@ -110,6 +111,7 @@
<month-table
v-show="currentView === 'month'"
@pick="handleMonthPick"
:selection-mode="selectionMode"
:value="value"
:default-value="defaultValue ? new Date(defaultValue) : null"
:date="date"
@ -121,13 +123,13 @@
<div
class="el-picker-panel__footer"
v-show="footerVisible && currentView === 'date'">
v-show="footerVisible && (currentView === 'date' || currentView === 'month' || currentView === 'year')">
<el-button
size="mini"
type="text"
class="el-picker-panel__link-btn"
@click="changeToNow"
v-show="selectionMode !== 'dates'">
v-show="selectionMode !== 'dates' && selectionMode !== 'months' && selectionMode !== 'years'">
{{ t('el.datepicker.now') }}
</el-button>
<el-button
@ -190,6 +192,8 @@
value(val) {
if (this.selectionMode === 'dates' && this.value) return;
if (this.selectionMode === 'months' && this.value) return;
if (this.selectionMode === 'years' && this.value) return;
if (isDate(val)) {
this.date = new Date(val);
} else {
@ -215,6 +219,10 @@
}
} else if (newVal === 'dates') {
this.currentView = 'date';
} else if (newVal === 'years') {
this.currentView = 'year';
} else if (newVal === 'months') {
this.currentView = 'month';
}
}
},
@ -328,6 +336,8 @@
if (this.selectionMode === 'month') {
this.date = modifyDate(this.date, this.year, month, 1);
this.emit(this.date);
} else if (this.selectionMode === 'months') {
this.emit(month, true);
} else {
this.date = changeYearMonthAndClampDate(this.date, this.year, month);
// TODO: should emit intermediate value ??
@ -358,6 +368,8 @@
if (this.selectionMode === 'year') {
this.date = modifyDate(this.date, year, 0, 1);
this.emit(this.date);
} else if (this.selectionMode === 'years') {
this.emit(year, true);
} else {
this.date = changeYearMonthAndClampDate(this.date, year, this.month);
// TODO: should emit intermediate value ??
@ -376,7 +388,7 @@
},
confirm() {
if (this.selectionMode === 'dates') {
if (this.selectionMode === 'dates' || this.selectionMode === 'months' || this.selectionMode === 'years') {
this.emit(this.value);
} else {
// value were emitted in handle{Date,Time}Pick, nothing to update here
@ -390,9 +402,9 @@
},
resetView() {
if (this.selectionMode === 'month') {
if (this.selectionMode === 'month' || this.selectionMode === 'months') {
this.currentView = 'month';
} else if (this.selectionMode === 'year') {
} else if (this.selectionMode === 'year' || this.selectionMode === 'years') {
this.currentView = 'year';
} else {
this.currentView = 'date';
@ -546,7 +558,7 @@
},
footerVisible() {
return this.showTime || this.selectionMode === 'dates';
return this.showTime || this.selectionMode === 'dates' || this.selectionMode === 'months' || this.selectionMode === 'years';
},
visibleTime() {

View File

@ -2,7 +2,7 @@
<el-input
class="el-date-editor"
:class="'el-date-editor--' + type"
:readonly="!editable || readonly || type === 'dates' || type === 'week'"
:readonly="!editable || readonly || type === 'dates' || type === 'week' || type === 'years' || type === 'months'"
:disabled="pickerDisabled"
:size="pickerSize"
:name="name"
@ -97,7 +97,8 @@ const NewPopper = {
appendToBody: Popper.props.appendToBody,
offset: Popper.props.offset,
boundariesPadding: Popper.props.boundariesPadding,
arrowOffset: Popper.props.arrowOffset
arrowOffset: Popper.props.arrowOffset,
transformOrigin: Popper.props.transformOrigin
},
methods: Popper.methods,
data() {
@ -109,6 +110,7 @@ const NewPopper = {
const DEFAULT_FORMATS = {
date: 'yyyy-MM-dd',
month: 'yyyy-MM',
months: 'yyyy-MM',
datetime: 'yyyy-MM-dd HH:mm:ss',
time: 'HH:mm:ss',
week: 'yyyywWW',
@ -116,7 +118,8 @@ const DEFAULT_FORMATS = {
daterange: 'yyyy-MM-dd',
monthrange: 'yyyy-MM',
datetimerange: 'yyyy-MM-dd HH:mm:ss',
year: 'yyyy'
year: 'yyyy',
years: 'yyyy'
};
const HAVE_TRIGGER_TYPES = [
'date',
@ -130,7 +133,9 @@ const HAVE_TRIGGER_TYPES = [
'monthrange',
'timerange',
'datetimerange',
'dates'
'dates',
'months',
'years'
];
const DATE_FORMATTER = function(value, format) {
if (format === 'timestamp') return value.getTime();
@ -254,6 +259,24 @@ const TYPE_VALUE_RESOLVER_MAP = {
return (typeof value === 'string' ? value.split(', ') : value)
.map(date => date instanceof Date ? date : DATE_PARSER(date, format));
}
},
months: {
formatter(value, format) {
return value.map(date => DATE_FORMATTER(date, format));
},
parser(value, format) {
return (typeof value === 'string' ? value.split(', ') : value)
.map(date => date instanceof Date ? date : DATE_PARSER(date, format));
}
},
years: {
formatter(value, format) {
return value.map(date => DATE_FORMATTER(date, format));
},
parser(value, format) {
return (typeof value === 'string' ? value.split(', ') : value)
.map(date => date instanceof Date ? date : DATE_PARSER(date, format));
}
}
};
const PLACEMENT_MAP = {
@ -489,6 +512,10 @@ export default {
return 'year';
} else if (this.type === 'dates') {
return 'dates';
} else if (this.type === 'months') {
return 'months';
} else if (this.type === 'years') {
return 'years';
}
return 'day';
@ -511,7 +538,7 @@ export default {
} else if (this.userInput !== null) {
return this.userInput;
} else if (formattedValue) {
return this.type === 'dates'
return (this.type === 'dates' || this.type === 'years' || this.type === 'months')
? formattedValue.join(', ')
: formattedValue;
} else {
@ -713,7 +740,7 @@ export default {
if (!this.pickerVisible) return;
this.pickerVisible = false;
if (this.type === 'dates') {
if (this.type === 'dates' || this.type === 'years' || this.type === 'months') {
// restore to former value
const oldValue = parseAsFormatAndType(this.valueOnOpen, this.valueFormat, this.type, this.rangeSeparator) || this.valueOnOpen;
this.emitInput(oldValue);

View File

@ -100,7 +100,7 @@ export default {
[item.labelClassName]: true
}}
style={item.labelStyle}
>{item.props.label}</span>
>{item.label}</span>
<span
class={['el-descriptions-item__content', item.contentClassName]}
style={item.contentStyle}

View File

@ -95,6 +95,11 @@
},
validateStatus(value) {
this.validateState = value;
},
rules(value) {
if ((!value || value.length === 0) && this.required === undefined) {
this.clearValidate();
}
}
},
computed: {

View File

@ -62,7 +62,8 @@
zIndex: {
type: Number,
default: 2000
}
},
initialIndex: Number
},
data() {
@ -95,9 +96,15 @@
},
imageIndex() {
let previewIndex = 0;
const initialIndex = this.initialIndex;
if (initialIndex >= 0) {
previewIndex = initialIndex;
return previewIndex;
}
const srcIndex = this.previewSrcList.indexOf(this.src);
if (srcIndex >= 0) {
previewIndex = srcIndex;
return previewIndex;
}
return previewIndex;
}

View File

@ -64,7 +64,7 @@ loadingDirective.install = Vue => {
el.mask.style[property] = el.maskStyle[property];
});
if (el.originalPosition !== 'absolute' && el.originalPosition !== 'fixed') {
if (el.originalPosition !== 'absolute' && el.originalPosition !== 'fixed' && el.originalPosition !== 'sticky') {
addClass(parent, 'el-loading-parent--relative');
}
if (binding.modifiers.fullscreen && binding.modifiers.lock) {

View File

@ -87,7 +87,7 @@ const Loading = (options = {}) => {
});
addStyle(options, parent, instance);
if (instance.originalPosition !== 'absolute' && instance.originalPosition !== 'fixed') {
if (instance.originalPosition !== 'absolute' && instance.originalPosition !== 'fixed' && instance.originalPosition !== 'sticky') {
addClass(parent, 'el-loading-parent--relative');
}
if (options.fullscreen && options.lock) {

View File

@ -15,9 +15,9 @@
aria-valuemax="100"
>
<div class="el-progress-bar" v-if="type === 'line'">
<div class="el-progress-bar__outer" :style="{height: strokeWidth + 'px'}">
<div class="el-progress-bar__outer" :style="{height: strokeWidth + 'px', backgroundColor:defineBackColor}">
<div class="el-progress-bar__inner" :style="barStyle">
<div class="el-progress-bar__innerText" v-if="showText && textInside">{{content}}</div>
<div class="el-progress-bar__innerText" :style="{color:textColor}" v-if="showText && textInside">{{content}}</div>
</div>
</div>
</div>
@ -26,7 +26,7 @@
<path
class="el-progress-circle__track"
:d="trackPath"
stroke="#e5e9f2"
:stroke="defineBackColor"
:stroke-width="relativeStrokeWidth"
fill="none"
:style="trailPathStyle"></path>
@ -43,7 +43,7 @@
<div
class="el-progress__text"
v-if="showText && !textInside"
:style="{fontSize: progressTextSize + 'px'}"
:style="{fontSize: progressTextSize + 'px', color:textColor}"
>
<template v-if="!status">{{content}}</template>
<i v-else :class="iconClass"></i>
@ -93,6 +93,14 @@
type: [String, Array, Function],
default: ''
},
defineBackColor: {
type: [String, Array, Function],
default: '#ebeef5'
},
textColor: {
type: [String, Array, Function],
default: '#606266'
},
format: Function
},
computed: {

View File

@ -0,0 +1,8 @@
import Statistic from './src/main';
/* istanbul ignore next */
Statistic.install = function(Vue) {
Vue.component(Statistic.name, Statistic);
};
export default Statistic;

View File

@ -0,0 +1,204 @@
<template>
<div class="el-statistic">
<div class="head" v-if="title||$slots.title">
<slot name="title">
<span class="title">
{{ title }}
</span>
</slot>
</div>
<div class="con">
<span class="prefix" v-if="prefix||$slots.prefix">
<slot name="prefix" >
{{ prefix }}
</slot>
</span>
<span class="number" :style="valueStyle">
<slot name="formatter"> {{ disposeValue }}</slot>
</span>
<span class="suffix" v-if="suffix||$slots.suffix">
<slot name="suffix">
{{ suffix }}
</slot>
</span>
</div>
</div>
</template>
<script>
import { isNumber, chain, multiply, padStart, reduce} from 'element-ui/src/utils/lodash';
export default {
name: 'ElStatistic',
data() {
return {
disposeValue: '',
timeTask: null,
REFRESH_INTERVAL: 1000 / 30
};
},
props: {
decimalSeparator: {
type: String,
default: '.'
},
groupSeparator: {
type: String,
default: ''
},
precision: {
type: Number,
default: null
},
value: {
type: [String, Number, Date],
default: ''
},
prefix: {
type: String,
default: ''
},
suffix: {
type: String,
default: ''
},
title: {
type: [String, Number],
default: ''
},
timeIndices: {
type: Boolean,
default: false
},
valueStyle: {
type: Object,
default: function() {
return {};
}
},
format: {
type: String,
default: 'HH:mm:ss:SSS'
},
rate: {
type: Number,
default: 1000
}
},
created() {
this.branch();
},
watch: {
value: function() {
this.branch();
},
groupSeparator() {
this.dispose();
},
mulriple() {
this.dispose();
}
},
methods: {
branch() {
let { timeIndices, countDown, dispose} = this;
if (timeIndices) {
countDown(this.value.valueOf() || this.value);
} else {
dispose();
}
},
magnification(num, mulriple = 1000, groupSeparator = ',') {
// magnification factor
const level = String(mulriple).length ;
return num.replace(new RegExp(`(\\d)(?=(\\d{${level - 1}})+$)`, 'g'), `$1${groupSeparator}`);
},
dispose() {
let { value, rate, groupSeparator } = this;
if (!isNumber(value)) return false;
if (this.precision) {
value = value.toFixed(this.precision);
}
let [integer, decimal] = String(value).split('.');
// 1000 multiplying power
if (groupSeparator) {
integer = this.magnification(integer, rate, groupSeparator);
}
let result = `${integer}${decimal ? this.decimalSeparator + decimal : ''}`;
this.disposeValue = result;
return result;
},
diffDate(minuend, subtrahend) {
return Math.max(minuend - subtrahend, 0);
},
suspend(isStop) {
if (isStop) {
if (this.timeTask) {
clearInterval(this.timeTask);
this.timeTask = null;
}
} else {
this.branch();
}
return this.disposeValue;
},
formatTimeStr: function(time) {
let {format} = this;
const escapeRegex = /\[[^\]]*]/g;
const keepList = (format.match(escapeRegex) || []).map(str => str.slice(1, -1));
const timeUnits = [
['Y', 1000 * 60 * 60 * 24 * 365], // years
['M', 1000 * 60 * 60 * 24 * 30], // months
['D', 1000 * 60 * 60 * 24], // days
['H', 1000 * 60 * 60], // hours
['m', 1000 * 60], // minutes
['s', 1000], // seconds
['S', 1] // million seconds
];
let formatText = reduce(
timeUnits,
(con, item) => {
const name = item[0];
return con.replace(new RegExp(`${name}+`, 'g'), (match) => {
let sum = chain(time).divide(item[1]).floor(0).value();
time -= multiply(sum, item[1]);
return padStart(String(sum), String(match).length, 0);
});
},
format
);
let index = 0;
return formatText.replace(escapeRegex, () => {
const match = keepList[index];
index += 1;
return match;
});
},
stopTime(time) {
let result = true; // stop
if (time) {
this.$emit('change', time);
result = false;
} else {
result = true;
this.suspend(true);
this.$emit('finish', true);
}
return result;
},
countDown(timeVlaue) {
let {REFRESH_INTERVAL, timeTask, diffDate, formatTimeStr, stopTime, suspend } = this;
if (timeTask) return;
let than = this;
this.timeTask = setInterval(()=> {
let diffTiem = diffDate(timeVlaue, Date.now());
than.disposeValue = formatTimeStr(diffTiem);
stopTime(diffTiem);
}, REFRESH_INTERVAL);
this.$once('hook:beforeDestroy', () => {
suspend(true);
});
}
}
};
</script>

View File

@ -134,7 +134,9 @@
this.$nextTick(() => {
// set input's checked property
// in case parent refuses to change component's value
this.$refs.input.checked = this.checked;
if (this.$refs.input) {
this.$refs.input.checked = this.checked;
}
});
},
setBackgroundColor() {

View File

@ -32,15 +32,16 @@ export const cellForced = {
return <el-checkbox
disabled={ store.states.data && store.states.data.length === 0 }
indeterminate={ store.states.selection.length > 0 && !this.isAllSelected }
nativeOn-click={ this.toggleAllSelection }
on-input={ this.toggleAllSelection }
value={ this.isAllSelected } />;
},
renderCell: function(h, { row, column, store, $index }) {
renderCell: function(h, { row, column, isSelected, store, $index }) {
return <el-checkbox
nativeOn-click={ (event) => event.stopPropagation() }
value={ store.isSelected(row) }
value={ isSelected }
disabled={ column.selectable ? !column.selectable.call(null, row, $index) : false }
on-input={ () => { store.commit('rowSelectedChanged', row); } } />;
on-input={ () => { store.commit('rowSelectedChanged', row); } }
/>;
},
sortable: false,
resizable: false
@ -67,9 +68,9 @@ export const cellForced = {
renderHeader: function(h, { column }) {
return column.label || '';
},
renderCell: function(h, { row, store }) {
renderCell: function(h, { row, store, isExpanded }) {
const classes = ['el-table__expand-icon'];
if (store.states.expandRows.indexOf(row) > -1) {
if (isExpanded) {
classes.push('el-table__expand-icon--expanded');
}
const callback = function(e) {

View File

@ -1,11 +1,12 @@
import { arrayFindIndex } from 'element-ui/src/utils/util';
import { getCell, getColumnByCell, getRowIdentity } from './util';
import { getCell, getColumnByCell, getRowIdentity, objectEquals } from './util';
import { getStyle, hasClass, removeClass, addClass } from 'element-ui/src/utils/dom';
import ElCheckbox from 'element-ui/packages/checkbox';
import ElTooltip from 'element-ui/packages/tooltip';
import debounce from 'throttle-debounce/debounce';
import LayoutObserver from './layout-observer';
import { mapStates } from './store/helper';
import TableRow from './table-row.js';
export default {
name: 'ElTableBody',
@ -14,7 +15,8 @@ export default {
components: {
ElCheckbox,
ElTooltip
ElTooltip,
TableRow
},
props: {
@ -39,7 +41,7 @@ export default {
border="0">
<colgroup>
{
this.columns.map(column => <col name={ column.id } key={column.id} />)
this.columns.map(column => <col name={column.id} key={column.id} />)
}
</colgroup>
<tbody>
@ -48,7 +50,7 @@ export default {
return acc.concat(this.wrappedRowRender(row, acc.length));
}, [])
}
<el-tooltip effect={ this.table.tooltipEffect } placement="top" ref="tooltip" content={ this.tooltipContent }></el-tooltip>
<el-tooltip effect={this.table.tooltipEffect} placement="top" ref="tooltip" content={this.tooltipContent}></el-tooltip>
</tbody>
</table>
);
@ -71,6 +73,10 @@ export default {
hasExpandColumn: states => states.columns.some(({ type }) => type === 'expand')
}),
columnsHidden() {
return this.columns.map((column, index) => this.isColumnHidden(index));
},
firstDefaultColumnIndex() {
return arrayFindIndex(this.columns, ({ type }) => type === 'default');
}
@ -162,11 +168,20 @@ export default {
},
getRowClass(row, rowIndex) {
let selection = this.store.states.selection;
const classes = ['el-table__row'];
if (this.table.highlightCurrentRow && row === this.store.states.currentRow) {
classes.push('current-row');
}
if (this.table.highlightSelectionRow) {
for (let i = 0; i < selection.length; i++) {
if (objectEquals(row, selection[i])) {
classes.push('selection-row');
}
};
}
if (this.stripe && rowIndex % 2 === 1) {
classes.push('el-table__row--striped');
}
@ -238,7 +253,7 @@ export default {
if (cell) {
const column = getColumnByCell(table, cell);
const hoverState = table.hoverState = {cell, column, row};
const hoverState = table.hoverState = { cell, column, row };
table.$emit('cell-mouse-enter', hoverState.row, hoverState.column, hoverState.cell, event);
}
@ -316,7 +331,6 @@ export default {
rowRender(row, $index, treeRowData) {
const { treeIndent, columns, firstDefaultColumnIndex } = this;
const columnsHidden = columns.map((column, index) => this.isColumnHidden(index));
const rowClasses = this.getRowClass(row, $index);
let display = true;
if (treeRowData) {
@ -328,67 +342,37 @@ export default {
let displayStyle = display ? null : {
display: 'none'
};
return (<tr
style={ [displayStyle, this.getRowStyle(row, $index)] }
class={ rowClasses }
key={ this.getKeyOfRow(row, $index) }
on-dblclick={ ($event) => this.handleDoubleClick($event, row) }
on-click={ ($event) => this.handleClick($event, row) }
on-contextmenu={ ($event) => this.handleContextMenu($event, row) }
on-mouseenter={ _ => this.handleMouseEnter($index) }
on-mouseleave={ this.handleMouseLeave }>
{
columns.map((column, cellIndex) => {
const { rowspan, colspan } = this.getSpan(row, column, $index, cellIndex);
if (!rowspan || !colspan) {
return null;
}
const columnData = { ...column };
columnData.realWidth = this.getColspanRealWidth(columns, colspan, cellIndex);
const data = {
store: this.store,
_self: this.context || this.table.$vnode.context,
column: columnData,
row,
$index
};
if (cellIndex === firstDefaultColumnIndex && treeRowData) {
data.treeNode = {
indent: treeRowData.level * treeIndent,
level: treeRowData.level
};
if (typeof treeRowData.expanded === 'boolean') {
data.treeNode.expanded = treeRowData.expanded;
// 表明是懒加载
if ('loading' in treeRowData) {
data.treeNode.loading = treeRowData.loading;
}
if ('noLazyChildren' in treeRowData) {
data.treeNode.noLazyChildren = treeRowData.noLazyChildren;
}
}
}
return (
<td
style={ this.getCellStyle($index, cellIndex, row, column) }
class={ this.getCellClass($index, cellIndex, row, column) }
rowspan={ rowspan }
colspan={ colspan }
on-mouseenter={ ($event) => this.handleCellMouseEnter($event, row) }
on-mouseleave={ this.handleCellMouseLeave }>
{
column.renderCell.call(
this._renderProxy,
this.$createElement,
data,
columnsHidden[cellIndex]
)
}
</td>
);
})
}
</tr>);
return (
<TableRow
style={[displayStyle, this.getRowStyle(row, $index)]}
class={rowClasses}
key={this.getKeyOfRow(row, $index)}
nativeOn-dblclick={($event) => this.handleDoubleClick($event, row)}
nativeOn-click={($event) => this.handleClick($event, row)}
nativeOn-contextmenu={($event) => this.handleContextMenu($event, row)}
nativeOn-mouseenter={_ => this.handleMouseEnter($index)}
nativeOn-mouseleave={this.handleMouseLeave}
columns={columns}
row={row}
index={$index}
store={this.store}
context={this.context || this.table.$vnode.context}
firstDefaultColumnIndex={firstDefaultColumnIndex}
treeRowData={treeRowData}
treeIndent={treeIndent}
columnsHidden={this.columnsHidden}
getSpan={this.getSpan}
getColspanRealWidth={this.getColspanRealWidth}
getCellStyle={this.getCellStyle}
getCellClass={this.getCellClass}
handleCellMouseEnter={this.handleCellMouseEnter}
handleCellMouseLeave={this.handleCellMouseLeave}
isSelected={this.store.isSelected(row)}
isExpanded={this.store.states.expandRows.indexOf(row) > -1}
fixed={this.fixed}
>
</TableRow>
);
},
wrappedRowRender(row, $index) {

View File

@ -291,8 +291,7 @@ export default {
return classes.join(' ');
},
toggleAllSelection(event) {
event.stopPropagation();
toggleAllSelection() {
this.store.commit('toggleAllSelection');
},

View File

@ -113,7 +113,6 @@ class TableLayout {
const noData = !(this.store.states.data && this.store.states.data.length);
this.viewportHeight = this.scrollX ? tableHeight - (noData ? 0 : this.gutterWidth) : tableHeight;
this.updateScrollY();
this.notifyObservers('scrollable');
}

View File

@ -0,0 +1,101 @@
import ElCheckbox from 'element-ui/packages/checkbox';
export default {
name: 'ElTableRow',
props: [
'columns',
'row',
'index',
'isSelected',
'isExpanded',
'store',
'context',
'firstDefaultColumnIndex',
'treeRowData',
'treeIndent',
'columnsHidden',
'getSpan',
'getColspanRealWidth',
'getCellStyle',
'getCellClass',
'handleCellMouseLeave',
'handleCellMouseEnter',
'fixed'
],
components: {
ElCheckbox
},
render() {
const {
columns,
row,
index: $index,
store,
context,
firstDefaultColumnIndex,
treeRowData,
treeIndent,
columnsHidden = [],
isSelected,
isExpanded
} = this;
return (
<tr>
{
columns.map((column, cellIndex) => {
const { rowspan, colspan } = this.getSpan(row, column, $index, cellIndex);
if (!rowspan || !colspan) {
return null;
}
const columnData = { ...column };
columnData.realWidth = this.getColspanRealWidth(columns, colspan, cellIndex);
const data = {
store,
isSelected,
isExpanded,
_self: context,
column: columnData,
row,
$index
};
if (cellIndex === firstDefaultColumnIndex && treeRowData) {
data.treeNode = {
indent: treeRowData.level * treeIndent,
level: treeRowData.level
};
if (typeof treeRowData.expanded === 'boolean') {
data.treeNode.expanded = treeRowData.expanded;
// 表明是懒加载
if ('loading' in treeRowData) {
data.treeNode.loading = treeRowData.loading;
}
if ('noLazyChildren' in treeRowData) {
data.treeNode.noLazyChildren = treeRowData.noLazyChildren;
}
}
}
return (
<td
style={this.getCellStyle($index, cellIndex, row, column)}
class={this.getCellClass($index, cellIndex, row, column)}
rowspan={rowspan}
colspan={colspan}
on-mouseenter={($event) => this.handleCellMouseEnter($event, row)}
on-mouseleave={this.handleCellMouseLeave}
>
{
column.renderCell.call(
this._renderProxy,
this.$createElement,
data,
columnsHidden[cellIndex]
)
}
</td>
);
})
}
</tr>
);
}
};

View File

@ -295,6 +295,11 @@
highlightCurrentRow: Boolean,
highlightSelectionRow: {
type: Boolean,
default: false
},
currentRowKey: [String, Number],
emptyText: String,
@ -412,7 +417,7 @@
},
// TODO 使 CSS transform
syncPostion: throttle(20, function() {
syncPostion() {
const { scrollLeft, scrollTop, offsetWidth, scrollWidth } = this.bodyWrapper;
const { headerWrapper, footerWrapper, fixedBodyWrapper, rightFixedBodyWrapper } = this.$refs;
if (headerWrapper) headerWrapper.scrollLeft = scrollLeft;
@ -427,17 +432,30 @@
} else {
this.scrollPosition = 'middle';
}
},
throttleSyncPostion: throttle(16, function() {
this.syncPostion();
}),
onScroll(evt) {
let raf = window.requestAnimationFrame;
if (!raf) {
this.throttleSyncPostion();
} else {
raf(this.syncPostion);
}
},
bindEvents() {
this.bodyWrapper.addEventListener('scroll', this.syncPostion, { passive: true });
this.bodyWrapper.addEventListener('scroll', this.onScroll, { passive: true });
if (this.fit) {
addResizeListener(this.$el, this.resizeListener);
}
},
unbindEvents() {
this.bodyWrapper.removeEventListener('scroll', this.syncPostion, { passive: true });
this.bodyWrapper.removeEventListener('scroll', this.onScroll, { passive: true });
if (this.fit) {
removeResizeListener(this.$el, this.resizeListener);
}

Some files were not shown because too many files have changed in this diff Show More