Compare commits

..

58 Commits

Author SHA1 Message Date
Leopoldthecoder
e531b14aa7 [release] 2.0.6 2017-11-29 14:32:44 +08:00
Leopoldthecoder
57f7dc766f [build] 2.0.6 2017-11-29 14:32:44 +08:00
Leopoldthecoder
b7d6579aca Changelog: update for 2.0.6 2017-11-29 14:26:16 +08:00
Leopoldthecoder
765e59de6b Pagination: add background prop 2017-11-29 13:52:44 +08:00
Leopoldthecoder
ace0d05791 Table: expand column supports label 2017-11-27 18:35:49 +08:00
zollero
675253dcb1 MessageBox: Add attribute 'showClose' to doc (#8516)
* MessageBox: Add attribute 'showClose' to doc

Add an attribute 'showClose' to explain whether to show 'close' button on the right top.

MessageBox: 文档中添加一个属性:showClose。 用来解释是否显示 MessageBox 右上角的关闭按钮。改属性,已经在源码中声明。

* MessageBox: Add attribute 'showClose' to doc

Add an attribute 'showClose' to explain whether to show 'close' button on the right top.
2017-11-27 18:04:25 +08:00
Bogdan Luca
6e8f10a556 Input: add clearable (#8509)
* Added clearable to el-input.

* Added en-US example.

* Also fire change event on clear.

* Used clearable shorthand; added clearable to attribute list.

* Added styles.
2017-11-27 10:55:26 +08:00
Leopoldthecoder
9998d13e9c Popper: increase arrow offset to 8px 2017-11-26 16:57:41 +08:00
Leopoldthecoder
475cc04681 Menu: collapsed menu shouldn't open default indices 2017-11-26 16:57:41 +08:00
Leopoldthecoder
7a4ec97f0d Chore: misc updates 2017-11-26 16:57:41 +08:00
Daniel Chiang
abd2d7de36 call doClose() in the exposed close method 2017-11-26 15:38:41 +08:00
Leopoldthecoder
f307f7f428 Cascader: add separator prop 2017-11-25 20:42:13 +08:00
Jason Zoo
6c4006487c Dropdown: inherit size from global config (#8473) 2017-11-24 10:42:04 +08:00
liyl
11b3c8bbfd Autocomplete: support suffixIcon & prefixIcon (#8446)
* feat: update autocomplete

* Feat: update input doc
2017-11-24 10:26:14 +08:00
Leopoldthecoder
0462d9ce1a DatetimePicker: disable inputs when selecting range 2017-11-23 19:22:16 +08:00
Leopoldthecoder
6a99f03e1f Select: update scroll bar position 2017-11-23 19:22:16 +08:00
Leopoldthecoder
9cfdc433c3 Popover: fix manual trigger 2017-11-23 19:22:16 +08:00
Decade
7120490d3e Pagination: reset invalid jumper value (#8408)
* fix pagination jumper value

* fix lint
2017-11-23 19:22:16 +08:00
Leslie
55617e0d1a DatetimePicker: fix max time error when init value is empty (#8336)
1.no init data
2.click start time and comfirm
3.click end time and comfirm(the end time is not change)
4.error
reason:
not evaluate 'maxDate' value in step1
I will show more details in conversation
2017-11-23 19:15:16 +08:00
Leopoldthecoder
e033313608 Select: fix filter input display in multiple mode 2017-11-23 11:36:48 +08:00
Leon Zhang
d6c35bffaa remove unnecessary event 2017-11-22 17:05:22 +08:00
hejinming
94d737fb4a Table: fix el-table-column 'hover-row' class error when expend column embed el-table 2017-11-22 11:44:27 +08:00
Leopoldthecoder
dd8d350b7d Table: fix sorting arrow style 2017-11-21 11:54:45 +08:00
刘洋
6544134c38 Tag: stop close icon click event propagation (#8396)
* Tag关闭按钮@click修改为@click.stop防止事件冒泡(Tag添加自定义事件时,点击关闭会触发两次事件)

* Button: fix closeEvent bug
Tag关闭按钮@click修改为@click.stop防止事件冒泡(Tag添加自定义事件时,点击关闭会触发两次事件)
2017-11-21 11:05:52 +08:00
Leopoldthecoder
8f623b4cc4 Form: required rule shouldn't care about model type 2017-11-20 22:29:01 +08:00
Tadasb
0a23a310e4 Create lt.js
Create a Lithuanian translation.
2017-11-20 10:26:18 +08:00
杨奕
2566e48218 Update fa.js 2017-11-19 16:27:47 +08:00
Morteza Dehghani
7dd10da28b Translate some words
...
2017-11-19 16:27:47 +08:00
Anthony Davie
044d8ef11f FAQ.md with Spanish translation
Added the Spanish translation after the English one.
2017-11-19 16:18:48 +08:00
Anthony Davie
44efc5df35 Update CONTRIBUTING.es.md
Added llinks to Issue reporter, Element UI main website and Vuejs website for clarity.
2017-11-19 16:18:48 +08:00
Anthony Davie
6bc4667789 Spanish translation of CONTRUBITING guidelines
First version of this translation
2017-11-19 16:18:48 +08:00
Leopoldthecoder
beec4739a3 [release] 2.0.5 2017-11-17 15:27:07 +08:00
Leopoldthecoder
46bd165fb1 [build] 2.0.5 2017-11-17 15:27:06 +08:00
Leopoldthecoder
0820daf0dd Changelog: update for 2.0.5 2017-11-17 15:08:28 +08:00
Leopoldthecoder
5406a97359 Chore: misc updates 2017-11-17 12:46:52 +08:00
Leopoldthecoder
23e86bcf1a Table: fix high CPU consumption 2017-11-17 12:28:55 +08:00
ChangJoo Park(박창주)
1af6989544 Update ko.js (#8348) 2017-11-17 12:14:06 +08:00
ChangJoo Park(박창주)
d65249e744 Update ko.js 2017-11-17 12:12:35 +08:00
Stefan de Vogelaere
ecbaea7839 Complete Dutch Translation (#8320)
* Complete Dutch Translation

* Update nl.js
2017-11-16 17:10:40 +08:00
Lengxu
6f1fc76e30 Select: fix input height resetting in default size
* dropdown 组件 新增触发下拉框显示隐藏时, 触发visible事件,传递当前下拉框显示状态

* Dropdown 修改事件名称,新增文档

* Dropdown 统一事件名称,修改文档

* Dropdown 统一事件名称,修改文档

* 完善form表单prop字段介绍

* Repair of multiple height calculation bug
2017-11-16 16:02:41 +08:00
杨奕
217b48338f Update FAQ.md 2017-11-16 11:08:10 +08:00
杨奕
1707bae9f7 Update CONTRIBUTING.en-US.md 2017-11-16 10:59:22 +08:00
Leopoldthecoder
bd55a5a593 Cascader: fix active-item-change event 2017-11-15 21:29:13 +08:00
Ryan.xu
292ad8efec Table: fix table column show-overflow-tooltip bug
Table: fix table column show-overflow-tooltip bug, low version Firefox without innerText, add textContent
2017-11-15 14:10:28 +08:00
wacky6.AriesMBP
c7d3de95b0 input: fix focus 2017-11-15 11:28:22 +08:00
Leopoldthecoder
2884984097 Tree: fix keyboard event 2017-11-15 11:15:26 +08:00
Leopoldthecoder
37f4ce0b30 MessageBox: ensure to get input element 2017-11-15 11:01:09 +08:00
lyh2668
4f00d7dea8 Update table-body.js
添加一个this.$refs.tooltip是否存在的判断
2017-11-15 10:54:19 +08:00
Jingkun Hua
6db51156b1 types: add missing definition 2017-11-14 12:18:12 +08:00
Jingkun Hua
c3cbfb1d4c types: fix #8068 2017-11-14 12:18:12 +08:00
wuzhuyu5
d419e260d0 clickoutside: fix memory leak 2017-11-14 12:15:47 +08:00
Leopoldthecoder
ed511e9219 Tree & Breadcrumb: fix setAttribute to undefined bug 2017-11-13 17:29:16 +08:00
Leopoldthecoder
f24aeeca00 Select: add collapse-tags 2017-11-12 21:03:34 +08:00
Leopoldthecoder
9611079d4d Table: sort arrow nostalgia 2017-11-12 21:03:34 +08:00
Leopoldthecoder
8fa549894b Popover: fix click trigger 2017-11-12 20:13:19 +08:00
Leopoldthecoder
64f154839c Chore: replace includes with indexOf 2017-11-12 14:27:20 +08:00
Leopoldthecoder
1833db26d8 Select: fix divider and focus issue 2017-11-12 14:27:20 +08:00
medice
ac39df84c0 clickoutside: fix memory leak 2017-11-11 10:51:08 +08:00
82 changed files with 1265 additions and 689 deletions

View File

@@ -8,7 +8,7 @@ We are excited that you are interested in contributing to Element. Before submit
## Issue Guidelines
- Issues are exclusively for bug reports, feature requests and design-related topics. Other questions may be closed directly. If any questions come up when you are using Element, please hit [Gitter](https://gitter.im/ElemeFE/element) for help.
- Issues are exclusively for bug reports, feature requests and design-related topics. Other questions may be closed directly. If any questions come up when you are using Element, please hit [Gitter](https://gitter.im/element-en/Lobby) for help.
- Before submitting an issue, please check if similar problems have already been issued.

76
.github/CONTRIBUTING.es.md vendored Normal file
View File

@@ -0,0 +1,76 @@
# Guía para Contribuidores a `Element UI`
¡Hola! Gracias por elegir [Element UI](http://element.eleme.io/#/en-US).
`Element UI` es un archivo de componentes para desarrolladores y para gerentes de productos web basado en [Vue 2.0](https://vuejs.org/)
Estamos orgullosos de que usted esta interesado en contribuir al proyecto `Element`. Antes de someter sus contribuciones, por favor tome un momentito para leer estas simples guías para contribuidores.
## Guía Para Reportar Problemas (“Issues”)
- [“Issues”]( https://elementui.github.io/issue-generator) son exclusivamente para informar de errores, sugerencias o solicitaciones para funcionalidad adicional referente a diseño. Preguntas de otro tipo corren el riesgo de ser cerradas inmediatamente. Sí tiene preguntas sobre el uso de `Element`, vea [Gitter](https://gitter.im/element-en/Lobby) para más ayuda.
- Antes de someter un informe sobre algún problema, sírvase de revisar sí ya hubo un informe.
- Por favor especifique que versión de `Element` y `Vue` que esta utilizando, y que versión de sistema operativo y que versión de navegador web que está utilizando. [JSFiddle](https://jsfiddle.net/) esta recomendado para crear un entorno para reproducir el problema claramente.
## Guías para un “Pull Request (PR)”
- Crea una bifurcación (“fork”) del repositorio a su propia cuenta en github.com. Por favor no crea ramas nuevas aquí.
- Cuando cometa su cambio, formatea en esta forma: `[Nombre de componente]: Datos sobre el “commit”.` (por ejemplo. `Button: Reparación de xxx error`)
- **DE NINGUNA MANERA** incluya archivos dentro del directorio `lib`.
- Asegúrese de que el comando `npm run dist` produzca los archivos correctos.
- Para asegurar compatibilidad y reducir tamaño de los archivos, nuestra configuración de `babel` solo importa `preset-2015`, así que IPAs como Array.prototype.find` y `Object.assign` en `ES2015` no son recomendados. Puede importar “polyfills” terceros, sí es necesario.
- “Rebase” antes de crear un “pull request (PR)” para mantener la historia de “commits” limpia.
- Asegúrese que sus PRs se refrieran a la rama `dev` y no a la rama `master`.
- Si su PR arregla un error técnico, por favor, haga referencia al error especifico.
- Fusión de un PR requiere dos mantenedores: el primero aprueba los cambios después de revisar, y entonces el segundo mantenedor revisa los cambios y hace la fusión.
## Requerimientos Técnicos
`Node.js 4+` y `NPM 3+` son requisitos
.
```shell
git clone git@github.com:ElemeFE/element.git
npm run dev
# abra http://localhost:8085
```
Para usuarios chinos, [yarn](https://github.com/yarnpkg/yarn) con `taobao registry` es recomendado, sí la instalación de dependencias es lenta.
```shell
npm i yarn -g
yarn config set registry https://registry.npm.taobao.org
yarn
npm run dev
# abra http://localhost:8085
```
Para armar:
```
shell
npm run dist
```
## Guía Para Desarrollo de Componentes
- Corra el comando `make new <component-name>` para crear el directorio de su proyecto para un componente nuevo. Verifique su código fuente test, configuración para armar, documentación y `package.json` están incluidos.
- Refiérase al `Button` para componentes anidados.
- Refiérase al `Select` para componentes que dependen de otros componentes.
## Estilo de Desarrollo
Por favor acate a este estilo [ESLint](https://github.com/ElemeFE/eslint-config-elemefe) configuración de [ElemeFE](https://github.com/elemefe).

View File

@@ -1,5 +1,5 @@
Please make sure these boxes are checked before submitting your PR, thank you!
* [ ] Make sure you follow Element's contributing guide ([中文](https://github.com/ElemeFE/element/blob/master/.github/CONTRIBUTING.zh-CN.md) | [English](https://github.com/ElemeFE/element/blob/master/.github/CONTRIBUTING.en-US.md)).
* [ ] Make sure you follow Element's contributing guide ([中文](https://github.com/ElemeFE/element/blob/master/.github/CONTRIBUTING.zh-CN.md) | [English](https://github.com/ElemeFE/element/blob/master/.github/CONTRIBUTING.en-US.md) | [Español](https://github.com/ElemeFE/element/blob/master/.github/CONTRIBUTING.es.md)).
* [ ] Make sure you are merging your commits to `dev` branch.
* [ ] Add some descriptions and refer relative issues for you PR.

View File

@@ -1,5 +1,27 @@
## Changelog
### 2.0.6
*2017-11-29*
- Fixed style bug of Table's sorting icons, #8405
- Fixed trigger mechanism for Popover when its `trigger` is manual, #8467
- Added `prefix-icon` and `suffix-icon` attributes for Autocomplete, #8446 (by @liyanlong)
- Added `separator` attribute for Cascader, #8501
- Added `clearable` attribute for Input, #8509 (by @lbogdan)
- Added `background` attribute for Pagination, #8553
### 2.0.5
*2017-11-17*
- Fixed Popover, Tree, Breadcrumb and Cascader regression in 2.0.4, #8188 #8217 #8283
- Fixed memory leak of clickoutside directive, #8168 #8225 (by @badpunman @STLighter)
- Fixed multiple Select height when its value is cleared, #8317 (by @luciy)
- Added `collapse-tags` attribute for multiple Select to replace tags with one line of text, #8190
- Fixed high CPU consumption caused by hidden Table, #8351
- Now you can use `doLayout` method of Table to update its layout, #8351
### 2.0.4
*2017-11-10*

View File

@@ -1,5 +1,27 @@
## 更新日志
### 2.0.6
*2017-11-29*
- 修复 Table 排序图标的样式问题,#8405
- 修复 `trigger` 为 manual 的 Popover 的触发问题,#8467
- 新增 Autocomplete 的 `prefix-icon``suffix-icon` 属性,#8446by @liyanlong
- 新增 Cascader 的 `separator` 属性,#8501
- 新增 Input 的 `clearable` 属性,#8509by @lbogdan
- 新增 Pagination 的 `background` 属性,#8553
### 2.0.5
*2017-11-17*
- 修复上个版本引入的 Popover、Tree、Breadcrumb、Cascader 的 bug#8188 #8217 #8283
- 修复 clickoutside 指令的内存泄露问题,#8168 #8225by @badpunman @STLighter
- 修复默认尺寸的多选 Select 在清空选项后输入框高度不随之更新的问题,#8317by @luciy
- 新增 Select 的 `collapse-tags` 属性,用于在多选时以文字代替 Tag避免组件高度的增大#8190
- 修复被隐藏的 Table 会造成 CPU 占用持续增加的问题,#8351
- 开放 Table 的 `doLayout` 方法,用于重新计算 Table 的布局,#8351
### 2.0.4
*2017-11-10*

338
FAQ.md
View File

@@ -1,185 +1,217 @@
## 常见问题
<details>
<summary>给组件绑定的事件为什么无法触发?</summary>
在 Vue 2.0 中,为**自定义**组件绑定**原生**事件必须使用 `.native` 修饰符:
```html
<my-component @click.native="handleClick">Click Me</my-component>
```
从易用性的角度出发,我们对 `Button` 组件进行了处理,使它可以监听 `click` 事件:
```html
<el-button @click="handleButtonClick">Click Me</el-button>
```
但是对于其他组件,还是需要添加 `.native` 修饰符。
</details>
<details>
<summary>如何在 Table 组件的每一行添加操作该行数据的按钮?</summary>
使用 [Scoped slot](https://vuejs.org/v2/guide/components.html#Scoped-Slots) 即可:
```html
<el-table-column label="操作">
<template slot-scope="props">
<el-button @click.native="showDetail(props.row)">查看详情</el-button>
</template>
</el-table-column>
```
参数 `row` 即为对应行的数据。
</details>
<details>
<summary>Tree 组件的 `render-content` 和 Table 组件的 `render-header` 怎么用?</summary>
请阅读 Vue 文档 [Render Function](http://vuejs.org/v2/guide/render-function.html) 的相关内容。注意,使用 JSX 来写 Render Function 的话,需要安装 `babel-plugin-transform-vue-jsx`,并参照其[文档](https://github.com/vuejs/babel-plugin-transform-vue-jsx)进行配置。
</details>
<details>
<summary>如何使用第三方图标库?</summary>
只要修改第三方图标库的前缀(具体方法参阅第三方库的文档),并编写相应的 CSS即可在 Element 中像使用内置图标一样使用第三方图标。例如,将第三方库的前缀改为 `el-icon-my`,然后在其 CSS 文件中添加:
```css
[class^="el-icon-my"], [class*=" el-icon-my"] {
font-family:"your-font-family" !important;
/* 以下内容参照第三方图标库本身的规则 */
font-size: inherit;
font-style:normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
```
具体使用时,和 Element 内置的图标用法一样。比如在 `el-input` 中:
```html
<el-input icon="my-xxx" />
```
</details>
<details>
<summary>所有组件的任意属性都支持 `.sync` 修饰符吗?</summary>
<summary>给组件绑定的事件为什么无法触发?</summary>
不是。对于支持 `.sync` 修饰符的属性,我们会在文档的 API 表格中注明。更多 `.sync` 的用法请查看 [Vue 文档](https://vuejs.org/v2/guide/components.html#sync-Modifier)。
在 Vue 2.0 中,为**自定义**组件绑定**原生**事件必须使用 `.native` 修饰符:
```html
<my-component @click.native="handleClick">Click Me</my-component>
```
从易用性的角度出发,我们对 `Button` 组件进行了处理,使它可以监听 `click` 事件:
```html
<el-button @click="handleButtonClick">Click Me</el-button>
```
但是对于其他组件,还是需要添加 `.native` 修饰符。
</details>
<details>
<summary>你们的文档怎么偷偷更新了?</summary>
我们只会在 Element 发布新版本时同步更新文档,以体现最新的变化。详细的更新内容可以查看 [changelog](https://github.com/ElemeFE/element/blob/master/CHANGELOG.zh-CN.md)。
<summary>如何在 Table 组件的每一行添加操作该行数据的按钮?</summary>
使用 [Scoped slot](https://vuejs.org/v2/guide/components.html#Scoped-Slots) 即可:
```html
<el-table-column label="操作">
<template slot-scope="props">
<el-button @click.native="showDetail(props.row)">查看详情</el-button>
</template>
</el-table-column>
```
参数 `row` 即为对应行的数据。
</details>
<details>
<summary>在项目中引入 Element但是 CSS 报错/字体文件报错/组件没有样式是什么原因?</summary>
请参考我们提供的 [starter kit](https://github.com/ElementUI/element-starter),在 webpack 的 loaders 中正确配置 file-loader、css-loader 和 style-loader。此外我们还提供了基于 [cooking](https://github.com/ElementUI/element-cooking-starter) 和 [laravel](https://github.com/ElementUI/element-in-laravel-starter) 的项目模板
<summary>Tree 组件的 `render-content` 和 Table 组件的 `render-header` 怎么用?</summary>
请阅读 Vue 文档 [Render Function](http://vuejs.org/v2/guide/render-function.html) 的相关内容。注意,使用 JSX 来写 Render Function 的话,需要安装 `babel-plugin-transform-vue-jsx`,并参照其[文档](https://github.com/vuejs/babel-plugin-transform-vue-jsx)进行配置
</details>
<details>
<summary>将 Element 克隆至本地,运行时为何会报错/跑不起来?</summary>
<summary>所有组件的任意属性都支持 `.sync` 修饰符吗?</summary>
不是。对于支持 `.sync` 修饰符的属性,我们会在文档的 API 表格中注明。更多 `.sync` 的用法请查看 [Vue 文档](https://vuejs.org/v2/guide/components.html#sync-Modifier)。
</details>
首先,确保克隆的是 master 分支的最新代码,并且文件完整。其次,确保本地的 node 版本在 4.0 以上npm 版本在 3.0 以上。最后,可以启动开发环境:
<details>
<summary>你们的文档怎么偷偷更新了?</summary>
我们只会在 Element 发布新版本时同步更新文档,以体现最新的变化。详细的更新内容可以查看 [changelog](https://github.com/ElemeFE/element/blob/master/CHANGELOG.zh-CN.md)。
</details>
```bash
npm run dev
```
<details>
<summary>在项目中引入 Element但是 CSS 报错/字体文件报错/组件没有样式是什么原因?</summary>
请参考我们提供的 [starter kit](https://github.com/ElementUI/element-starter),在 webpack 的 loaders 中正确配置 file-loader、css-loader 和 style-loader。此外我们还提供了基于 [cooking](https://github.com/ElementUI/element-cooking-starter) 和 [laravel](https://github.com/ElementUI/element-in-laravel-starter) 的项目模板。
</details>
或是直接打包:
```bash
npm run dist
```
<details>
<summary>将 Element 克隆至本地,运行时为何会报错/跑不起来?</summary>
首先,确保克隆的是 master 分支的最新代码,并且文件完整。其次,确保本地的 node 版本在 4.0 以上npm 版本在 3.0 以上。最后,可以启动开发环境:
```bash
npm run dev
```
或是直接打包:
```bash
npm run dist
```
</details>
## FAQ
<details>
<summary>Why are my event listeners not working?</summary>
In Vue 2.0, adding **native** event handlers in **custom** components requires a `.native` modifier:
```html
<my-component @click.native="handleClick">Click Me</my-component>
```
For the sake of usability, we processed `Button` so it can listen to `click` events:
```html
<el-button @click="handleButtonClick">Click Me</el-button>
```
For other components, the `.native` modifier is still mandatory.
</details>
<details>
<summary>How do I add buttons in each row of Table to operate data of that row?</summary>
Just use [Scoped slot](https://vuejs.org/v2/guide/components.html#Scoped-Slots):
```html
<el-table-column label="Operations">
<template slot-scope="props">
<el-button @click.native="showDetail(props.row)">Details</el-button>
</template>
</el-table-column>
```
The parameter `row` is the data object of corresponding row.
</details>
<details>
<summary>How do `render-content` of Tree and `render-header` of Table work?</summary>
Please refer to [Render Function](http://vuejs.org/v2/guide/render-function.html) in Vue's documentation. In addition, if you are writing render functions with JSX, `babel-plugin-transform-vue-jsx` is required. See [here](https://github.com/vuejs/babel-plugin-transform-vue-jsx) for its configurations.
</details>
<details>
<summary>How do I use third-party icon font library with Element?</summary>
You just need to modify the class name prefix of the third-party library (see their docs for how to do it), and write some CSS, then you can use them just like you use Element built-in icons. For example, change the prefix to `el-icon-my`, and then add the following to its CSS:
```css
[class^="el-icon-my"], [class*=" el-icon-my"] {
font-family:"your-font-family" !important;
/* The following is based on original CSS rules of third-party library */
font-size: inherit;
font-style:normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
```
Now you can use them as you do with built-in icons. For example, in `el-input`:
```html
<el-input icon="my-xxx" />
```
</details>
<details>
<summary>Can I use `.sync` modifier on every attribute?</summary>
<summary>Why are my event listeners not working?</summary>
No, only a few attributes supports the `.sync` modifier, and we have explicitly marked them on the documentation's API table. For more information about `.sync`, please refer to [Vue documentation](https://vuejs.org/v2/guide/components.html#sync-Modifier).
In Vue 2.0, adding **native** event handlers in **custom** components requires a `.native` modifier:
```html
<my-component @click.native="handleClick">Click Me</my-component>
```
For the sake of usability, we processed `Button` so it can listen to `click` events:
```html
<el-button @click="handleButtonClick">Click Me</el-button>
```
For other components, the `.native` modifier is still mandatory.
</details>
<details>
<summary>When do you update documentations of Element?</summary>
We update documentations only when a new version of Element is published so that it reflects all the changes introduced in that version. Updated changed can be found in the [changelog](https://github.com/ElemeFE/element/blob/master/CHANGELOG.en-US.md)。
<summary>How do I add buttons in each row of Table to operate data of that row?</summary>
Just use [Scoped slot](https://vuejs.org/v2/guide/components.html#Scoped-Slots):
```html
<el-table-column label="Operations">
<template slot-scope="props">
<el-button @click.native="showDetail(props.row)">Details</el-button>
</template>
</el-table-column>
```
The parameter `row` is the data object of corresponding row.
</details>
<details>
<summary>I imported Element in my project, but why does it report CSS error/font file error/components have no style?</summary>
Please refer to our [starter kit](https://github.com/ElementUI/element-starter) and correctly configure file-loader, css-loader and style-loader in webpack config file. Besides, we also provide templated based on [cooking](https://github.com/ElementUI/element-cooking-starter) and [laravel](https://github.com/ElementUI/element-in-laravel-starter).
<summary>How do `render-content` of Tree and `render-header` of Table work?</summary>
Please refer to [Render Function](http://vuejs.org/v2/guide/render-function.html) in Vue's documentation. In addition, if you are writing render functions with JSX, `babel-plugin-transform-vue-jsx` is required. See [here](https://github.com/vuejs/babel-plugin-transform-vue-jsx) for its configurations.
</details>
<details>
<summary>I cloned Element's repo, but failed to run it. How do I solve it?</summary>
First, please make sure to clone the latest code in master branch and cloned files are intact. Then, note that the version of Nodejs should be 4.0+ and npm 3.0+. Finally, activate development:
```bash
npm run dev
```
or build it:
```bash
npm run dist
```
<summary>Can I use `.sync` modifier on every attribute?</summary>
No, only a few attributes supports the `.sync` modifier, and we have explicitly marked them on the documentation's API table. For more information about `.sync`, please refer to [Vue documentation](https://vuejs.org/v2/guide/components.html#sync-Modifier).
</details>
<details>
<summary>When do you update documentations of Element?</summary>
We update documentations only when a new version of Element is published so that it reflects all the changes introduced in that version. Updated changed can be found in the [changelog](https://github.com/ElemeFE/element/blob/master/CHANGELOG.en-US.md)。
</details>
<details>
<summary>I imported Element in my project, but why does it report CSS error/font file error/components have no style?</summary>
Please refer to our [starter kit](https://github.com/ElementUI/element-starter) and correctly configure file-loader, css-loader and style-loader in webpack config file. Besides, we also provide templated based on [cooking](https://github.com/ElementUI/element-cooking-starter) and [laravel](https://github.com/ElementUI/element-in-laravel-starter).
</details>
<details>
<summary>I cloned Element's repo, but failed to run it. How do I solve it?</summary>
First, please make sure to clone the latest code in master branch and cloned files are intact. Then, note that the version of Nodejs should be 4.0+ and npm 3.0+. Finally, activate development:
```bash
npm run dev
```
or build it:
```bash
npm run dist
```
</details>
## Preguntas más frecuentes
<details>
<summary>¿Porque mis receptores de eventos no funcionan?</summary>
En Vue 2.0, agregando **nativos** receptores de evento **a medida** componentes requiere el modificador `.native`:
```
html
<mi-componente @click.native="handleClick">Haga Clic Aquí</mi-componente>
```
Para conveniencia, hemos ya procesado eventos para el componente `Button` para que el interfaz sea consistente con `clic` eventos de otros componentes:
```html
<el-button @click="handleButtonClick">Haga Clic Aquí</el-button>
```
Para otros componentes el uso del modificador `.native` sigue siendo obligatorio.
</details>
<details>
<summary>¿Como agrego botones en cada linea de una tabla para que operen en los datos de esa linea?</summary>
Simplemente agregue [“Scoped slot”](https://vuejs.org/v2/guide/components.html#Scoped-Slots):
```html
<el-table-column label="Operaciones">
<template slot-scope="props">
<el-button @click.native="verDetalles(props.row)">Detalles</el-button>
</template>
</el-table-column>
```
El parámetro `row` contiene los datos de la linea correspondiente de la tabla.
</details>
<details>
<summary>¿Como funcionan `render-content` de `Tree` y `render-header` de `Table`?</summary>
Por favor refiérase a [Función de representación](http://vuejs.org/v2/guide/render-function.html) en la documentación de `Vue`. Adicionalmente, sí usted está escribiendo funciones de representar con JSX, se requiere el componente `babel-plugin-transform-vue-jsx`. Más información [aquí](https://github.com/vuejs/babel-plugin-transform-vue-jsx) para su uso y configuración.
</details>
<details>
<summary>¿Puedo usar el modificador `.sync` con cada atributo?</summary>
No, solamente un grupo pequeño de atributos apoyan el modificador `.sync`, y están anotados claramente en la documentación del IPA. Para información adicional sobre `.sync`, por favor refiérase a [documentación de Vue](https://vuejs.org/v2/guide/components.html#sync-Modifier).
</details>
<details>
<summary>¿Cuando añaden a la documentación de `Element`?</summary>
Añadamos la documentación con cada versión nueva de `Element` y los cambios reflejan los cambios del software de esa versión. Los cambios actuales y históricos se encuentran [aquí](https://github.com/ElemeFE/element/blob/master/CHANGELOG.en-US.md).
</details>
<details>
<summary>¿Importé `Element` a mi proyecto pero tengo errores con `CSS` y/o fuentes y mis componentes no tienen ningún estilo?</summary>
Refiérase a [nuestro kit de inicio](https://github.com/ElementUI/element-starter) y configure correctamente `file-loader`, `css-loader` y `style-loader` en el archivo `webpack config`. Además, proveemos un ejemplar para [cooking](https://github.com/ElementUI/element-cooking-starter) y para [laravel](https://github.com/ElementUI/element-in-laravel-starter).
</details>
<details>
<summary>Hice un clon del repositorio de `Element` pero no arranca. ¿Como lo resuelvo?</summary>
Primero, pro favor, asegúrese de usar la versión más corriente en la rama `master` y que los archivos están en orden. Después, revise sí la versión de `Nodejs` es 4.0+ y `npm` debe ser 3.0+. Finalmente active el modo desarrollo:
```bash
npm run dev
```
O arme su aplicación así:
```bash
npm run dist
```
</details>

View File

@@ -18,10 +18,6 @@
> A Vue.js 2.0 UI Toolkit for Web.
<!--<a target='_blank' rel='nofollow' href='https://app.codesponsor.io/link/bD3dKbdDE2F7Ky9LUN1kjTFK/ElemeFE/element'>-->
<!--<img alt='Sponsor' width='888' height='68' src='https://app.codesponsor.io/embed/bD3dKbdDE2F7Ky9LUN1kjTFK/ElemeFE/element.svg' />-->
<!--</a >-->
## Links
- Homepage and documentation
- International users: http://element.eleme.io/

View File

@@ -1,6 +1,6 @@
var fs = require('fs');
var path = require('path');
var version = process.env.VERSION || require('../../package.json').version;
var content = { '1.0.9': '1.0', '1.1.6': '1.1', '1.2.9': '1.2', '1.3.7': '1.3', '1.4.9': '1.4' };
var content = { '1.0.9': '1.0', '1.1.6': '1.1', '1.2.9': '1.2', '1.3.7': '1.3', '1.4.11': '1.4' };
if (!content[version]) content[version] = '2.0';
fs.writeFileSync(path.resolve(__dirname, '../../examples/versions.json'), JSON.stringify(content));

View File

@@ -1669,6 +1669,7 @@ Search and select options with a keyword.
| options | data of the options | array | — | — |
| props | configuration options, see the following table | object | — | — |
| value | selected value | array | — | — |
| separator | option separator | string | — | / |
| popper-class | custom class name for Cascader's dropdown | string | — | — |
| placeholder | input placeholder | string | — | Select |
| disabled | whether Cascader is disabled | boolean | — | false |

View File

@@ -111,7 +111,7 @@ Besides using the `title` attribute, you can customize panel title with named sl
<el-collapse accordion>
<el-collapse-item name="1">
<template slot="title">
Consistency<i class="header-icon el-icon-information"></i>
Consistency<i class="header-icon el-icon-info"></i>
</template>
<div>Consistent with real life: in line with the process and logic of real life, and comply with languages and habits that the users are used to;</div>
<div>Consistent within interface: all elements should be consistent, such as: design style, icons and texts, position of elements, etc.</div>

View File

@@ -3,6 +3,9 @@
data() {
return {
pickerOptions1: {
disabledDate(time) {
return time.getTime() > Date.now();
},
shortcuts: [{
text: 'Today',
onClick(picker) {
@@ -127,6 +130,9 @@ Basic date picker measured by 'day'.
data() {
return {
pickerOptions1: {
disabledDate(time) {
return time.getTime() > Date.now();
},
shortcuts: [{
text: 'Today',
onClick(picker) {

View File

@@ -207,6 +207,7 @@ Currently Element ships with the following languages:
<li>Slovenian (sl)</li>
<li>Arabic (ar)</li>
<li>Hebrew (he)</li>
<li>Lithuanian (lt)</li>
</ul>
If your target language is not included, you are more than welcome to contribute: just add another language config [here](https://github.com/ElemeFE/element/tree/master/src/locale/lang) and create a pull request.

View File

@@ -16,6 +16,7 @@
input7: '',
input8: '',
input9: '',
input10: '',
textarea: '',
textarea2: '',
textarea3: '',
@@ -188,6 +189,29 @@ export default {
```
:::
### Clearable
::: demo Make the Input clearable with the `clearable` attribute.
```html
<el-input
placeholder="Please input"
v-model="input10"
clearable>
</el-input>
<script>
export default {
data() {
return {
input10: ''
}
}
}
</script>
```
:::
### Input with icon
Add an icon to indicate input type.
@@ -639,15 +663,16 @@ Search data from server-side.
|autofocus | same as `autofocus` in native input | boolean | — | false |
|form | same as `form` in native input | string | — | — |
| label | label text | string | — | — |
| clearable | whether to show clear button | boolean | — | false |
### Input slots
| Name | Description |
|------|--------|
| prefix | content as Input prefix |
| suffix | content as Input suffix |
| prepend | content to prepend before Input |
| append | content to append after Input |
| prefix | content as Input prefix, only works when `type` is 'text' |
| suffix | content as Input suffix, only works when `type` is 'text' |
| prepend | content to prepend before Input, only works when `type` is 'text' |
| append | content to append after Input, only works when `type` is 'text' |
### Input Events
@@ -674,6 +699,8 @@ Attribute | Description | Type | Options | Default
| name | same as `name` in native input | string | — | — |
| select-when-unmatched | whether to emit a `select` event on enter when there is no autocomplete match | boolean | — | false |
| label | label text | string | — | — |
| prefix-icon | prefix icon class | string | — | — |
| suffix-icon | suffix icon class | string | — | — |
### Autocomplete slots

View File

@@ -233,7 +233,9 @@ Loading.service(options);
The parameter `options` is the configuration of Loading, and its details can be found in the following table. `LoadingService` returns a Loading instance, and you can close it by invoking its `close` method:
```javascript
let loadingInstance = Loading.service(options);
loadingInstance.close();
this.$nextTick(() => { // Loading should be closed asynchronously
loadingInstance.close();
});
```
Note that in this case the full screen Loading is singleton. If a new full screen Loading is invoked before an existing one is closed, the existing full screen Loading instance will be returned instead of actually creating another Loading instance:
```javascript

View File

@@ -380,6 +380,7 @@ The corresponding methods are: `MessageBox`, `MessageBox.alert`, `MessageBox.con
| type | message type, used for icon display | string | success / info / warning / error | — |
| customClass | custom class name for MessageBox | string | — | — |
| callback | MessageBox closing callback if you don't prefer Promise | function(action), where action can be 'confirm' or 'cancel', and `instance` is the MessageBox instance. You can access to that instance's attributes and methods | — | — |
| showClose | whether to show close icon of MessageBox | boolean | — | true |
| beforeClose | callback before MessageBox closes, and it will prevent MessageBox from closing | function(action, instance, done), where `action` can be 'confirm' or 'cancel'; `instance` is the MessageBox instance, and you can access to that instance's attributes and methods; `done` is for closing the instance | — | — |
| lockScroll | whether to lock body scroll when MessageBox prompts | boolean | — | true |
| showCancelButton | whether to show a cancel button | boolean | — | false (true when called with confirm and prompt) |
@@ -399,4 +400,4 @@ The corresponding methods are: `MessageBox`, `MessageBox.alert`, `MessageBox.con
| inputValidator | validation function for the input. Should returns a boolean or string. If a string is returned, it will be assigned to inputErrorMessage | function | — | — |
| inputErrorMessage | error message when validation fails | string | — | Illegal input |
| center | whether to align the content in center | boolean | — | false |
| roundButton | whether to use round button | boolean | — | false |
| roundButton | whether to use round button | boolean | — | false |

View File

@@ -73,6 +73,18 @@ If you have too much data to display in one page, use pagination.
```
:::
### Buttons with background color
:::demo Set the `background` attribute and the buttons will have a background color.
```html
<el-pagination
background
layout="prev, pager, next"
:total="1000">
</el-pagination>
```
:::
### Small Pagination
Use small pagination in the case of limited space.
@@ -199,6 +211,7 @@ Add more modules based on your scenario.
| Attribute | Description | Type | Accepted Values | Default |
|--------------------|----------------------------------------------------------|-------------------|-------------|--------|
| small | whether to use small pagination | boolean | — | false |
| background | whether the buttons have a background color | Boolean | — | false |
| page-size | item count of each page | number | — | 10 |
| total | total item count | number | — | — |
| page-count | total page count. Set either `total` or `page-count` and pages will be displayed; if you need `page-sizes`, `total` is required | number | — | — |

View File

@@ -176,6 +176,7 @@ Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(RadioButton)
Vue.use(Checkbox)
Vue.use(CheckboxButton)
Vue.use(CheckboxGroup)
Vue.use(Switch)
Vue.use(Select)

View File

@@ -101,6 +101,7 @@
value8: '',
value9: [],
value10: [],
value11: [],
loading: false,
states: ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"]
};
@@ -320,7 +321,7 @@ You can clear Select using a clear icon.
Multiple select uses tags to display selected options.
:::demo Set `multiple` attribute for `el-select` to enable multiple mode. In this case, the value of `v-model` will be an array of selected options.
:::demo Set `multiple` attribute for `el-select` to enable multiple mode. In this case, the value of `v-model` will be an array of selected options. By default the selected options will be displayed as Tags. You can collapse them to a text by using `collapse-tags` attribute.
```html
<template>
<el-select v-model="value5" multiple placeholder="Select">
@@ -331,6 +332,20 @@ Multiple select uses tags to display selected options.
:value="item.value">
</el-option>
</el-select>
<el-select
v-model="value11"
multiple
collapse-tags
style="margin-left: 20px;"
placeholder="Select">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
<script>
@@ -353,7 +368,8 @@ Multiple select uses tags to display selected options.
value: 'Option5',
label: 'Option5'
}],
value5: []
value5: [],
value11: []
}
}
}
@@ -650,6 +666,7 @@ If the binding value of Select is an object, make sure to assign `value-key` as
| value-key | unique identity key name for value, required when value is an object | string | — | value |
| size | size of Input | string | large/small/mini | — |
| clearable | whether single select can be cleared | boolean | — | false |
| collapse-tags | whether to collapse tags to a text when multiple selecting | boolean | — | false |
| multiple-limit | maximum number of options user can select when `multiple` is `true`. No limit when set to 0 | number | — | 0 |
| name | the name attribute of select input | string | — | — |
| placeholder | placeholder | string | — | Select |

View File

@@ -1990,6 +1990,7 @@ You can customize row index in `type=index` columns.
| setCurrentRow | used in single selection Table, set a certain row selected. If called without any parameter, it will clear selection. | row |
| clearSort | clear sorting, restore data to the original order | — |
| clearFilter | clear filter | — |
| doLayout | Refresh the layout of Table. When the visibility of Table changes, you may need to call this method to get a correct layout | — |
### Table Slot
| Name | Description |

View File

@@ -1669,6 +1669,7 @@
| options | 可选项数据源,键名可通过 `props` 属性配置 | array | — | — |
| props | 配置选项,具体见下表 | object | — | — |
| value | 选中项绑定值 | array | — | — |
| separator | 选项分隔符 | string | — | 斜杠'/' |
| popper-class | 自定义浮层类名 | string | — | — |
| placeholder | 输入框占位文本 | string | — | 请选择 |
| disabled | 是否禁用 | boolean | — | false |

View File

@@ -110,7 +110,7 @@
<el-collapse accordion>
<el-collapse-item>
<template slot="title">
一致性 Consistency<i class="header-icon el-icon-information"></i>
一致性 Consistency<i class="header-icon el-icon-info"></i>
</template>
<div>与现实生活一致:与现实生活的流程、逻辑保持一致,遵循用户习惯的语言和概念;</div>
<div>在界面中一致:所有的元素和结构需保持一致,比如:设计样式、图标和文本、元素的位置等。</div>

View File

@@ -2,14 +2,9 @@
module.exports = {
data() {
return {
pickerOptions0: {
disabledDate(time) {
return time.getTime() > Date.now();
}
},
pickerOptions1: {
disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7;
return time.getTime() > Date.now();
},
shortcuts: [{
text: '今天',
@@ -115,8 +110,7 @@
<el-date-picker
v-model="value1"
type="date"
placeholder="选择日期"
:picker-options="pickerOptions0">
placeholder="选择日期">
</el-date-picker>
</div>
<div class="block">
@@ -135,12 +129,10 @@
export default {
data() {
return {
pickerOptions0: {
pickerOptions1: {
disabledDate(time) {
return time.getTime() > Date.now();
}
},
pickerOptions1: {
},
shortcuts: [{
text: '今天',
onClick(picker) {

View File

@@ -219,6 +219,7 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
<li>斯洛文尼亚语sl</li>
<li>阿拉伯语ar</li>
<li>希伯来语he</li>
<li>立陶宛语lt</li>
</ul>
如果你需要使用其他的语言,欢迎贡献 PR只需在 [这里](https://github.com/ElemeFE/element/tree/master/src/locale/lang) 添加一个语言配置文件即可。

View File

@@ -799,10 +799,10 @@ export default {
### Input slots
| name | 说明 |
|------|--------|
| prefix | 输入框头部内容 |
| suffix | 输入框尾部内容 |
| prepend | 输入框前置内容 |
| append | 输入框后置内容 |
| prefix | 输入框头部内容,只对 `type="text"` 有效 |
| suffix | 输入框尾部内容,只对 `type="text"` 有效 |
| prepend | 输入框前置内容,只对 `type="text"` 有效 |
| append | 输入框后置内容,只对 `type="text"` 有效 |
### Input Events
| 事件名称 | 说明 | 回调参数 |
@@ -831,6 +831,8 @@ export default {
| name | 原生属性 | string | — | — |
| select-when-unmatched | 在输入没有任何匹配建议的情况下,按下回车是否触发 `select` 事件 | boolean | — | false |
| label | 输入框关联的label文字 | string | — | — |
| prefix-icon | 输入框头部图标 | string | — | — |
| suffix-icon | 输入框尾部图标 | string | — | — |
### Autocomplete slots
| name | 说明 |

View File

@@ -231,7 +231,9 @@ Loading.service(options);
其中 `options` 参数为 Loading 的配置项,具体见下表。`LoadingService` 会返回一个 Loading 实例,可通过调用该实例的 `close` 方法来关闭它:
```javascript
let loadingInstance = Loading.service(options);
loadingInstance.close();
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
loadingInstance.close();
});
```
需要注意的是,以服务的方式调用的全屏 Loading 是单例的:若在前一个全屏 Loading 关闭前再次调用全屏 Loading并不会创建一个新的 Loading 实例,而是返回现有全屏 Loading 的实例:
```javascript

View File

@@ -378,6 +378,7 @@ import { MessageBox } from 'element-ui';
| type | 消息类型,用于显示图标 | string | success / info / warning / error | — |
| customClass | MessageBox 的自定义类名 | string | — | — |
| callback | 若不使用 Promise可以使用此参数指定 MessageBox 关闭后的回调 | function(action, instance)action 的值为'confirm'或'cancel', instance 为 MessageBox 实例,可以通过它访问实例上的属性和方法 | — | — |
| showClose | MessageBox 是否显示右上角关闭按钮 | boolean | — | true |
| beforeClose | MessageBox 关闭前的回调,会暂停实例的关闭 | function(action, instance, done)action 的值为'confirm'或'cancel'instance 为 MessageBox 实例可以通过它访问实例上的属性和方法done 用于关闭 MessageBox 实例 | — | — |
| lockScroll | 是否在 MessageBox 出现时将 body 滚动锁定 | boolean | — | true |
| showCancelButton | 是否显示取消按钮 | boolean | — | false以 confirm 和 prompt 方式调用时为 true |

View File

@@ -23,6 +23,18 @@
```
:::
### 带有背景色的分页
:::demo 设置`background`属性可以为分页按钮添加背景色。
```html
<el-pagination
background
layout="prev, pager, next"
:total="1000">
</el-pagination>
```
:::
### 小型分页
在空间有限的情况下,可以使用简单的小型分页。
@@ -199,6 +211,7 @@
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|--------------------|----------------------------------------------------------|-------------------|-------------|--------|
| small | 是否使用小型分页样式 | Boolean | — | false |
| background | 是否为分页按钮添加背景色 | Boolean | — | false |
| page-size | 每页显示条目个数 | Number | — | 10 |
| total | 总条目数 | Number | — | — |
| page-count | 总页数total 和 page-count 设置任意一个就可以达到显示页码的功能;如果要支持 page-sizes 的更改,则需要使用 total 属性 | Number | — | — |

View File

@@ -176,6 +176,7 @@ Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(RadioButton)
Vue.use(Checkbox)
Vue.use(CheckboxButton)
Vue.use(CheckboxGroup)
Vue.use(Switch)
Vue.use(Select)

View File

@@ -101,6 +101,7 @@
value8: '',
value9: '',
value10: [],
value11: [],
loading: false,
states: ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"]
};
@@ -319,7 +320,7 @@
适用性较广的基础多选,用 Tag 展示已选项
:::demo 为`el-select`设置`multiple`属性即可启用多选,此时`v-model`的值为当前选中值所组成的数组
:::demo 为`el-select`设置`multiple`属性即可启用多选,此时`v-model`的值为当前选中值所组成的数组。默认情况下选中值会以 Tag 的形式展现,你也可以设置`collapse-tags`属性将它们合并为一段文字。
```html
<template>
<el-select v-model="value5" multiple placeholder="请选择">
@@ -330,6 +331,20 @@
:value="item.value">
</el-option>
</el-select>
<el-select
v-model="value11"
multiple
collapse-tags
style="margin-left: 20px;"
placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
<script>
@@ -352,7 +367,8 @@
value: '选项5',
label: '北京烤鸭'
}],
value5: []
value5: [],
value11: []
}
}
}
@@ -645,6 +661,7 @@
| value-key | 作为 value 唯一标识的键名,绑定值为对象类型时必填 | string | — | value |
| size | 输入框尺寸 | string | large/small/mini | — |
| clearable | 单选时是否可以清空选项 | boolean | — | false |
| collapse-tags | 多选时是否将选中值按文字的形式展示 | boolean | — | false |
| multiple-limit | 多选时用户最多可以选择的项目数,为 0 则不限制 | number | — | 0 |
| name | select input 的 name 属性 | string | — | — |
| placeholder | 占位符 | string | — | 请选择 |

View File

@@ -2053,6 +2053,7 @@
| setCurrentRow | 用于单选表格,设定某一行为选中行,如果调用时不加参数,则会取消目前高亮行的选中状态。 | row |
| clearSort | 用于清空排序条件,数据会恢复成未排序的状态 | — |
| clearFilter | 用于清空过滤条件,数据会恢复成未过滤的状态 | — |
| doLayout | 对 Table 进行重新布局。当 Table 或其祖先元素由隐藏切换为显示时,可能需要调用此方法 | — |
### Table Slot
| name | 说明 |

View File

@@ -9,7 +9,6 @@
</head>
<body>
<div id="app"></div><% if (process.env.NODE_ENV === 'production') { %>
<!--<script src="https://app.codesponsor.io/scripts/qFcVkt4f3DQEg4zrwINGVg?theme=light&height=250&width=240"></script>-->
<script>
if (!window.Promise) {
document.write('<script src="//shadow.elemecdn.com/npm/es6-promise@4.1.1/dist/es6-promise.min.js"><\/script><script>ES6Promise.polyfill()<\/script>')

View File

@@ -1 +1 @@
{"1.0.9":"1.0","1.1.6":"1.1","1.2.9":"1.2","1.3.7":"1.3","1.4.9":"1.4","2.0.4":"2.0"}
{"1.0.9":"1.0","1.1.6":"1.1","1.2.9":"1.2","1.3.7":"1.3","1.4.11":"1.4","2.0.6":"2.0"}

View File

@@ -1,6 +1,6 @@
{
"name": "element-ui",
"version": "2.0.4",
"version": "2.0.6",
"description": "A Component Library for Vue.js.",
"main": "lib/element-ui.common.js",
"files": [

View File

@@ -103,6 +103,8 @@
type: Boolean,
default: false
},
prefixIcon: String,
suffixIcon: String,
label: String,
debounce: {
type: Number,

View File

@@ -26,7 +26,9 @@
mounted() {
const items = this.$el.querySelectorAll('.el-breadcrumb__item');
items[items.length - 1].setAttribute('aria-current', 'page');
if (items.length) {
items[items.length - 1].setAttribute('aria-current', 'page');
}
}
};
</script>

View File

@@ -46,7 +46,7 @@
<template v-if="showAllLevels">
<template v-for="(label, index) in currentLabels">
{{ label }}
<span v-if="index < currentLabels.length - 1"> / </span>
<span v-if="index < currentLabels.length - 1"> {{ separator }} </span>
</template>
</template>
<template v-else>
@@ -123,6 +123,10 @@ export default {
return [];
}
},
separator: {
type: String,
default: '/'
},
placeholder: {
type: String,
default() {

View File

@@ -41,7 +41,8 @@
expandTrigger: 'click',
changeOnSelect: false,
popperClass: '',
hoverTimer: 0
hoverTimer: 0,
clicking: false
};
},
@@ -148,9 +149,11 @@
let hoverMenuRefs = {};
const hoverMenuHandler = e => {
const activeMenu = hoverMenuRefs.activeMenu;
if (!activeMenu) return;
const offsetX = e.offsetX;
const width = hoverMenuRefs.activeMenu.offsetWidth;
const height = hoverMenuRefs.activeMenu.offsetHeight;
const width = activeMenu.offsetWidth;
const height = activeMenu.offsetHeight;
if (e.target === hoverMenuRefs.activeItem) {
clearTimeout(this.hoverTimer);
@@ -186,7 +189,7 @@
// keydown up/down/left/right/enter
events.on.keydown = (ev) => {
const keyCode = ev.keyCode;
if (![37, 38, 39, 40, 13, 9, 27].includes(keyCode)) {
if ([37, 38, 39, 40, 13, 9, 27].indexOf(keyCode) < 0) {
return;
}
const currentEle = ev.target;
@@ -194,7 +197,7 @@
const menuItemList = parentEle.querySelectorAll("[tabindex='-1']");
const currentIndex = Array.prototype.indexOf.call(menuItemList, currentEle); // 当前索引
let nextIndex, nextMenu;
if ([38, 40].includes(keyCode)) {
if ([38, 40].indexOf(keyCode) > -1) {
if (keyCode === 38) { // up键
nextIndex = currentIndex !== 0 ? (currentIndex - 1) : currentIndex;
} else if (keyCode === 40) { // down
@@ -228,7 +231,7 @@
click: 'click',
hover: 'mouseenter'
}[expandTrigger];
events.on[triggerEvent] = events.on['focus'] = () => { // focus 选中
const triggerHandler = () => {
this.activeItem(item, menuIndex);
this.$nextTick(() => {
// adjust self and next level
@@ -236,6 +239,17 @@
this.scrollMenu(this.$refs.menus[menuIndex + 1]);
});
};
events.on[triggerEvent] = triggerHandler;
events.on['mousedown'] = () => {
this.clicking = true;
};
events.on['focus'] = () => { // focus 选中
if (this.clicking) {
this.clicking = false;
return;
}
triggerHandler();
};
} else {
events.on.click = () => {
this.select(item, menuIndex);

View File

@@ -22,6 +22,7 @@
<span class="el-date-range-picker__time-picker-wrap">
<el-input
size="small"
:disabled="rangeState.selecting"
ref="minInput"
:placeholder="t('el.datepicker.startDate')"
class="el-date-range-picker__editor"
@@ -32,6 +33,7 @@
<span class="el-date-range-picker__time-picker-wrap">
<el-input
size="small"
:disabled="rangeState.selecting"
:placeholder="t('el.datepicker.startTime')"
class="el-date-range-picker__editor"
:value="minVisibleTime"
@@ -51,6 +53,7 @@
<span class="el-date-range-picker__time-picker-wrap">
<el-input
size="small"
:disabled="rangeState.selecting"
:placeholder="t('el.datepicker.endDate')"
class="el-date-range-picker__editor"
:value="maxVisibleDate"
@@ -61,6 +64,7 @@
<span class="el-date-range-picker__time-picker-wrap">
<el-input
size="small"
:disabled="rangeState.selecting"
ref="maxInput"
:placeholder="t('el.datepicker.endTime')"
class="el-date-range-picker__editor"
@@ -508,7 +512,7 @@
this.minTimePickerVisible = visible;
}
if (this.maxDate && this.maxDate.getTime() < this.minDate.getTime()) {
if (!this.maxDate || this.maxDate && this.maxDate.getTime() < this.minDate.getTime()) {
this.maxDate = new Date(this.minDate);
}
},

View File

@@ -514,7 +514,7 @@
dateFormat() {
if (this.format) {
return this.format.replace('HH', '').replace(':mm', '').replace(':ss', '').trim();
return this.format.replace('HH', '').replace(/[^a-zA-Z]*mm/, '').replace(/[^a-zA-Z]*ss/, '').trim();
} else {
return 'yyyy-MM-dd';
}

View File

@@ -107,7 +107,6 @@
watch: {
visible(val) {
this.$emit('update:visible', val);
if (val) {
this.closed = false;
this.$emit('open');

View File

@@ -24,7 +24,7 @@
data() {
return {
size: this.dropdown.size
size: this.dropdown.dropdownSize
};
},

View File

@@ -132,7 +132,7 @@
},
handleTriggerKeyDown(ev) {
const keyCode = ev.keyCode;
if ([38, 40].includes(keyCode)) { // up/down
if ([38, 40].indexOf(keyCode) > -1) { // up/down
this.removeTabindex();
this.resetTabindex(this.menuItems[0]);
this.menuItems[0].focus();
@@ -140,7 +140,7 @@
ev.stopPropagation();
} else if (keyCode === 13) { // space enter选中
this.handleClick();
} else if ([9, 27].includes(keyCode)) { // tab || esc
} else if ([9, 27].indexOf(keyCode) > -1) { // tab || esc
this.hide();
}
return;
@@ -151,7 +151,7 @@
const currentIndex = this.menuItemsArray.indexOf(target);
const max = this.menuItemsArray.length - 1;
let nextIndex;
if ([38, 40].includes(keyCode)) { // up/down
if ([38, 40].indexOf(keyCode) > -1) { // up/down
if (keyCode === 38) { // up
nextIndex = currentIndex !== 0 ? currentIndex - 1 : 0;
} else { // down
@@ -168,7 +168,7 @@
if (!this.hideOnClick) { // click关闭
this.visible = false;
}
} else if ([9, 27].includes(keyCode)) { // tab // esc
} else if ([9, 27].indexOf(keyCode) > -1) { // tab // esc
this.hide();
this.triggerElm.focus();
}
@@ -194,7 +194,7 @@
if (!this.splitButton) { // 自定义
this.triggerElm.setAttribute('role', 'button');
this.triggerElm.setAttribute('tabindex', '0');
this.triggerElm.className += ' el-dropdown-selfdefine'; // 控制
this.triggerElm.setAttribute('class', this.triggerElm.getAttribute('class') + ' el-dropdown-selfdefine'); // 控制
}
},
initEvent() {

View File

@@ -176,6 +176,11 @@
this.validateState = 'validating';
var descriptor = {};
if (rules && rules.length > 0) {
rules.forEach(rule => {
delete rule.trigger;
});
}
descriptor[this.prop] = rules;
var validator = new AsyncValidator(descriptor);

View File

@@ -10,7 +10,10 @@
'el-input--prefix': $slots.prefix || prefixIcon,
'el-input--suffix': $slots.suffix || suffixIcon
}
]">
]"
@mouseenter="hovering = true"
@mouseleave="hovering = false"
>
<template v-if="type !== 'textarea'">
<!-- 前置元素 -->
<div class="el-input-group__prepend" v-if="$slots.prepend" tabindex="0">
@@ -40,14 +43,20 @@
<!-- 后置内容 -->
<span
class="el-input__suffix"
v-if="$slots.suffix || suffixIcon || validateState && needStatusIcon"
v-if="$slots.suffix || suffixIcon || showClear || validateState && needStatusIcon"
:style="suffixOffset">
<span class="el-input__suffix-inner">
<slot name="suffix"></slot>
<i class="el-input__icon"
v-if="suffixIcon"
:class="suffixIcon">
</i>
<template v-if="!showClear">
<slot name="suffix"></slot>
<i class="el-input__icon"
v-if="suffixIcon"
:class="suffixIcon">
</i>
</template>
<i v-else
class="el-input__icon el-icon-circle-close el-input__clear"
@click="clear"
></i>
</span>
<i class="el-input__icon"
v-if="validateState"
@@ -77,7 +86,6 @@
</template>
<script>
import emitter from 'element-ui/src/mixins/emitter';
import Focus from 'element-ui/src/mixins/focus';
import Migrating from 'element-ui/src/mixins/migrating';
import calcTextareaHeight from './calcTextareaHeight';
import merge from 'element-ui/src/utils/merge';
@@ -87,7 +95,7 @@
componentName: 'ElInput',
mixins: [emitter, Focus('input'), Migrating],
mixins: [emitter, Migrating],
inject: {
elForm: {
@@ -103,7 +111,9 @@
currentValue: this.value,
textareaCalcStyle: {},
prefixOffset: null,
suffixOffset: null
suffixOffset: null,
hovering: false,
focused: false
};
},
@@ -145,7 +155,11 @@
},
suffixIcon: String,
prefixIcon: String,
label: String
label: String,
clearable: {
type: Boolean,
default: false
}
},
computed: {
@@ -173,6 +187,9 @@
},
isGroup() {
return this.$slots.prepend || this.$slots.append;
},
showClear() {
return this.clearable && this.currentValue !== '' && (this.focused || this.hovering);
}
},
@@ -183,6 +200,9 @@
},
methods: {
focus() {
(this.$refs.input || this.$refs.textarea).focus();
},
getMigratingConfig() {
return {
props: {
@@ -195,13 +215,14 @@
};
},
handleBlur(event) {
this.focused = false;
this.$emit('blur', event);
if (this.validateEvent) {
this.dispatch('ElFormItem', 'el.form.blur', [this.currentValue]);
}
},
inputSelect() {
this.$refs.input.select();
(this.$refs.input || this.$refs.textarea).select();
},
resizeTextarea() {
if (this.$isServer) return;
@@ -219,6 +240,7 @@
this.textareaCalcStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
},
handleFocus(event) {
this.focused = true;
this.$emit('focus', event);
},
handleInput(event) {
@@ -250,6 +272,12 @@
if (this.$slots[pendant]) {
return { transform: `translateX(${place === 'suf' ? '-' : ''}${this.$el.querySelector(`.el-input-group__${pendant}`).offsetWidth}px)` };
}
},
clear() {
this.$emit('input', '');
this.$emit('change', '');
this.setCurrentValue('');
this.focus();
}
},

View File

@@ -119,7 +119,7 @@
data() {
return {
activeIndex: this.defaultActive,
openedMenus: this.defaultOpeneds ? this.defaultOpeneds.slice(0) : [],
openedMenus: (this.defaultOpeneds && !this.collapse) ? this.defaultOpeneds.slice(0) : [],
items: {},
submenus: {}
};
@@ -141,7 +141,9 @@
},
defaultOpeneds(value) {
this.openedMenus = value;
if (!this.collapse) {
this.openedMenus = value;
}
},
collapse(value) {
if (value) this.openedMenus = [];

View File

@@ -204,6 +204,7 @@ MessageBox.prompt = (message, title, options) => {
};
MessageBox.close = () => {
instance.doClose();
instance.visible = false;
msgQueue = [];
currentMsg = null;

View File

@@ -216,7 +216,7 @@
var inputPattern = this.inputPattern;
if (inputPattern && !inputPattern.test(this.inputValue || '')) {
this.editorErrorMessage = this.inputErrorMessage || t('el.messagebox.error');
addClass(this.$refs.input.$el.querySelector('input'), 'invalid');
addClass(this.getInputElement(), 'invalid');
return false;
}
var inputValidator = this.inputValidator;
@@ -224,7 +224,7 @@
var validateResult = inputValidator(this.inputValue);
if (validateResult === false) {
this.editorErrorMessage = this.inputErrorMessage || t('el.messagebox.error');
addClass(this.$refs.input.$el.querySelector('input'), 'invalid');
addClass(this.getInputElement(), 'invalid');
return false;
}
if (typeof validateResult === 'string') {
@@ -234,13 +234,17 @@
}
}
this.editorErrorMessage = '';
removeClass(this.$refs.input.$el.querySelector('input'), 'invalid');
removeClass(this.getInputElement(), 'invalid');
return true;
},
getFistFocus() {
const $btns = this.$el.querySelector('.el-message-box__btns .el-button');
const $title = this.$el.querySelector('.el-message-box__btns .el-message-box__title');
return $btns && $btns[0] || $title;
},
getInputElement() {
const inputRefs = this.$refs.input.$refs;
return inputRefs.input || inputRefs.textarea;
}
},
@@ -266,19 +270,19 @@
}
this.focusAfterClosed = document.activeElement;
messageBox = new Dialog(this.$el, this.focusAfterClosed, this.getFistFocus());
};
}
// prompt
if (this.$type !== 'prompt') return;
if (val) {
setTimeout(() => {
if (this.$refs.input && this.$refs.input.$el) {
this.$refs.input.$el.querySelector('input').focus();
this.getInputElement().focus();
}
}, 500);
} else {
this.editorErrorMessage = '';
removeClass(this.$refs.input.$el.querySelector('input'), 'invalid');
removeClass(this.getInputElement(), 'invalid');
}
}
},

View File

@@ -40,7 +40,9 @@ export default {
prevText: String,
nextText: String
nextText: String,
background: Boolean
},
data() {
@@ -51,7 +53,10 @@ export default {
},
render(h) {
let template = <div class='el-pagination'></div>;
let template = <div class={['el-pagination', {
'is-background': this.background,
'el-pagination--small': this.small
}] }></div>;
const layout = this.layout || '';
if (!layout) return;
const TEMPLATE_MAP = {
@@ -67,10 +72,6 @@ export default {
const rightWrapper = <div class="el-pagination__rightwrapper"></div>;
let haveRightWrapper = false;
if (this.small) {
template.data.class += ' el-pagination--small';
}
components.forEach(compo => {
if (compo === '->') {
haveRightWrapper = true;
@@ -210,23 +211,27 @@ export default {
this.oldValue = event.target.value;
},
handleBlur({ target }) {
this.reassignMaxValue(target);
},
handleKeyUp(event) {
const key = event.key || '';
const keyCode = event.keyCode || '';
if ((key && key === 'Enter') || (keyCode && keyCode === 13)) {
this.reassignMaxValue(event.target);
this.handleChange(event.target.value);
}
this.resetValueIfNeed(target.value);
this.reassignMaxValue(target.value);
},
handleChange(value) {
this.$parent.internalCurrentPage = this.$parent.getValidCurrentPage(value);
this.oldValue = null;
this.resetValueIfNeed(value);
},
reassignMaxValue(target) {
if (+target.value > this.$parent.internalPageCount) {
target.value = this.$parent.internalPageCount;
resetValueIfNeed(value) {
const num = parseInt(value, 10);
if (!isNaN(num)) {
if (num < 1) {
this.$refs.input.$el.querySelector('input').value = 1;
} else {
this.reassignMaxValue(value);
}
}
},
reassignMaxValue(value) {
if (+value > this.$parent.internalPageCount) {
this.$refs.input.$el.querySelector('input').value = this.$parent.internalPageCount;
}
}
},
@@ -242,10 +247,10 @@ export default {
value={ this.$parent.internalCurrentPage }
domPropsValue={ this.$parent.internalCurrentPage }
type="number"
ref="input"
onChange={ this.handleChange }
onFocus={ this.handleFocus }
onBlur={ this.handleBlur }
nativeOnKeyup={ this.handleKeyUp }/>
onBlur={ this.handleBlur }/>
{ this.t('el.pagination.pageClassifier') }
</span>
);

View File

@@ -21,6 +21,7 @@
<script>
import Popper from 'element-ui/src/utils/vue-popper';
import { on, off } from 'element-ui/src/utils/dom';
import { addClass, removeClass } from 'element-ui/src/utils/dom';
import { generateId } from 'element-ui/src/utils/util';
export default {
@@ -59,14 +60,8 @@ export default {
}
},
watch: {
showPopper(newVal, oldVal) {
newVal ? this.$emit('show') : this.$emit('hide');
},
'$refs.reference': {
deep: true,
handler(val) {
console.log(val);
}
showPopper(val) {
val ? this.$emit('show') : this.$emit('hide');
}
},
@@ -79,12 +74,12 @@ export default {
}
// 可访问性
if (reference) {
reference.className += ' el-tooltip';
addClass(reference, 'el-popover__reference');
reference.setAttribute('aria-describedby', this.tooltipId);
reference.setAttribute('tabindex', 0); // tab序列
on(reference, 'focus', this.handleFocus);
on(reference, 'blur', this.handleBlur);
this.trigger !== 'click' && on(reference, 'focus', this.handleFocus);
this.trigger !== 'click' && on(reference, 'blur', this.handleBlur);
on(reference, 'keydown', this.handleKeydown);
on(reference, 'click', this.handleClick);
}
@@ -135,18 +130,15 @@ export default {
this.showPopper = false;
},
handleFocus() {
const reference = this.referenceElm;
reference.className += ' focusing';
this.showPopper = true;
addClass(this.referenceElm, 'focusing');
if (this.trigger !== 'manual') this.showPopper = true;
},
handleClick() {
const reference = this.referenceElm;
reference.className = reference.className.replace(/\s*focusing\s*/, ' ');
removeClass(this.referenceElm, 'focusing');
},
handleBlur() {
const reference = this.referenceElm;
reference.className = reference.className.replace(/\s*focusing\s*/, ' ');
this.showPopper = false;
removeClass(this.referenceElm, 'focusing');
if (this.trigger !== 'manual') this.showPopper = false;
},
handleMouseEnter() {
clearTimeout(this._timer);
@@ -159,7 +151,7 @@ export default {
}
},
handleKeydown(ev) {
if (ev.keyCode === 27) { // esc
if (ev.keyCode === 27 && this.trigger !== 'manual') { // esc
this.doClose();
}
},

View File

@@ -1,6 +1,6 @@
<template>
<ul class="el-select-group__wrap">
<li class="el-select-group__title" v-show="visible">{{ label }}</li>
<ul class="el-select-group__wrap" v-show="visible">
<li class="el-select-group__title">{{ label }}</li>
<li>
<ul class="el-select-group">
<slot></slot>

View File

@@ -9,7 +9,13 @@
@click.stop="toggleMenu"
ref="tags"
:style="{ 'max-width': inputWidth - 32 + 'px' }">
<transition-group @after-leave="resetInputHeight">
<span
class="el-select__multiple-text"
v-show="multipleText"
v-if="collapseTags">
{{ multipleText }}
</span>
<transition-group @after-leave="resetInputHeight" v-if="!collapseTags">
<el-tag
v-for="item in selected"
:key="getValueKey(item)"
@@ -29,6 +35,7 @@
:class="[selectSize ? `is-${ selectSize }` : '']"
:disabled="disabled"
@focus="handleFocus"
@click.stop
@keyup="managePlaceholder"
@keydown="resetInputState"
@keydown.down.prevent="navigateOptions('next')"
@@ -59,8 +66,8 @@
@blur="handleBlur"
@mousedown.native="handleMouseDown"
@keyup.native="debouncedOnInputChange"
@keydown.native.down.prevent="navigateOptions('next')"
@keydown.native.up.prevent="navigateOptions('prev')"
@keydown.native.down.stop.prevent="navigateOptions('next')"
@keydown.native.up.stop.prevent="navigateOptions('prev')"
@keydown.native.enter.prevent="selectOption"
@keydown.native.esc.stop.prevent="visible = false"
@keydown.native.tab="visible = false"
@@ -83,6 +90,7 @@
tag="ul"
wrap-class="el-select-dropdown__wrap"
view-class="el-select-dropdown__list"
ref="scrollbar"
:class="{ 'is-empty': !allowCreate && query && filteredOptionsCount === 0 }"
v-show="options.length > 0 && !loading">
<el-option
@@ -183,6 +191,14 @@
selectSize() {
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
},
multipleText() {
const selected = this.selected;
if (!selected || !selected.length) return '';
const length = selected.length;
const countText = length > 1 ? `(+${ selected.length - 1 })` : '';
return `${ selected[0].currentLabel } ${ countText }`;
}
},
@@ -231,7 +247,8 @@
valueKey: {
type: String,
default: 'value'
}
},
collapseTags: Boolean
},
data() {
@@ -360,7 +377,8 @@
});
this.hoverIndex = -1;
if (this.multiple && this.filterable) {
this.inputLength = this.$refs.input.value.length * 15 + 20;
const length = this.$refs.input.value.length * 15 + 20;
this.inputLength = this.collapseTags ? Math.min(50, length) : length;
this.managePlaceholder();
this.resetInputHeight();
}
@@ -400,6 +418,7 @@
const menu = this.$refs.popper.$el.querySelector('.el-select-dropdown__wrap');
scrollIntoView(menu, target);
}
this.$refs.scrollbar && this.$refs.scrollbar.handleScroll();
},
handleMenuEnter() {
@@ -534,13 +553,14 @@
},
resetInputHeight() {
if (this.collapseTags) return;
this.$nextTick(() => {
if (!this.$refs.reference) return;
let inputChildNodes = this.$refs.reference.$el.childNodes;
let input = [].filter.call(inputChildNodes, item => item.tagName === 'INPUT')[0];
const tags = this.$refs.tags;
input.style.height = this.selected.length === 0
? sizeMap[this.selectSize] + 'px'
? (sizeMap[this.selectSize] || 40) + 'px'
: Math.max(tags ? (tags.clientHeight + 10) : 0, sizeMap[this.selectSize] || 40) + 'px';
if (this.visible && this.emptyText !== false) {
this.broadcast('ElSelectDropdown', 'updatePopper');

View File

@@ -138,7 +138,8 @@ export default {
if (!this.store.states.isComplex) return;
const el = this.$el;
if (!el) return;
const rows = el.querySelectorAll('tbody > tr.el-table__row');
const tr = el.querySelector('tbody').children;
const rows = [].filter.call(tr, row => hasClass(row, 'el-table__row'));
const oldRow = rows[oldVal];
const newRow = rows[newVal];
if (oldRow) {
@@ -153,7 +154,8 @@ export default {
const el = this.$el;
if (!el) return;
const data = this.store.states.data;
const rows = el.querySelectorAll('tbody > tr.el-table__row');
const tr = el.querySelector('tbody').children;
const rows = [].filter.call(tr, row => hasClass(row, 'el-table__row'));
const oldRow = rows[data.indexOf(oldVal)];
const newRow = rows[data.indexOf(newVal)];
if (oldRow) {
@@ -340,10 +342,10 @@ export default {
// 判断是否text-overflow, 如果是就显示tooltip
const cellChild = event.target.querySelector('.cell');
if (hasClass(cellChild, 'el-tooltip') && cellChild.scrollWidth > cellChild.offsetWidth) {
if (hasClass(cellChild, 'el-tooltip') && cellChild.scrollWidth > cellChild.offsetWidth && this.$refs.tooltip) {
const tooltip = this.$refs.tooltip;
this.tooltipContent = cell.innerText;
this.tooltipContent = cell.textContent || cell.innerText;
tooltip.referenceElm = cell;
tooltip.$refs.popper && (tooltip.$refs.popper.style.display = 'none');
tooltip.doDestroy();

View File

@@ -65,8 +65,8 @@ const forced = {
sortable: false
},
expand: {
renderHeader: function(h, {}) {
return '';
renderHeader: function(h, { column }) {
return column.label || '';
},
renderCell: function(h, { row, store }, proxy) {
const expanded = store.states.expandRows.indexOf(row) > -1;

View File

@@ -119,12 +119,10 @@ export default {
{
column.sortable
? <span class="caret-wrapper" on-click={ ($event) => this.handleSortClick($event, column) }>
<span class="sort-caret ascending" on-click={ ($event) => this.handleSortClick($event, column, 'ascending') }>
<i class="el-icon-sort-up"></i>
</span>
<span class="sort-caret descending" on-click={ ($event) => this.handleSortClick($event, column, 'descending') }>
<i class="el-icon-sort-down"></i>
</span>
<i class="sort-caret ascending el-icon-caret-top" on-click={ ($event) => this.handleSortClick($event, column, 'ascending') }>
</i>
<i class="sort-caret descending el-icon-caret-bottom" on-click={ ($event) => this.handleSortClick($event, column, 'descending') }>
</i>
</span>
: ''
}

View File

@@ -345,7 +345,6 @@
this.updateScrollY();
this.layout.update();
this.$nextTick(() => {
if (this.destroyed) return;
if (this.height) {
this.layout.setHeight(this.height);
} else if (this.maxHeight) {
@@ -353,12 +352,6 @@
} else if (this.shouldUpdateHeight) {
this.layout.updateHeight();
}
if (this.$el) {
this.isHidden = this.$el.clientWidth === 0;
if (this.isHidden && this.layout.bodyWidth) {
setTimeout(() => this.debouncedLayout());
}
}
});
}
},
@@ -482,7 +475,11 @@
immediate: true,
handler(val) {
this.store.commit('setData', val);
if (this.$ready) this.doLayout();
if (this.$ready) {
this.$nextTick(() => {
this.doLayout();
});
}
}
},
@@ -497,7 +494,6 @@
},
destroyed() {
this.destroyed = true;
if (this.windowResizeListener) removeResizeListener(this.$el, this.windowResizeListener);
},
@@ -538,8 +534,7 @@
resizeProxyVisible: false,
// 是否拥有多级表头
isGroup: false,
scrollPosition: 'left',
destroyed: false
scrollPosition: 'left'
};
}
};

View File

@@ -11,7 +11,7 @@
<slot></slot>
<i class="el-tag__close el-icon-close"
v-if="closable"
@click="handleClose"></i>
@click.stop="handleClose"></i>
</span>
</transition>
</template>

View File

@@ -1,6 +1,6 @@
{
"name": "element-theme-chalk",
"version": "2.0.4",
"version": "2.0.6",
"description": "Element component chalk theme.",
"main": "lib/index.css",
"style": "lib/index.css",

View File

@@ -142,7 +142,7 @@
@include button-size($--button-mini-padding-vertical, $--button-mini-padding-horizontal, $--button-mini-font-size, $--button-mini-border-radius);
}
@include m(text) {
border: none;
border-color: transparent;
color: $--color-primary;
background: transparent;
padding-left: 0;

View File

@@ -329,6 +329,7 @@ $--input-placeholder-color: $--color-text-placeholder !default;
$--input-max-width: 314px !default;
$--input-hover-border: $--border-color-hover !default;
$--input-clear-hover-color: $--color-text-secondary !default;
$--input-focus-border: $--color-primary !default;
$--input-focus-fill: $--color-white !default;

View File

@@ -2,8 +2,8 @@
@font-face {
font-family: 'element-icons';
src: url('#{$--font-path}/element-icons.woff?t=1508751886602') format('woff'), /* chrome, firefox */
url('#{$--font-path}/element-icons.ttf?t=1508751886602') format('truetype'); /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
src: url('#{$--font-path}/element-icons.woff?t=1510834658947') format('woff'), /* chrome, firefox */
url('#{$--font-path}/element-icons.ttf?t=1510834658947') format('truetype'); /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
font-weight: normal;
font-style: normal
}

View File

@@ -8,6 +8,18 @@
width: 100%;
@include scroll-bar;
& .el-input__clear {
color: $--input-icon-color;
font-size: $--input-font-size;
line-height: 16px;
cursor: pointer;
transition: $--color-transition-base;
&:hover {
color: $--input-clear-hover-color;
}
}
@include e(inner) {
-webkit-appearance: none;
background-color: $--input-fill;

View File

@@ -75,6 +75,7 @@
.el-icon {
display: block;
font-size: 12px;
font-weight: bold;
}
}
@@ -162,6 +163,46 @@
margin: 0;
}
}
@include when(background) {
.btn-prev,
.btn-next,
.el-pager li {
margin: 0 5px;
background-color: $--color-info-lighter;
color: $--color-text-regular;
min-width: 30px;
border-radius: 2px;
}
.btn-prev, .btn-next {
padding: 0;
&.disabled {
color: $--color-text-placeholder;
}
}
.el-pager li {
&:hover {
color: $--pagination-hover-fill;
}
&.active {
background-color: $--color-primary;
color: $--color-white;
}
}
&.el-pagination--small {
.btn-prev,
.btn-next,
.el-pager li {
margin: 0 3px;
min-width: 22px;
}
}
}
}
@include b(pager) {
@@ -173,8 +214,8 @@
padding: 0;
margin: 0;
.el-icon-more::before {
vertical-align: -4px;
.more::before {
line-height: 30px;
}
li {

View File

@@ -27,4 +27,10 @@
line-height: 1;
margin-bottom: 12px;
}
@include e(reference) {
&:focus:not(.focusing), &:focus:hover {
outline-width: 0;
}
}
}

View File

@@ -1,4 +1,5 @@
@import "mixins/mixins";
@import "mixins/utils";
@import "common/var";
@import "select-dropdown";
@import "input";
@@ -88,6 +89,14 @@
}
}
@include e(multiple-text) {
margin-left: 15px;
color: $--input-color;
font-size: $--font-size-base;
display: inline;
@include utils-ellipsis;
}
@include e(close) {
cursor: pointer;
position: absolute;

View File

@@ -426,20 +426,30 @@
}
.caret-wrapper {
position: relative;
display: inline-flex;
flex-direction: column;
align-items: center;
height: 13px;
height: 34px;
width: 24px;
vertical-align: middle;
cursor: pointer;
overflow: initial;
}
.sort-caret {
color: $--icon-color-base;
color: $--color-text-placeholder;
width: 14px;
overflow: hidden;
font-size: 13px;
font-size: 15px;
position: absolute;
&.ascending {
top: 5px;
}
&.descending {
bottom: 7px;
}
}
.ascending .sort-caret.ascending {

View File

@@ -20,9 +20,9 @@
position: relative;
cursor: pointer;
font-size: 12px;
height: 18px;
width: 18px;
line-height: 18px;
height: 16px;
width: 16px;
line-height: 16px;
vertical-align: middle;
top: -1px;
right: -5px;

View File

@@ -194,15 +194,17 @@
checkedItem[0].setAttribute('tabindex', 0);
return;
}
this.treeItems[0].setAttribute('tabindex', 0);
this.treeItems[0] && this.treeItems[0].setAttribute('tabindex', 0);
},
handelKeydown(ev) {
const currentItem = ev.target;
if (currentItem.className.indexOf('el-tree-node') === -1) return;
ev.preventDefault();
const keyCode = ev.keyCode;
this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
const currentIndex = this.treeItemArray.indexOf(currentItem);
let nextIndex;
if ([38, 40].includes(keyCode)) { // up、down
if ([38, 40].indexOf(keyCode) > -1) { // up、down
if (keyCode === 38) { // up
nextIndex = currentIndex !== 0 ? currentIndex - 1 : 0;
} else {
@@ -211,15 +213,13 @@
this.treeItemArray[nextIndex].focus(); // 选中
}
const hasInput = currentItem.querySelector('[type="checkbox"]');
if ([37, 39].includes(keyCode)) { // left、right 展开
if ([37, 39].indexOf(keyCode) > -1) { // left、right 展开
currentItem.click(); // 选中
}
if ([13, 32].includes(keyCode)) { // space enter选中checkbox
if ([13, 32].indexOf(keyCode) > -1) { // space enter选中checkbox
if (hasInput) {
hasInput.click();
}
ev.stopPropagation();
ev.preventDefault();
}
}
},

View File

@@ -173,7 +173,7 @@ if (typeof window !== 'undefined' && window.Vue) {
};
module.exports = {
version: '2.0.4',
version: '2.0.6',
locale: locale.use,
i18n: locale.i18n,
install,

View File

@@ -21,18 +21,18 @@ export default {
prevMonth: 'Previous Month',
nextMonth: 'Next Month',
year: '',
month1: 'Jan',
month2: 'Feb',
month3: 'Mar',
month4: 'Apr',
month1: 'January',
month2: 'February',
month3: 'March',
month4: 'April',
month5: 'May',
month6: 'Jun',
month7: 'Jul',
month8: 'Aug',
month9: 'Sep',
month10: 'Oct',
month11: 'Nov',
month12: 'Dec',
month6: 'June',
month7: 'July',
month8: 'August',
month9: 'September',
month10: 'October',
month11: 'November',
month12: 'December',
// week: 'week',
weeks: {
sun: 'Sun',

View File

@@ -2,24 +2,24 @@ export default {
el: {
colorpicker: {
confirm: 'باشد',
clear: 'خذف'
clear: 'حذف'
},
datepicker: {
now: 'اکنون',
today: 'امروز',
cancel: 'لغو',
clear: 'خذف',
confirm: 'باشد',
clear: 'حذف',
confirm: 'باشه',
selectDate: 'انتخاب تاریخ',
selectTime: 'انتخاب زمان',
startDate: 'تاریخ شروع',
startTime: 'زمان شروع',
endDate: 'تاریخ پایان',
endTime: 'زمان پایان',
prevYear: 'Previous Year', // to be translated
nextYear: 'Next Year', // to be translated
prevMonth: 'Previous Month', // to be translated
nextMonth: 'Next Month', // to be translated
prevYear: 'سال قبل',
nextYear: 'سال بعد',
prevMonth: 'ماه قبل',
nextMonth: 'ماه بعد',
year: 'سال',
month1: 'ژانویه',
month2: 'فوریه',
@@ -77,7 +77,7 @@ export default {
},
messagebox: {
title: 'پیام',
confirm: 'باشد',
confirm: 'باشه',
cancel: 'لغو',
error: 'ورودی غیر مجاز'
},
@@ -85,7 +85,7 @@ export default {
deleteTip: 'press delete to remove', // to be translated
delete: 'حذف',
preview: 'پیش‌نمایش',
continue: 'ادهمه'
continue: 'ادامه'
},
table: {
emptyText: 'اطلاعاتی وجود ندارد',
@@ -101,7 +101,7 @@ export default {
noMatch: 'هیچ داده‌ای پیدا نشد',
noData: 'اطلاعاتی وجود ندارد',
titles: ['List 1', 'List 2'], // to be translated
filterPlaceholder: 'Enter keyword', // to be translated
filterPlaceholder: 'کلید واژه هارو وارد کن',
noCheckedFormat: '{total} items', // to be translated
hasCheckedFormat: '{checked}/{total} checked' // to be translated
}

View File

@@ -16,10 +16,10 @@ export default {
startTime: '시작 시간',
endDate: '종료 날짜',
endTime: '종료 시간',
prevYear: 'Previous Year', // to be translated
nextYear: 'Next Year', // to be translated
prevMonth: 'Previous Month', // to be translated
nextMonth: 'Next Month', // to be translated
prevYear: '지난해',
nextYear: '다음해',
prevMonth: '지난달',
nextMonth: '다음달',
year: '년',
month1: '1월',
month2: '2월',
@@ -82,7 +82,7 @@ export default {
error: '올바르지 않은 입력'
},
upload: {
deleteTip: 'press delete to remove', // to be translated
deleteTip: '클릭시 삭제됩니다',
delete: '삭제',
preview: '미리보기',
continue: '계속하기'

109
src/locale/lang/lt.js Normal file
View File

@@ -0,0 +1,109 @@
export default {
el: {
colorpicker: {
confirm: 'OK',
clear: 'Valyti'
},
datepicker: {
now: 'Dabar',
today: 'Šiandien',
cancel: 'Atšaukti',
clear: 'Vakyti',
confirm: 'OK',
selectDate: 'Pasirink datą',
selectTime: 'Pasirink laiką',
startDate: 'Data nuo',
startTime: 'Laikas nuo',
endDate: 'Data iki',
endTime: 'Laikas iki',
prevYear: 'Metai atgal',
nextYear: 'Metai į priekį',
prevMonth: 'Mėn. atgal',
nextMonth: 'Mėn. į priekį',
year: '',
month1: 'Sausis',
month2: 'Vasaris',
month3: 'Kovas',
month4: 'Balandis',
month5: 'Gegužė',
month6: 'Birželis',
month7: 'Liepa',
month8: 'Rugpjūtis',
month9: 'Rugsėjis',
month10: 'Spalis',
month11: 'Lapkritis',
month12: 'Gruodis',
// week: 'savaitė',
weeks: {
sun: 'S.',
mon: 'Pr.',
tue: 'A.',
wed: 'T.',
thu: 'K.',
fri: 'Pn.',
sat: 'Š.'
},
months: {
jan: 'Sau',
feb: 'Vas',
mar: 'Kov',
apr: 'Bal',
may: 'Geg',
jun: 'Bir',
jul: 'Lie',
aug: 'Rugp',
sep: 'Rugs',
oct: 'Spa',
nov: 'Lap',
dec: 'Gruo'
}
},
select: {
loading: 'Kraunasi',
noMatch: 'Duomenų nerasta',
noData: 'Nėra duomenų',
placeholder: 'Pasirink'
},
cascader: {
noMatch: 'Duomenų nerasta',
loading: 'Kraunasi',
placeholder: 'Pasirink'
},
pagination: {
goto: 'Eiti į',
pagesize: '/p',
total: 'Viso {total}',
pageClassifier: ''
},
messagebox: {
title: 'Žinutė',
confirm: 'OK',
cancel: 'Atšaukti',
error: 'Klaida įvestuose duomenyse'
},
upload: {
deleteTip: 'spauskite "Trinti" norėdami pašalinti',
delete: 'Trinti',
preview: 'Peržiūrėti',
continue: 'Toliau'
},
table: {
emptyText: 'Duomenų nerasta',
confirmFilter: 'Patvirtinti',
resetFilter: 'Atstatyti',
clearFilter: 'Išvalyti',
sumText: 'Suma'
},
tree: {
emptyText: 'Nėra duomenų'
},
transfer: {
noMatch: 'Duomenų nerasta',
noData: 'Nėra duomenų',
titles: ['Sąrašas 1', 'Sąrašas 2'],
filterPlaceholder: 'Įvesk raktažodį',
noCheckedFormat: 'Viso: {total}',
hasCheckedFormat: 'Pažymėta {checked} iš {total}'
}
}
};

View File

@@ -2,7 +2,7 @@ export default {
el: {
colorpicker: {
confirm: 'Bevestig',
clear: 'Legen'
clear: 'Wissen'
},
datepicker: {
now: 'Nu',
@@ -16,10 +16,10 @@ export default {
startTime: 'Starttijd',
endDate: 'Einddatum',
endTime: 'Eindtijd',
prevYear: 'Previous Year', // to be translated
nextYear: 'Next Year', // to be translated
prevMonth: 'Previous Month', // to be translated
nextMonth: 'Next Month', // to be translated
prevYear: 'Vorig jaar',
nextYear: 'Volgend jaar',
prevMonth: 'Vorige maand',
nextMonth: 'Volgende maand',
year: '',
month1: 'januari',
month2: 'februari',
@@ -71,7 +71,7 @@ export default {
},
pagination: {
goto: 'Ga naar',
pagesize: '/page',
pagesize: '/pagina',
total: 'Totaal {total}',
pageClassifier: ''
},
@@ -82,7 +82,7 @@ export default {
error: 'Ongeldige invoer'
},
upload: {
deleteTip: 'press delete to remove', // to be translated
deleteTip: 'Kies verwijder om te wissen',
delete: 'Verwijder',
preview: 'Voorbeeld',
continue: 'Doorgaan'
@@ -92,7 +92,7 @@ export default {
confirmFilter: 'Bevestigen',
resetFilter: 'Reset',
clearFilter: 'Alles',
sumText: 'Sum' // to be translated
sumText: 'Som'
},
tree: {
emptyText: 'Geen data'
@@ -100,10 +100,10 @@ export default {
transfer: {
noMatch: 'Geen overeenkomende resultaten',
noData: 'Geen data',
titles: ['List 1', 'List 2'], // to be translated
filterPlaceholder: 'Enter keyword', // to be translated
noCheckedFormat: '{total} items', // to be translated
hasCheckedFormat: '{checked}/{total} checked' // to be translated
titles: ['Lijst 1', 'Lijst 2'],
filterPlaceholder: 'Geef zoekwoerd',
noCheckedFormat: '{total} items',
hasCheckedFormat: '{checked}/{total} geselecteerd'
}
}
};

View File

@@ -12,6 +12,30 @@ let seed = 0;
!Vue.prototype.$isServer && on(document, 'mouseup', e => {
nodeList.forEach(node => node[ctx].documentHandler(e, startClick));
});
function createDocumentHandler(el, binding, vnode) {
return function(mouseup = {}, mousedown = {}) {
if (!vnode ||
!vnode.context ||
!mouseup.target ||
!mousedown.target ||
el.contains(mouseup.target) ||
el.contains(mousedown.target) ||
el === mouseup.target ||
(vnode.context.popperElm &&
(vnode.context.popperElm.contains(mouseup.target) ||
vnode.context.popperElm.contains(mousedown.target)))) return;
if (binding.expression &&
el[ctx].methodName &&
vnode.context[el[ctx].methodName]) {
vnode.context[el[ctx].methodName]();
} else {
el[ctx].bindingFn && el[ctx].bindingFn();
}
};
}
/**
* v-clickoutside
* @desc 点击元素外面才会触发的事件
@@ -24,34 +48,16 @@ export default {
bind(el, binding, vnode) {
nodeList.push(el);
const id = seed++;
const documentHandler = function(mouseup = {}, mousedown = {}) {
if (!vnode.context ||
!mouseup.target ||
!mousedown.target ||
el.contains(mouseup.target) ||
el.contains(mousedown.target) ||
el === mouseup.target ||
(vnode.context.popperElm &&
(vnode.context.popperElm.contains(mouseup.target) ||
vnode.context.popperElm.contains(mousedown.target)))) return;
if (binding.expression &&
el[ctx].methodName &&
vnode.context[el[ctx].methodName]) {
vnode.context[el[ctx].methodName]();
} else {
el[ctx].bindingFn && el[ctx].bindingFn();
}
};
el[ctx] = {
id,
documentHandler,
documentHandler: createDocumentHandler(el, binding, vnode),
methodName: binding.expression,
bindingFn: binding.value
};
},
update(el, binding) {
update(el, binding, vnode) {
el[ctx].documentHandler = createDocumentHandler(el, binding, vnode);
el[ctx].methodName = binding.expression;
el[ctx].bindingFn = binding.value;
},
@@ -65,5 +71,6 @@ export default {
break;
}
}
delete el[ctx];
}
};

View File

@@ -909,6 +909,7 @@
var len = isVertical ? 'height' : 'width';
var side = isVertical ? 'top' : 'left';
var translate = isVertical ? 'translateY' : 'translateX';
var altSide = isVertical ? 'left' : 'top';
var opSide = isVertical ? 'bottom' : 'right';
var arrowSize = getOuterSizes(arrow)[len];
@@ -932,7 +933,7 @@
var sideValue = center - popper[side];
// prevent arrow from being placed not contiguously to its popper
sideValue = Math.max(Math.min(popper[len] - arrowSize - 3, sideValue), 3);
sideValue = Math.max(Math.min(popper[len] - arrowSize - 8, sideValue), 8);
arrowStyle[side] = sideValue;
arrowStyle[altSide] = ''; // make sure to remove any old style from the arrow

View File

@@ -99,15 +99,30 @@ describe('MessageBox', () => {
inputErrorMessage: 'validation failed'
});
setTimeout(() => {
expect(document.querySelector('.el-message-box__input')).to.exist;
const messageBox = document.querySelector('.el-message-box__wrapper').__vue__.$parent;
expect(messageBox.$el.querySelector('.el-message-box__input')).to.exist;
const haveFocus = messageBox.$el.querySelector('input').isSameNode(document.activeElement);
expect(haveFocus).to.true;
messageBox.inputValue = 'no';
setTimeout(() => {
expect(document.querySelector('.el-message-box__errormsg')
expect(messageBox.$el.querySelector('.el-message-box__errormsg')
.textContent).to.equal('validation failed');
done();
}, 100);
}, 200);
}, 700);
});
it('prompt: focus on textarea', done => {
MessageBox.prompt('这是一段内容', {
inputType: 'textarea',
title: '标题名称'
});
setTimeout(() => {
const messageBox = document.querySelector('.el-message-box__wrapper').__vue__.$parent;
const haveFocus = messageBox.$el.querySelector('textarea').isSameNode(document.activeElement);
expect(haveFocus).to.true;
done();
}, 700);
});
describe('custom validator', () => {

View File

@@ -223,20 +223,24 @@ describe('Pagination', () => {
};
changeValue(1);
setTimeout(() => {
expect(vm.page).to.equal(1);
changeValue(10000);
expect(input.value).to.equal(1);
// 多次输入不在min-max区间内的数字
changeValue(0);
setTimeout(() => {
expect(vm.page).to.equal(10);
changeValue('我好帅');
expect(input.value).to.equal(1);
changeValue(0);
setTimeout(() => {
expect(vm.page).to.equal(1);
done();
expect(input.value).to.equal(1);
changeValue(1000);
setTimeout(() => {
expect(input.value).to.equal(10);
changeValue(1000);
setTimeout(() => {
expect(input.value).to.equal(10);
done();
}, 50);
}, 50);
}, 50);
}, 50);
}, 50);

286
types/element-ui.d.ts vendored Normal file
View File

@@ -0,0 +1,286 @@
import Vue from 'vue'
import { ElementUIComponent, ElementUIComponentSize, ElementUIHorizontalAlignment } from './component'
import { ElAlert } from './alert'
import { ElAside } from './aside'
import { ElAutocomplete } from './autocomplete'
import { ElBadge } from './badge'
import { ElBreadcrumb } from './breadcrumb'
import { ElBreadcrumbItem } from './breadcrumb-item'
import { ElButton } from './button'
import { ElButtonGroup } from './button-group'
import { ElCard } from './card'
import { ElCarousel } from './carousel'
import { ElCarouselItem } from './carousel-item'
import { ElCascader } from './cascader'
import { ElCheckbox } from './checkbox'
import { ElCheckboxGroup } from './checkbox-group'
import { ElCol } from './col'
import { ElCollapse } from './collapse'
import { ElCollapseItem } from './collapse-item'
import { ElColorPicker } from './color-picker'
import { ElContainer } from './container'
import { ElDatePicker } from './date-picker'
import { ElDialog } from './dialog'
import { ElDropdown } from './dropdown'
import { ElDropdownItem } from './dropdown-item'
import { ElDropdownMenu } from './dropdown-menu'
import { ElFooter } from './footer'
import { ElForm } from './form'
import { ElFormItem } from './form-item'
import { ElHeader } from './header'
import { ElInput } from './input'
import { ElInputNumber } from './input-number'
import { ElLoading } from './loading'
import { ElMain } from './main'
import { ElMenu } from './menu'
import { ElMenuItem } from './menu-item'
import { ElMenuItemGroup } from './menu-item-group'
import { ElMessage } from './message'
import { ElMessageBox } from './message-box'
import { ElNotification } from './notification'
import { ElOption } from './option'
import { ElOptionGroup } from './option-group'
import { ElPagination } from './pagination'
import { ElPopover } from './popover'
import { ElProgress } from './progress'
import { ElRate } from './rate'
import { ElRadio } from './radio'
import { ElRadioButton } from './radio-button'
import { ElRadioGroup } from './radio-group'
import { ElRow } from './row'
import { ElSelect } from './select'
import { ElSlider } from './slider'
import { ElStep } from './step'
import { ElSteps } from './steps'
import { ElSubmenu } from './submenu'
import { ElSwitch } from './switch'
import { ElTable } from './table'
import { ElTableColumn } from './table-column'
import { ElTag } from './tag'
import { ElTabs } from './tabs'
import { ElTabPane } from './tab-pane'
import { ElTimePicker } from './time-picker'
import { ElTooltip } from './tooltip'
import { ElTransfer } from './transfer'
import { ElTree } from './tree'
import { ElUpload } from './upload'
export interface InstallationOptions {
locale: any,
i18n: any,
size: string
}
/** The version of element-ui */
export const version: string
/**
* Install all element-ui components into Vue.
* Please do not invoke this method directly.
* Call `Vue.use(ElementUI)` to install.
*/
export function install (vue: typeof Vue, options: InstallationOptions): void
/** ElementUI component common definition */
export type Component = ElementUIComponent
/** Component size definition for button, input, etc */
export type ComponentSize = ElementUIComponentSize
/** Horizontal alignment */
export type HorizontalAlignment = ElementUIHorizontalAlignment
/** Show animation while loading data */
export const Loading: ElLoading
/** Used to show feedback after an activity. The difference with Notification is that the latter is often used to show a system level passive notification. */
export const Message: ElMessage
/** A set of modal boxes simulating system message box, mainly for message prompt, success tips, error messages and query information */
export const MessageBox: ElMessageBox
/** Displays a global notification message at the upper right corner of the page */
export const Notification: ElNotification
// TS cannot merge imported class with namespace, so declare subclasses instead
/** Alert Component */
export class Alert extends ElAlert {}
/** Aside Component */
export class Aside extends ElAside {}
/** Autocomplete Component */
export class Autocomplete extends ElAutocomplete {}
/** Bagde Component */
export class Badge extends ElBadge {}
/** Breadcrumb Component */
export class Breadcrumb extends ElBreadcrumb {}
/** Breadcrumb Item Component */
export class BreadcrumbItem extends ElBreadcrumbItem {}
/** Button Component */
export class Button extends ElButton {}
/** Button Group Component */
export class ButtonGroup extends ElButtonGroup {}
/** Card Component */
export class Card extends ElCard {}
/** Cascader Component */
export class Cascader extends ElCascader {}
/** Carousel Component */
export class Carousel extends ElCarousel {}
/** Carousel Item Component */
export class CarouselItem extends ElCarouselItem {}
/** Checkbox Component */
export class Checkbox extends ElCheckbox {}
/** Checkbox Group Component */
export class CheckboxGroup extends ElCheckboxGroup {}
/** Colunm Layout Component */
export class Col extends ElCol {}
/** Collapse Component */
export class Collapse extends ElCollapse {}
/** Collapse Item Component */
export class CollapseItem extends ElCollapseItem {}
/** Color Picker Component */
export class ColorPicker extends ElColorPicker {}
/** Container Component */
export class Container extends ElContainer {}
/** Date Picker Component */
export class DatePicker extends ElDatePicker {}
/** Dialog Component */
export class Dialog extends ElDialog {}
/** Dropdown Component */
export class Dropdown extends ElDropdown {}
/** Dropdown Item Component */
export class DropdownItem extends ElDropdownItem {}
/** Dropdown Menu Component */
export class DropdownMenu extends ElDropdownMenu {}
/** Footer Component */
export class Footer extends ElFooter {}
/** Form Component */
export class Form extends ElForm {}
/** Form Item Component */
export class FormItem extends ElFormItem {}
/** Header Component */
export class Header extends ElHeader {}
/** Input Component */
export class Input extends ElInput {}
/** Input Number Component */
export class InputNumber extends ElInputNumber {}
/** Main Component */
export class Main extends ElMain {}
/** Menu that provides navigation for your website */
export class Menu extends ElMenu {}
/** Menu Item Component */
export class MenuItem extends ElMenuItem {}
/** Menu Item Group Component */
export class MenuItemGroup extends ElMenuItemGroup {}
/** Dropdown Select Option Component */
export class Option extends ElOption {}
/** Dropdown Select Option Group Component */
export class OptionGroup extends ElOptionGroup {}
/** Pagination Component */
export class Pagination extends ElPagination {}
/** Popover Component */
export class Popover extends ElPopover {}
/** Progress Component */
export class Progress extends ElProgress {}
/** Rate Component */
export class Rate extends ElRate {}
/** Radio Component */
export class Radio extends ElRadio {}
/** Radio Button Component */
export class RadioButton extends ElRadioButton {}
/** Radio Group Component */
export class RadioGroup extends ElRadioGroup {}
/** Row Layout Component */
export class Row extends ElRow {}
/** Dropdown Select Component */
export class Select extends ElSelect {}
/** Slider Component */
export class Slider extends ElSlider {}
/** Step Component */
export class Step extends ElStep {}
/** Steps Component */
export class Steps extends ElSteps {}
/** Submenu Component */
export class Submenu extends ElSubmenu {}
/** Switch Component */
export class Switch extends ElSwitch {}
/** Table Component */
export class Table extends ElTable {}
/** Table Column Component */
export class TableColumn extends ElTableColumn {}
/** Tabs Component */
export class Tabs extends ElTabs {}
/** Tab Pane Component */
export class TabPane extends ElTabPane {}
/** Tag Component */
export class Tag extends ElTag {}
/** Time Picker and Time Select Component */
export class TimePicker extends ElTimePicker {}
/** Tooltip Component */
export class Tooltip extends ElTooltip {}
/** Transfer Component */
export class Transfer extends ElTransfer {}
/** Tree Component */
export class Tree extends ElTree {}
/** Upload Component */
export class Upload extends ElUpload {}

286
types/index.d.ts vendored
View File

@@ -1,286 +1,4 @@
import Vue from 'vue'
import { ElementUIComponent, ElementUIComponentSize, ElementUIHorizontalAlignment } from './component'
import { ElAlert } from './alert'
import { ElAside } from './aside'
import { ElAutocomplete } from './autocomplete'
import { ElBadge } from './badge'
import { ElBreadcrumb } from './breadcrumb'
import { ElBreadcrumbItem } from './breadcrumb-item'
import { ElButton } from './button'
import { ElButtonGroup } from './button-group'
import { ElCard } from './card'
import { ElCarousel } from './carousel'
import { ElCarouselItem } from './carousel-item'
import { ElCascader } from './cascader'
import { ElCheckbox } from './checkbox'
import { ElCheckboxGroup } from './checkbox-group'
import { ElCol } from './col'
import { ElCollapse } from './collapse'
import { ElCollapseItem } from './collapse-item'
import { ElColorPicker } from './color-picker'
import { ElContainer } from './container'
import { ElDatePicker } from './date-picker'
import { ElDialog } from './dialog'
import { ElDropdown } from './dropdown'
import { ElDropdownItem } from './dropdown-item'
import { ElDropdownMenu } from './dropdown-menu'
import { ElFooter } from './footer'
import { ElForm } from './form'
import { ElFormItem } from './form-item'
import { ElHeader } from './header'
import { ElInput } from './input'
import { ElInputNumber } from './input-number'
import { ElLoading } from './loading'
import { ElMain } from './main'
import { ElMenu } from './menu'
import { ElMenuItem } from './menu-item'
import { ElMenuItemGroup } from './menu-item-group'
import { ElMessage } from './message'
import { ElMessageBox } from './message-box'
import { ElNotification } from './notification'
import { ElOption } from './option'
import { ElOptionGroup } from './option-group'
import { ElPagination } from './pagination'
import { ElPopover } from './popover'
import { ElProgress } from './progress'
import { ElRate } from './rate'
import { ElRadio } from './radio'
import { ElRadioButton } from './radio-button'
import { ElRadioGroup } from './radio-group'
import { ElRow } from './row'
import { ElSelect } from './select'
import { ElSlider } from './slider'
import { ElStep } from './step'
import { ElSteps } from './steps'
import { ElSubmenu } from './submenu'
import { ElSwitch } from './switch'
import { ElTable } from './table'
import { ElTableColumn } from './table-column'
import { ElTag } from './tag'
import { ElTabs } from './tabs'
import { ElTabPane } from './tab-pane'
import { ElTimePicker } from './time-picker'
import { ElTooltip } from './tooltip'
import { ElTransfer } from './transfer'
import { ElTree } from './tree'
import { ElUpload } from './upload'
declare namespace ElementUI {
export interface InstallationOptions {
locale: any,
i18n: any
}
/**
* Install all element-ui components into Vue.
* Please do not invoke this method directly.
* Call `Vue.use(ElementUI)` to install.
*/
export function install (vue: typeof Vue, options: ElementUI.InstallationOptions): void
/** ElementUI component common definition */
export type Component = ElementUIComponent
/** Component size definition for button, input, etc */
export type ComponentSize = ElementUIComponentSize
/** Horizontal alignment */
export type HorizontalAlignment = ElementUIHorizontalAlignment
/** Show animation while loading data */
export const Loading: ElLoading
/** Used to show feedback after an activity. The difference with Notification is that the latter is often used to show a system level passive notification. */
export const Message: ElMessage
/** A set of modal boxes simulating system message box, mainly for message prompt, success tips, error messages and query information */
export const MessageBox: ElMessageBox
/** Displays a global notification message at the upper right corner of the page */
export const Notification: ElNotification
// TS cannot merge imported class with namespace, so declare subclasses instead
/** Alert Component */
export class Alert extends ElAlert {}
/** Aside Component */
export class Aside extends ElAside {}
/** Autocomplete Component */
export class Autocomplete extends ElAutocomplete {}
/** Bagde Component */
export class Badge extends ElBadge {}
/** Breadcrumb Component */
export class Breadcrumb extends ElBreadcrumb {}
/** Breadcrumb Item Component */
export class BreadcrumbItem extends ElBreadcrumbItem {}
/** Button Component */
export class Button extends ElButton {}
/** Button Group Component */
export class ButtonGroup extends ElButtonGroup {}
/** Card Component */
export class Card extends ElCard {}
/** Cascader Component */
export class Cascader extends ElCascader {}
/** Carousel Component */
export class Carousel extends ElCarousel {}
/** Carousel Item Component */
export class CarouselItem extends ElCarouselItem {}
/** Checkbox Component */
export class Checkbox extends ElCheckbox {}
/** Checkbox Group Component */
export class CheckboxGroup extends ElCheckboxGroup {}
/** Colunm Layout Component */
export class Col extends ElCol {}
/** Collapse Component */
export class Collapse extends ElCollapse {}
/** Collapse Item Component */
export class CollapseItem extends ElCollapseItem {}
/** Color Picker Component */
export class ColorPicker extends ElColorPicker {}
/** Container Component */
export class Container extends ElContainer {}
/** Date Picker Component */
export class DatePicker extends ElDatePicker {}
/** Dialog Component */
export class Dialog extends ElDialog {}
/** Dropdown Component */
export class Dropdown extends ElDropdown {}
/** Dropdown Item Component */
export class DropdownItem extends ElDropdownItem {}
/** Dropdown Menu Component */
export class DropdownMenu extends ElDropdownMenu {}
/** Footer Component */
export class Footer extends ElFooter {}
/** Form Component */
export class Form extends ElForm {}
/** Form Item Component */
export class FormItem extends ElFormItem {}
/** Header Component */
export class Header extends ElHeader {}
/** Input Component */
export class Input extends ElInput {}
/** Input Number Component */
export class InputNumber extends ElInputNumber {}
/** Main Component */
export class Main extends ElMain {}
/** Menu that provides navigation for your website */
export class Menu extends ElMenu {}
/** Menu Item Component */
export class MenuItem extends ElMenuItem {}
/** Menu Item Group Component */
export class MenuItemGroup extends ElMenuItemGroup {}
/** Dropdown Select Option Component */
export class Option extends ElOption {}
/** Dropdown Select Option Group Component */
export class OptionGroup extends ElOptionGroup {}
/** Pagination Component */
export class Pagination extends ElPagination {}
/** Popover Component */
export class Popover extends ElPopover {}
/** Progress Component */
export class Progress extends ElProgress {}
/** Rate Component */
export class Rate extends ElRate {}
/** Radio Component */
export class Radio extends ElRadio {}
/** Radio Button Component */
export class RadioButton extends ElRadioButton {}
/** Radio Group Component */
export class RadioGroup extends ElRadioGroup {}
/** Row Layout Component */
export class Row extends ElRow {}
/** Dropdown Select Component */
export class Select extends ElSelect {}
/** Slider Component */
export class Slider extends ElSlider {}
/** Step Component */
export class Step extends ElStep {}
/** Steps Component */
export class Steps extends ElSteps {}
/** Submenu Component */
export class Submenu extends ElSubmenu {}
/** Switch Component */
export class Switch extends ElSwitch {}
/** Table Component */
export class Table extends ElTable {}
/** Table Column Component */
export class TableColumn extends ElTableColumn {}
/** Tabs Component */
export class Tabs extends ElTabs {}
/** Tab Pane Component */
export class TabPane extends ElTabPane {}
/** Tag Component */
export class Tag extends ElTag {}
/** Time Picker and Time Select Component */
export class TimePicker extends ElTimePicker {}
/** Tooltip Component */
export class Tooltip extends ElTooltip {}
/** Transfer Component */
export class Transfer extends ElTransfer {}
/** Tree Component */
export class Tree extends ElTree {}
/** Upload Component */
export class Upload extends ElUpload {}
}
export * from './element-ui'
import * as ElementUI from './element-ui'
export default ElementUI

View File

@@ -1302,6 +1302,13 @@ cli-width@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a"
cli@~1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/cli/-/cli-1.0.1.tgz#22817534f24bfa4950c34d532d48ecbc621b8c14"
dependencies:
exit "0.1.2"
glob "^7.1.1"
cliui@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1"
@@ -1366,13 +1373,7 @@ collections@^0.2.0:
dependencies:
weak-map "1.0.0"
color-convert@^1.3.0:
version "1.8.2"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.8.2.tgz#be868184d7c8631766d54e7078e2672d7c7e3339"
dependencies:
color-name "^1.1.1"
color-convert@^1.9.0:
color-convert@^1.3.0, color-convert@^1.9.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a"
dependencies:
@@ -1505,7 +1506,7 @@ connect@^3.3.5:
parseurl "~1.3.1"
utils-merge "1.0.0"
console-browserify@^1.1.0:
console-browserify@1.1.x, console-browserify@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10"
dependencies:
@@ -2395,6 +2396,12 @@ eslint-plugin-html@*, eslint-plugin-html@^1.5.2:
dependencies:
htmlparser2 "^3.8.2"
eslint-plugin-json@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-json/-/eslint-plugin-json-1.2.0.tgz#9ba73bb0be99d50093e889f5b968463d2a30efae"
dependencies:
jshint "^2.8.0"
eslint-plugin-react@*, eslint-plugin-react@^6.2.0:
version "6.8.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.8.0.tgz#741ab5438a094532e5ce1bbb935d6832356f492d"
@@ -2548,6 +2555,10 @@ exit-hook@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8"
exit@0.1.2, exit@0.1.x:
version "0.1.2"
resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
expand-braces@^0.1.1:
version "0.1.2"
resolved "https://registry.yarnpkg.com/expand-braces/-/expand-braces-0.1.2.tgz#488b1d1d2451cb3d3a6b192cfc030f44c5855fea"
@@ -3572,7 +3583,7 @@ html-webpack-plugin@^2.30.1:
pretty-error "^2.0.2"
toposort "^1.0.0"
htmlparser2@^3.8.2, htmlparser2@~3.8.1:
htmlparser2@3.8.x, htmlparser2@^3.8.2, htmlparser2@~3.8.1:
version "3.8.3"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.8.3.tgz#996c28b191516a8be86501a7d79757e5c70c1068"
dependencies:
@@ -4149,6 +4160,19 @@ jsesc@~0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
jshint@^2.8.0:
version "2.9.5"
resolved "https://registry.yarnpkg.com/jshint/-/jshint-2.9.5.tgz#1e7252915ce681b40827ee14248c46d34e9aa62c"
dependencies:
cli "~1.0.0"
console-browserify "1.1.x"
exit "0.1.x"
htmlparser2 "3.8.x"
lodash "3.7.x"
minimatch "~3.0.2"
shelljs "0.3.x"
strip-json-comments "1.0.x"
json-loader@^0.5.4, json-loader@^0.5.7:
version "0.5.7"
resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d"
@@ -4724,6 +4748,10 @@ lodash.values@~2.4.1:
dependencies:
lodash.keys "~2.4.1"
lodash@3.7.x:
version "3.7.0"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.7.0.tgz#3678bd8ab995057c07ade836ed2ef087da811d45"
lodash@^3.8.0:
version "3.10.1"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
@@ -7014,6 +7042,10 @@ shebang-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
shelljs@0.3.x:
version "0.3.0"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.3.0.tgz#3596e6307a781544f591f37da618360f31db57b1"
shelljs@^0.7.0, shelljs@^0.7.4, shelljs@^0.7.5:
version "0.7.5"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.5.tgz#2eef7a50a21e1ccf37da00df767ec69e30ad0675"
@@ -7358,7 +7390,7 @@ strip-indent@^1.0.1:
dependencies:
get-stdin "^4.0.1"
strip-json-comments@~1.0.1, strip-json-comments@~1.0.4:
strip-json-comments@1.0.x, strip-json-comments@~1.0.1, strip-json-comments@~1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91"