mirror of https://github.com/ElemeFE/element
commit
70c653a247
|
@ -4,6 +4,10 @@
|
||||||
|
|
||||||
*2016-XX-XX*
|
*2016-XX-XX*
|
||||||
|
|
||||||
|
- 修复 Form reset method 对日期控件不起效的问题
|
||||||
|
- 修复 Dialog 和 Message Box 在 body 无溢出时错误地添加 padding-right 的问题
|
||||||
|
- 修复 Message Box 的 prompt 在打开时会携带之前的验证状态的问题
|
||||||
|
|
||||||
#### 非兼容性更新
|
#### 非兼容性更新
|
||||||
|
|
||||||
- 全屏 Loading 现在默认不再锁定屏幕滚动。如果需要的话,可添加 `lock` 修饰符
|
- 全屏 Loading 现在默认不再锁定屏幕滚动。如果需要的话,可添加 `lock` 修饰符
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2016 element-ui
|
Copyright (c) 2016 ElemeFE
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
var Components = require('../components.json');
|
var Components = require('../components.json');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
var dependencies = require('../package.json').dependencies;
|
||||||
var externals = {};
|
var externals = {};
|
||||||
|
|
||||||
Object.keys(Components).forEach(function(key) {
|
Object.keys(Components).forEach(function(key) {
|
||||||
|
@ -7,18 +8,16 @@ Object.keys(Components).forEach(function(key) {
|
||||||
externals[`element-ui/packages/${key}/style.css`] = `element-ui/lib/${key}/style.css`;
|
externals[`element-ui/packages/${key}/style.css`] = `element-ui/lib/${key}/style.css`;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Object.keys(dependencies).forEach(function (key) {
|
||||||
|
externals[key] = key;
|
||||||
|
});
|
||||||
|
|
||||||
externals['element-ui/src/utils/clickoutside'] = 'element-ui/lib/utils/clickoutside';
|
externals['element-ui/src/utils/clickoutside'] = 'element-ui/lib/utils/clickoutside';
|
||||||
externals['element-ui/src/utils/popper'] = 'element-ui/lib/utils/popper';
|
externals['element-ui/src/utils/popper'] = 'element-ui/lib/utils/popper';
|
||||||
externals['element-ui/src/utils/vue-popper'] = 'element-ui/lib/utils/vue-popper';
|
externals['element-ui/src/utils/vue-popper'] = 'element-ui/lib/utils/vue-popper';
|
||||||
externals['vue-popup'] = 'vue-popup';
|
|
||||||
|
|
||||||
exports.externals = Object.assign({
|
exports.externals = Object.assign({
|
||||||
vue: {
|
vue: 'vue'
|
||||||
root: 'Vue',
|
|
||||||
commonjs: 'vue',
|
|
||||||
commonjs2: 'vue',
|
|
||||||
amd: 'vue'
|
|
||||||
}
|
|
||||||
}, externals);
|
}, externals);
|
||||||
|
|
||||||
exports.alias = {
|
exports.alias = {
|
||||||
|
@ -28,6 +27,13 @@ exports.alias = {
|
||||||
'element-ui': path.resolve(__dirname, '../')
|
'element-ui': path.resolve(__dirname, '../')
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.vue = {
|
||||||
|
root: 'Vue',
|
||||||
|
commonjs: 'vue',
|
||||||
|
commonjs2: 'vue',
|
||||||
|
amd: 'vue'
|
||||||
|
};
|
||||||
|
|
||||||
exports.jsexclude = /node_modules|utils\/popper\.js|utils\/date.\js/;
|
exports.jsexclude = /node_modules|utils\/popper\.js|utils\/date.\js/;
|
||||||
|
|
||||||
exports.postcss = function(webapck) {
|
exports.postcss = function(webapck) {
|
||||||
|
|
|
@ -9,7 +9,7 @@ cooking.set({
|
||||||
moduleName: 'ELEMENT',
|
moduleName: 'ELEMENT',
|
||||||
extends: ['vue2'],
|
extends: ['vue2'],
|
||||||
alias: config.alias,
|
alias: config.alias,
|
||||||
externals: { vue: config.externals.vue }
|
externals: { vue: config.vue }
|
||||||
});
|
});
|
||||||
|
|
||||||
cooking.add('output.filename', 'index.js');
|
cooking.add('output.filename', 'index.js');
|
||||||
|
|
|
@ -200,7 +200,6 @@
|
||||||
```html
|
```html
|
||||||
<el-input
|
<el-input
|
||||||
placeholder="请输入内容"
|
placeholder="请输入内容"
|
||||||
:number="true"
|
|
||||||
v-model="input">
|
v-model="input">
|
||||||
</el-input>
|
</el-input>
|
||||||
```
|
```
|
||||||
|
@ -636,7 +635,6 @@
|
||||||
| disabled | 禁用 | boolean | — | false |
|
| disabled | 禁用 | boolean | — | false |
|
||||||
| size | 输入框尺寸,只在 `type!="textarea"` 时有效 | string | large, small, mini | — |
|
| size | 输入框尺寸,只在 `type!="textarea"` 时有效 | string | large, small, mini | — |
|
||||||
| icon | 输入框尾部图标 | string | — | — |
|
| icon | 输入框尾部图标 | string | — | — |
|
||||||
| number | 指定 model 值为 number 类型 | boolean | — | false |
|
|
||||||
| rows | 输入框行数,只对 `type="textarea"` 有效 | number | — | 2 |
|
| rows | 输入框行数,只对 `type="textarea"` 有效 | number | — | 2 |
|
||||||
| autosize | 自适应内容高度,只对 `type="textarea"` 有效,可传入对象,如,{ minRows: 2, maxRows: 6 } | boolean/object | — | false |
|
| autosize | 自适应内容高度,只对 `type="textarea"` 有效,可传入对象,如,{ minRows: 2, maxRows: 6 } | boolean/object | — | false |
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@
|
||||||
this.$prompt('请输入邮箱', '提示', {
|
this.$prompt('请输入邮箱', '提示', {
|
||||||
inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
|
inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
|
||||||
inputErrorMessage: '邮箱格式不正确'
|
inputErrorMessage: '邮箱格式不正确'
|
||||||
}).then(value => {
|
}).then(({ value }) => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: '你的邮箱是: ' + value
|
message: '你的邮箱是: ' + value
|
||||||
|
|
19
package.json
19
package.json
|
@ -25,7 +25,7 @@
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git@github.com:elemefe/element.git"
|
"url": "git@github.com:ElemeFE/element.git"
|
||||||
},
|
},
|
||||||
"homepage": "http://element.eleme.io",
|
"homepage": "http://element.eleme.io",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
@ -35,17 +35,14 @@
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/elemefe/element/issues"
|
"url": "https://github.com/ElemeFE/element/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"async-validator": "^1.6.6",
|
"async-validator": "^1.6.6",
|
||||||
"gulp": "^3.9.1",
|
"object-assign": "^4.1.0",
|
||||||
"gulp-cssmin": "^0.1.7",
|
|
||||||
"gulp-postcss": "^6.1.1",
|
|
||||||
"object-equal": "^1.0.0",
|
"object-equal": "^1.0.0",
|
||||||
"postcss-salad": "^1.0.5",
|
|
||||||
"throttle-debounce": "^1.0.1",
|
"throttle-debounce": "^1.0.1",
|
||||||
"vue-popup": "^0.2.8",
|
"vue-popup": "^0.2.9",
|
||||||
"wind-dom": "0.0.3"
|
"wind-dom": "0.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -67,6 +64,9 @@
|
||||||
"file-loader": "^0.9.0",
|
"file-loader": "^0.9.0",
|
||||||
"file-save": "^0.2.0",
|
"file-save": "^0.2.0",
|
||||||
"gh-pages": "^0.11.0",
|
"gh-pages": "^0.11.0",
|
||||||
|
"gulp": "^3.9.1",
|
||||||
|
"gulp-cssmin": "^0.1.7",
|
||||||
|
"gulp-postcss": "^6.1.1",
|
||||||
"highlight.js": "^9.3.0",
|
"highlight.js": "^9.3.0",
|
||||||
"html-loader": "^0.4.3",
|
"html-loader": "^0.4.3",
|
||||||
"html-webpack-plugin": "^2.22.0",
|
"html-webpack-plugin": "^2.22.0",
|
||||||
|
@ -87,10 +87,10 @@
|
||||||
"markdown-it": "^6.1.1",
|
"markdown-it": "^6.1.1",
|
||||||
"markdown-it-container": "^2.0.0",
|
"markdown-it-container": "^2.0.0",
|
||||||
"mocha": "^3.1.1",
|
"mocha": "^3.1.1",
|
||||||
"object-assign": "^4.1.0",
|
|
||||||
"phantomjs-prebuilt": "^2.1.13",
|
"phantomjs-prebuilt": "^2.1.13",
|
||||||
"postcss": "^5.1.2",
|
"postcss": "^5.1.2",
|
||||||
"postcss-loader": "^0.11.1",
|
"postcss-loader": "^0.11.1",
|
||||||
|
"postcss-salad": "^1.0.5",
|
||||||
"rimraf": "^2.5.4",
|
"rimraf": "^2.5.4",
|
||||||
"sinon": "^1.17.6",
|
"sinon": "^1.17.6",
|
||||||
"sinon-chai": "^2.8.0",
|
"sinon-chai": "^2.8.0",
|
||||||
|
@ -103,7 +103,6 @@
|
||||||
"vue-markdown-loader": "^0.5.1",
|
"vue-markdown-loader": "^0.5.1",
|
||||||
"vue-router": "^2.0.0",
|
"vue-router": "^2.0.0",
|
||||||
"webpack": "^1.13.2",
|
"webpack": "^1.13.2",
|
||||||
"webpack-dev-server": "^1.15.1",
|
"webpack-dev-server": "^1.15.1"
|
||||||
"wind-dom": "0.0.3"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,8 @@
|
||||||
validateDisabled: false,
|
validateDisabled: false,
|
||||||
validating: false,
|
validating: false,
|
||||||
validator: {},
|
validator: {},
|
||||||
isRequired: false
|
isRequired: false,
|
||||||
|
initialValue: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -118,12 +119,9 @@
|
||||||
if (Array.isArray(value) && value.length > 0) {
|
if (Array.isArray(value) && value.length > 0) {
|
||||||
this.validateDisabled = true;
|
this.validateDisabled = true;
|
||||||
model[this.prop] = [];
|
model[this.prop] = [];
|
||||||
} else if (typeof value === 'string' && value !== '') {
|
} else if (value) {
|
||||||
this.validateDisabled = true;
|
this.validateDisabled = true;
|
||||||
model[this.prop] = '';
|
model[this.prop] = this.initialValue;
|
||||||
} else if (typeof value === 'number') {
|
|
||||||
this.validateDisabled = true;
|
|
||||||
model[this.prop] = 0;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getRules() {
|
getRules() {
|
||||||
|
@ -151,12 +149,22 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.validate('change');
|
this.validate('change');
|
||||||
|
},
|
||||||
|
getInitialValue() {
|
||||||
|
var value = this.form.model[this.prop];
|
||||||
|
if (value === undefined) {
|
||||||
|
return value;
|
||||||
|
} else {
|
||||||
|
return JSON.parse(JSON.stringify(value));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.prop) {
|
if (this.prop) {
|
||||||
this.dispatch('form', 'el.form.addField', [this]);
|
this.dispatch('form', 'el.form.addField', [this]);
|
||||||
|
|
||||||
|
this.initialValue = this.getInitialValue();
|
||||||
|
|
||||||
let rules = this.getRules();
|
let rules = this.getRules();
|
||||||
|
|
||||||
if (rules.length) {
|
if (rules.length) {
|
||||||
|
|
|
@ -13,27 +13,9 @@
|
||||||
<slot name="prepend"></slot>
|
<slot name="prepend"></slot>
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
v-if="type === 'text'"
|
v-if="type !== 'textarea'"
|
||||||
class="el-input__inner"
|
class="el-input__inner"
|
||||||
v-model="currentValue"
|
:type="type"
|
||||||
type="text"
|
|
||||||
:name="name"
|
|
||||||
:placeholder="placeholder"
|
|
||||||
:disabled="disabled"
|
|
||||||
:readonly="readonly"
|
|
||||||
:number="number"
|
|
||||||
:maxlength="maxlength"
|
|
||||||
:minlength="minlength"
|
|
||||||
:autocomplete="autoComplete"
|
|
||||||
ref="input"
|
|
||||||
@focus="handleFocus"
|
|
||||||
@blur="handleBlur"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
v-if="type === 'password'"
|
|
||||||
class="el-input__inner"
|
|
||||||
v-model="currentValue"
|
|
||||||
type="password"
|
|
||||||
:name="name"
|
:name="name"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
|
@ -42,7 +24,9 @@
|
||||||
:maxlength="maxlength"
|
:maxlength="maxlength"
|
||||||
:minlength="minlength"
|
:minlength="minlength"
|
||||||
:autocomplete="autoComplete"
|
:autocomplete="autoComplete"
|
||||||
|
:value="value"
|
||||||
ref="input"
|
ref="input"
|
||||||
|
@input="handleInput"
|
||||||
@focus="handleFocus"
|
@focus="handleFocus"
|
||||||
@blur="handleBlur"
|
@blur="handleBlur"
|
||||||
>
|
>
|
||||||
|
@ -151,6 +135,9 @@
|
||||||
},
|
},
|
||||||
handleFocus(ev) {
|
handleFocus(ev) {
|
||||||
this.$emit('focus', ev);
|
this.$emit('focus', ev);
|
||||||
|
},
|
||||||
|
handleInput(ev) {
|
||||||
|
this.currentValue = ev.target.value;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
watch: {
|
watch: {
|
||||||
defaultActive(value) {
|
defaultActive(value) {
|
||||||
this.activeIndex = value;
|
this.activeIndex = value;
|
||||||
|
if (!this.menuItems[value]) return;
|
||||||
let indexPath = this.menuItems[value].indexPath;
|
let indexPath = this.menuItems[value].indexPath;
|
||||||
|
|
||||||
this.handleSelect(value, indexPath);
|
this.handleSelect(value, indexPath);
|
||||||
|
@ -97,6 +98,7 @@
|
||||||
},
|
},
|
||||||
openActiveItemMenus() {
|
openActiveItemMenus() {
|
||||||
let index = this.activeIndex;
|
let index = this.activeIndex;
|
||||||
|
if (!this.menuItems[index]) return;
|
||||||
if (index && this.mode === 'vertical') {
|
if (index && this.mode === 'vertical') {
|
||||||
let indexPath = this.menuItems[index].indexPath;
|
let indexPath = this.menuItems[index].indexPath;
|
||||||
|
|
||||||
|
|
|
@ -140,19 +140,23 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
inputValue() {
|
inputValue(val) {
|
||||||
if (this.$type === 'prompt') {
|
if (this.$type === 'prompt' && val !== null) {
|
||||||
this.validate();
|
this.validate();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
value(val) {
|
value(val) {
|
||||||
if (val && this.$type === 'prompt') {
|
if (this.$type !== 'prompt') return;
|
||||||
|
if (val) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.$refs.input && this.$refs.input.$el) {
|
if (this.$refs.input && this.$refs.input.$el) {
|
||||||
this.$refs.input.$el.querySelector('input').focus();
|
this.$refs.input.$el.querySelector('input').focus();
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
|
} else {
|
||||||
|
this.editorErrorMessage = '';
|
||||||
|
removeClass(this.$refs.input.$el.querySelector('input'), 'invalid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue