@@ -213,4 +213,4 @@ Currently Element ships with the following languages:
...
@@ -213,4 +213,4 @@ Currently Element ships with the following languages:
<li>Hungarian (hu)</li>
<li>Hungarian (hu)</li>
</ul>
</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.
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/dev/src/locale/lang) and create a pull request.
@@ -614,7 +614,7 @@ Enter keywords and search data from server.
...
@@ -614,7 +614,7 @@ Enter keywords and search data from server.
### Create new items
### Create new items
Create and select new items that are not included in select options
Create and select new items that are not included in select options
:::demo By using the `allow-create` attribute, users can create new items by typing in the input box. Note that for `allow-create` to work, `filterable` must be `true`.
:::demo By using the `allow-create` attribute, users can create new items by typing in the input box. Note that for `allow-create` to work, `filterable` must be `true`. This example also demonstrates `default-first-option`. When this attribute is set to `true`, you can select the first option in the current option list by hitting enter without having to navigate with mouse or arrow keys.
```html
```html
<template>
<template>
<el-select
<el-select
...
@@ -622,6 +622,7 @@ Create and select new items that are not included in select options
...
@@ -622,6 +622,7 @@ Create and select new items that are not included in select options
this.$message.warning(`You can upload up to 3 files. You selected ${files.length} files this time, and ${files.length + fileList.length} files totally`);
this.$message.warning(`You can upload up to 3 files. You selected ${files.length} files this time, and ${files.length + fileList.length} files totally`);
},
},
handleBeforeRemove(file, fileList) {
beforeRemove(file, fileList) {
return new Promise((resolve, reject) => {
return this.$confirm(`确定移除 ${ file.name }?`);
if (confirm('It looks good, are you sure to remove?')) {
resolve();
} else {
reject();
}
});
}
}
}
}
}
}
...
@@ -135,14 +129,14 @@ Upload files by clicking or drag-and-drop
...
@@ -135,14 +129,14 @@ Upload files by clicking or drag-and-drop
### Click to upload files
### Click to upload files
:::demo Customize upload button type and text using `slot`. Set `limit` and `on-exceed` to limit the maximum number of uploads allowed and specify method when the limit is exceeded. Set `before-remove` is able to abort the remove operation.
:::demo Customize upload button type and text using `slot`. Set `limit` and `on-exceed` to limit the maximum number of uploads allowed and specify method when the limit is exceeded. Plus, you can abort removing a file in the `before-remove` hook.
@@ -167,14 +161,8 @@ Upload files by clicking or drag-and-drop
...
@@ -167,14 +161,8 @@ Upload files by clicking or drag-and-drop
handleExceed(files,fileList){
handleExceed(files,fileList){
this.$message.warning(`The limit is 3, you selected ${files.length} files this time, add up to ${files.length+fileList.length} totally`);
this.$message.warning(`The limit is 3, you selected ${files.length} files this time, add up to ${files.length+fileList.length} totally`);
},
},
handleBeforeRemove(file,fileList){
beforeRemove(file,fileList){
returnnewPromise((resolve,reject)=>{
returnthis.$confirm(`确定移除 ${file.name}?`);
if(confirm('It looks good, are you sure to remove?')){
resolve();
}else{
reject();
}
});
}
}
}
}
}
}
...
@@ -429,7 +417,7 @@ on-error | hook function when some errors occurs | function(err, file, fileList)
...
@@ -429,7 +417,7 @@ on-error | hook function when some errors occurs | function(err, file, fileList)
on-progress | hook function when some progress occurs | function(event, file, fileList) | — | — |
on-progress | hook function when some progress occurs | function(event, file, fileList) | — | — |
on-change | hook function when select file or upload file success or upload file fail | function(file, fileList) | — | — |
on-change | hook function when select file or upload file success or upload file fail | function(file, fileList) | — | — |
before-upload | hook function before uploading with the file to be uploaded as its parameter. If `false` is returned or a `Promise` is returned and then is rejected, uploading will be aborted | function(file) | — | —
before-upload | hook function before uploading with the file to be uploaded as its parameter. If `false` is returned or a `Promise` is returned and then is rejected, uploading will be aborted | function(file) | — | —
before-remove | hook function before removing a file with the file and file list as its parameters. If `false` is returned or a `Promise` is returned and then is rejected, remove will be aborted. | function(file, fileList) | — | — |
before-remove | hook function before removing a file with the file and file list as its parameters. If `false` is returned or a `Promise` is returned and then is rejected, removing will be aborted. | function(file, fileList) | — | — |
@@ -213,4 +213,4 @@ Actualmente Element está disponible en los siguientes idiomas:
...
@@ -213,4 +213,4 @@ Actualmente Element está disponible en los siguientes idiomas:
<li>Hungarian (hu)</li>
<li>Hungarian (hu)</li>
</ul>
</ul>
Si su idioma de destino no está incluido, puede contribuir: simplemente añada [aqui](https://github.com/ElemeFE/element/tree/master/src/locale/lang) otra configuración de idioma y cree un pull request.
Si su idioma de destino no está incluido, puede contribuir: simplemente añada [aqui](https://github.com/ElemeFE/element/tree/dev/src/locale/lang) otra configuración de idioma y cree un pull request.