mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-16 11:44:01 +08:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41f7b0434d | ||
|
|
23b855e5bb | ||
|
|
9cda236bc8 | ||
|
|
3f196a63d1 | ||
|
|
3a23ab7b01 | ||
|
|
9bad910664 | ||
|
|
b8edd0be14 | ||
|
|
a6067defa7 | ||
|
|
c4ed89f32d | ||
|
|
a755fd98a3 | ||
|
|
4508f2a6c4 | ||
|
|
9b6a21073b | ||
|
|
b53dcd1766 | ||
|
|
2a745aa8bf |
@@ -1,5 +1,19 @@
|
||||
## Changelog
|
||||
|
||||
### 1.4.10
|
||||
|
||||
*2017-11-14*
|
||||
|
||||
- Fixed missing Tooltip registration in Menu, #7996
|
||||
- Fixed console error of `clientHeight` when `disabled` of Select dynamically updates, #8018 (by @wubaiqing)
|
||||
|
||||
### 1.4.9
|
||||
|
||||
*2017-11-01*
|
||||
|
||||
- Fixed Form validating not triggered correctly in some conditions, #7744
|
||||
- Fixed range selection of DatePicker not working in Chromium 53-57 browsers, #7927
|
||||
|
||||
### 1.4.8
|
||||
|
||||
*2017-10-24*
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
## 更新日志
|
||||
|
||||
### 1.4.10
|
||||
*2017-11-14*
|
||||
|
||||
- 修复单独引入 Menu 时找不到 Tooltip 的问题,#7996
|
||||
- 修复 Select 的 `disabled` 属性变化时控制台关于 `clientHeight` 报错的问题,#8018(by @wubaiqing)
|
||||
|
||||
### 1.4.9
|
||||
*2017-11-01*
|
||||
|
||||
- 修复某些情况下 Form 验证没有正确触发的问题,#7744
|
||||
- 修复 DatePicker 的范围选择在内核为 Chromium 53-57 的浏览器中无法使用的问题,#7927
|
||||
|
||||
### 1.4.8
|
||||
*2017-10-24*
|
||||
|
||||
|
||||
@@ -44,9 +44,7 @@ if [ "$TRAVIS_TAG" ]; then
|
||||
|
||||
SUB_FOLDER='1.4'
|
||||
mkdir $SUB_FOLDER
|
||||
rm -rf *.js *.css *.map static
|
||||
rm -rf $SUB_FOLDER/**
|
||||
cp -rf ../../examples/element-ui/** .
|
||||
cp -rf ../../examples/element-ui/** $SUB_FOLDER/
|
||||
git add -A .
|
||||
git commit -m "$TRAVIS_COMMIT_MSG"
|
||||
|
||||
@@ -8,9 +8,7 @@ git clone -b gh-pages https://github.com/ElemeFE/element.git && cd element
|
||||
SUB_FOLDER='1.4'
|
||||
mkdir $SUB_FOLDER
|
||||
|
||||
rm -rf *.js *.css *.map static
|
||||
rm -rf $SUB_FOLDER/**
|
||||
cp -rf ../../examples/element-ui/** .
|
||||
cp -rf ../../examples/element-ui/** $SUB_FOLDER/
|
||||
cd ../..
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
git checkout dev
|
||||
git checkout 1.x
|
||||
|
||||
if test -n "$(git status --porcelain)"; then
|
||||
echo 'Unclean working tree. Commit or stash changes first.' >&2;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
git checkout master
|
||||
git merge dev
|
||||
|
||||
#!/usr/bin/env sh
|
||||
set -e
|
||||
echo "Enter release version: "
|
||||
@@ -19,11 +16,7 @@ then
|
||||
echo "Releasing theme-default $VERSION ..."
|
||||
cd packages/theme-default
|
||||
npm version $VERSION --message "[release] $VERSION"
|
||||
if [[ $VERSION =~ "beta" ]]
|
||||
then
|
||||
npm publish --tag beta
|
||||
else
|
||||
npm publish
|
||||
npm publish
|
||||
fi
|
||||
cd ../..
|
||||
|
||||
@@ -33,16 +26,8 @@ then
|
||||
npm version $VERSION --message "[release] $VERSION"
|
||||
|
||||
# publish
|
||||
git push eleme master
|
||||
git push eleme 1.x
|
||||
git push eleme refs/tags/v$VERSION
|
||||
git checkout dev
|
||||
git rebase master
|
||||
git push eleme dev
|
||||
|
||||
if [[ $VERSION =~ "beta" ]]
|
||||
then
|
||||
npm publish --tag beta
|
||||
else
|
||||
npm publish
|
||||
fi
|
||||
npm publish --tag legacy
|
||||
fi
|
||||
|
||||
@@ -259,11 +259,7 @@
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange = _ => {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
const versions = JSON.parse(xhr.responseText);
|
||||
this.versions = Object.keys(versions).slice(-2).reduce((prev, next) => {
|
||||
prev[next] = versions[next];
|
||||
return prev;
|
||||
}, {});
|
||||
this.versions = JSON.parse(xhr.responseText);
|
||||
}
|
||||
};
|
||||
xhr.open('GET', '/versions.json');
|
||||
|
||||
@@ -145,8 +145,8 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
|
||||
|
||||
```html
|
||||
<script src="//unpkg.com/vue"></script>
|
||||
<script src="//unpkg.com/element-ui"></script>
|
||||
<script src="//unpkg.com/element-ui/lib/umd/locale/en.js"></script>
|
||||
<script src="//unpkg.com/element-ui@1.4"></script>
|
||||
<script src="//unpkg.com/element-ui@1.4/lib/umd/locale/en.js"></script>
|
||||
|
||||
<script>
|
||||
ELEMENT.locale(ELEMENT.lang.en)
|
||||
@@ -158,9 +158,9 @@ Compatible with `vue-i18n`
|
||||
```html
|
||||
<script src="//unpkg.com/vue"></script>
|
||||
<script src="//unpkg.com/vue-i18n/dist/vue-i18n.js"></script>
|
||||
<script src="//unpkg.com/element-ui"></script>
|
||||
<script src="//unpkg.com/element-ui/lib/umd/locale/zh-CN.js"></script>
|
||||
<script src="//unpkg.com/element-ui/lib/umd/locale/en.js"></script>
|
||||
<script src="//unpkg.com/element-ui@1.4"></script>
|
||||
<script src="//unpkg.com/element-ui@1.4/lib/umd/locale/zh-CN.js"></script>
|
||||
<script src="//unpkg.com/element-ui@1.4/lib/umd/locale/en.js"></script>
|
||||
|
||||
<script>
|
||||
Vue.locale('en', ELEMENT.lang.en)
|
||||
|
||||
@@ -3,22 +3,30 @@
|
||||
### npm
|
||||
Installing with npm is recommended and it works seamlessly with [webpack](https://webpack.js.org/).
|
||||
|
||||
:::tip
|
||||
Note that this doc is for 1.x, so you need the `legacy` tag when installing.
|
||||
:::
|
||||
|
||||
```shell
|
||||
npm i element-ui -S
|
||||
npm i element-ui@legacy -S
|
||||
```
|
||||
|
||||
### CDN
|
||||
Get the latest version from [unpkg.com/element-ui](https://unpkg.com/element-ui/) , and import JavaScript and CSS file in your page.
|
||||
Get the latest version from [unpkg.com/element-ui](https://unpkg.com/element-ui@1.4/) , and import JavaScript and CSS file in your page.
|
||||
|
||||
```html
|
||||
<!-- import CSS -->
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui@1.4/lib/theme-default/index.css">
|
||||
<!-- import JavaScript -->
|
||||
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||
<script src="https://unpkg.com/element-ui@1.4/lib/index.js"></script>
|
||||
```
|
||||
|
||||
:::tip
|
||||
We recommend our users to lock Element's version when using CDN. For example, if you're using Element 1.4.8, you can lock CSS and JavaScript files like this: `https://unpkg.com/element-ui@1.4.8/lib/theme-default/index.css`, `https://unpkg.com/element-ui@1.4.8/lib/index.js`.
|
||||
:::
|
||||
|
||||
### Hello world
|
||||
If you are using CDN, a hello-world page is easy with Element. [Online Demo](http://codepen.io/QingWei-Li/pen/vXwJrY)
|
||||
If you are using CDN, a hello-world page is easy with Element. [Online Demo](https://jsfiddle.net/hzfpyvg6/18/)
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
@@ -26,7 +34,7 @@ If you are using CDN, a hello-world page is easy with Element. [Online Demo](htt
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<!-- import CSS -->
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui@1.4/lib/theme-default/index.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
@@ -37,9 +45,9 @@ If you are using CDN, a hello-world page is easy with Element. [Online Demo](htt
|
||||
</div>
|
||||
</body>
|
||||
<!-- import Vue before Element -->
|
||||
<script src="https://unpkg.com/vue/dist/vue.js"></script>
|
||||
<script src="https://unpkg.com/vue@2.5/dist/vue.js"></script>
|
||||
<!-- import JavaScript -->
|
||||
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||
<script src="https://unpkg.com/element-ui@1.4/lib/index.js"></script>
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
|
||||
@@ -4,7 +4,7 @@ This part walks you through the process of using Element in a webpack project.
|
||||
|
||||
### Use Starter Kit
|
||||
|
||||
We provide a general [project template](https://github.com/ElementUI/element-starter) for you. For those who are familiar with [cooking](https://github.com/ElementUI/element-cooking-starter) or [Laravel](https://github.com/ElementUI/element-in-laravel-starter), we also provide corresponding templates, and you can download and use them as well.
|
||||
We provide a general [project template](https://github.com/ElementUI/element-starter/tree/1.x) for you. For those who are familiar with [cooking](https://github.com/ElementUI/element-cooking-starter) or [Laravel](https://github.com/ElementUI/element-in-laravel-starter/tree/1.x), we also provide corresponding templates, and you can download and use them as well.
|
||||
|
||||
If you prefer not to use them, please read the following.
|
||||
|
||||
@@ -42,8 +42,8 @@ Typical configurations for these config files are:
|
||||
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
|
||||
},
|
||||
"dependencies": {
|
||||
"element-ui": "^1.0.0",
|
||||
"vue": "^2.1.6"
|
||||
"element-ui": "legacy",
|
||||
"vue": "2.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.0.0",
|
||||
|
||||
@@ -114,8 +114,8 @@ Switch is used for switching between two opposing states.
|
||||
----| ----| ----| ----|----
|
||||
disabled | whether Switch is disabled | boolean | — | false
|
||||
width | width of Switch | number | — | 58 (with text) / 46 (no text)
|
||||
on-close-icon | class name of the icon displayed when in `on` state, overrides `on-text` | string | — | —
|
||||
off-close-icon |class name of the icon displayed when in `off` state, overrides `off-text`| string | — | —
|
||||
on-icon-class | class name of the icon displayed when in `on` state, overrides `on-text` | string | — | —
|
||||
off-icon-class |class name of the icon displayed when in `off` state, overrides `off-text`| string | — | —
|
||||
on-text | text displayed when in `on` state | string | — | ON
|
||||
off-text | text displayed when in `off` state | string | — | OFF
|
||||
on-value | switch value when in `on` state | boolean / string / number | — | true
|
||||
|
||||
@@ -157,8 +157,8 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
|
||||
|
||||
```html
|
||||
<script src="//unpkg.com/vue"></script>
|
||||
<script src="//unpkg.com/element-ui"></script>
|
||||
<script src="//unpkg.com/element-ui/lib/umd/locale/en.js"></script>
|
||||
<script src="//unpkg.com/element-ui@1.4"></script>
|
||||
<script src="//unpkg.com/element-ui@1.4/lib/umd/locale/en.js"></script>
|
||||
|
||||
<script>
|
||||
ELEMENT.locale(ELEMENT.lang.en)
|
||||
@@ -170,9 +170,9 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
|
||||
```html
|
||||
<script src="//unpkg.com/vue"></script>
|
||||
<script src="//unpkg.com/vue-i18n/dist/vue-i18n.js"></script>
|
||||
<script src="//unpkg.com/element-ui"></script>
|
||||
<script src="//unpkg.com/element-ui/lib/umd/locale/zh-CN.js"></script>
|
||||
<script src="//unpkg.com/element-ui/lib/umd/locale/en.js"></script>
|
||||
<script src="//unpkg.com/element-ui@1.4"></script>
|
||||
<script src="//unpkg.com/element-ui@1.4/lib/umd/locale/zh-CN.js"></script>
|
||||
<script src="//unpkg.com/element-ui@1.4/lib/umd/locale/en.js"></script>
|
||||
|
||||
<script>
|
||||
Vue.locale('en', ELEMENT.lang.en)
|
||||
|
||||
@@ -3,22 +3,30 @@
|
||||
### npm 安装
|
||||
推荐使用 npm 的方式安装,它能更好地和 [webpack](https://webpack.js.org/) 打包工具配合使用。
|
||||
|
||||
:::tip
|
||||
注意:这里是 1.x 的文档,因此使用 npm 安装时需要添加 `legacy` 标签。
|
||||
:::
|
||||
|
||||
```shell
|
||||
npm i element-ui -S
|
||||
npm i element-ui@legacy -S
|
||||
```
|
||||
|
||||
### CDN
|
||||
目前可以通过 [unpkg.com/element-ui](https://unpkg.com/element-ui/) 获取到最新版本的资源,在页面上引入 js 和 css 文件即可开始使用。
|
||||
目前可以通过 [unpkg.com/element-ui](https://unpkg.com/element-ui@1.4/) 获取到最新版本的资源,在页面上引入 js 和 css 文件即可开始使用。
|
||||
|
||||
```html
|
||||
<!-- 引入样式 -->
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui@1.4/lib/theme-default/index.css">
|
||||
<!-- 引入组件库 -->
|
||||
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||
<script src="https://unpkg.com/element-ui@1.4/lib/index.js"></script>
|
||||
```
|
||||
|
||||
:::tip
|
||||
我们建议使用 CDN 引入 Element 的用户在链接地址上锁定版本,以免将来 Element 升级时受到非兼容性更新的影响。例如,如需锁定版本为 1.4.8,则 CSS 和 JavaScript 文件的地址分别是 `https://unpkg.com/element-ui@1.4.8/lib/theme-default/index.css` 和 `https://unpkg.com/element-ui@1.4.8/lib/index.js`。
|
||||
:::
|
||||
|
||||
### Hello world
|
||||
通过 CDN 的方式我们可以很容易地使用 Element 写出一个 Hello world 页面。[在线演示](http://codepen.io/QingWei-Li/pen/vXwJrY)
|
||||
通过 CDN 的方式我们可以很容易地使用 Element 写出一个 Hello world 页面。[在线演示](https://jsfiddle.net/hzfpyvg6/18/)
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
@@ -26,7 +34,7 @@ npm i element-ui -S
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<!-- 引入样式 -->
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui@1.4/lib/theme-default/index.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
@@ -37,9 +45,9 @@ npm i element-ui -S
|
||||
</div>
|
||||
</body>
|
||||
<!-- 先引入 Vue -->
|
||||
<script src="https://unpkg.com/vue/dist/vue.js"></script>
|
||||
<script src="https://unpkg.com/vue@2.5/dist/vue.js"></script>
|
||||
<!-- 引入组件库 -->
|
||||
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||
<script src="https://unpkg.com/element-ui@1.4/lib/index.js"></script>
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
### 使用 Starter Kit
|
||||
|
||||
我们提供了通用的[项目模板](https://github.com/ElementUI/element-starter),你可以直接使用。对于熟悉 [cooking](https://github.com/ElementUI/element-cooking-starter) 或 [Laravel](https://github.com/ElementUI/element-in-laravel-starter) 的用户,我们也准备了相应的模板,同样可以直接下载使用。
|
||||
我们提供了通用的[项目模板](https://github.com/ElementUI/element-starter/tree/1.x),你可以直接使用。对于熟悉 [cooking](https://github.com/ElementUI/element-cooking-starter) 或 [Laravel](https://github.com/ElementUI/element-in-laravel-starter/tree/1.x) 的用户,我们也准备了相应的模板,同样可以直接下载使用。
|
||||
|
||||
如果不希望使用我们提供的模板,请继续阅读。
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
|
||||
},
|
||||
"dependencies": {
|
||||
"element-ui": "^1.0.0",
|
||||
"vue": "^2.1.6"
|
||||
"element-ui": "legacy",
|
||||
"vue": "2.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.0.0",
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"1.0.9":"1.0","1.1.6":"1.1","1.2.9":"1.2","1.3.7":"1.3","1.4.8":"1.4"}
|
||||
{"1.0.9":"1.0","1.1.6":"1.1","1.2.9":"1.2","1.3.7":"1.3","1.4.10":"1.4"}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "element-ui",
|
||||
"version": "1.4.8",
|
||||
"version": "1.4.10",
|
||||
"description": "A Component Library for Vue.js.",
|
||||
"main": "lib/element-ui.common.js",
|
||||
"files": [
|
||||
|
||||
@@ -387,6 +387,13 @@
|
||||
this.onPick && this.onPick(val);
|
||||
this.maxDate = val.maxDate;
|
||||
this.minDate = val.minDate;
|
||||
|
||||
// workaround for https://github.com/ElemeFE/element/issues/7539, should remove this block when we don't have to care about Chromium 55 - 57
|
||||
setTimeout(() => {
|
||||
this.maxDate = val.maxDate;
|
||||
this.minDate = val.minDate;
|
||||
}, 10);
|
||||
|
||||
if (!close || this.showTime) return;
|
||||
this.handleConfirm();
|
||||
},
|
||||
|
||||
@@ -147,6 +147,7 @@
|
||||
},
|
||||
methods: {
|
||||
validate(trigger, callback = noop) {
|
||||
this.validateDisabled = false;
|
||||
var rules = this.getFilteredRule(trigger);
|
||||
if ((!rules || rules.length === 0) && !this._props.hasOwnProperty('required')) {
|
||||
callback();
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import Menu from './menu-mixin';
|
||||
import ElTooltip from 'element-ui/packages/tooltip';
|
||||
import Emitter from 'element-ui/src/mixins/emitter';
|
||||
|
||||
export default {
|
||||
@@ -30,6 +31,8 @@
|
||||
|
||||
componentName: 'ElMenuItem',
|
||||
|
||||
components: { ElTooltip },
|
||||
|
||||
mixins: [Menu, Emitter],
|
||||
|
||||
props: {
|
||||
|
||||
@@ -495,7 +495,10 @@
|
||||
if (!this.$refs.reference) return;
|
||||
let inputChildNodes = this.$refs.reference.$el.childNodes;
|
||||
let input = [].filter.call(inputChildNodes, item => item.tagName === 'INPUT')[0];
|
||||
input.style.height = Math.max(this.$refs.tags.clientHeight + 6, sizeMap[this.size] || 36) + 'px';
|
||||
const tags = this.$refs.tags;
|
||||
input.style.height = this.selected.length === 0
|
||||
? sizeMap[this.size] + 'px'
|
||||
: Math.max(tags ? (tags.clientHeight + 6) : 0, sizeMap[this.size] || 36) + 'px';
|
||||
if (this.visible && this.emptyText !== false) {
|
||||
this.broadcast('ElSelectDropdown', 'updatePopper');
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "element-theme-default",
|
||||
"version": "1.4.8",
|
||||
"version": "1.4.10",
|
||||
"description": "Element component default theme.",
|
||||
"main": "lib/index.css",
|
||||
"style": "lib/index.css",
|
||||
|
||||
@@ -158,7 +158,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
version: '1.4.8',
|
||||
version: '1.4.10',
|
||||
locale: locale.use,
|
||||
i18n: locale.i18n,
|
||||
install,
|
||||
|
||||
Reference in New Issue
Block a user