misc updates and fixes

pull/7746/head
Leopoldthecoder 2017-10-26 11:15:41 +08:00 committed by 杨奕
parent b85b67d928
commit 00e8c7454f
5 changed files with 27 additions and 20 deletions

View File

@ -245,6 +245,9 @@
<div> <div>
<img class="jumbotron-plant-2" src="~examples/assets/images/plant-2.png" alt=""> <img class="jumbotron-plant-2" src="~examples/assets/images/plant-2.png" alt="">
<img class="jumbotron-web" src="~examples/assets/images/web.png" alt=""> <img class="jumbotron-web" src="~examples/assets/images/web.png" alt="">
<img class="jumbotron-plant-1" src="~examples/assets/images/plant-1.png" alt="">
<img class="jumbotron-figure-1" src="~examples/assets/images/figure-1.png" alt="">
<img class="jumbotron-figure-2" src="~examples/assets/images/figure-2.png" alt="">
</div> </div>
<div data-hover-layer="0"> <div data-hover-layer="0">
<img class="jumbotron-cloud-1" src="~examples/assets/images/cloud-1.png" alt=""> <img class="jumbotron-cloud-1" src="~examples/assets/images/cloud-1.png" alt="">
@ -255,11 +258,6 @@
<img class="jumbotron-compo-2" src="~examples/assets/images/compo-2.png" alt=""> <img class="jumbotron-compo-2" src="~examples/assets/images/compo-2.png" alt="">
<img class="jumbotron-compo-3" src="~examples/assets/images/compo-3.png" alt=""> <img class="jumbotron-compo-3" src="~examples/assets/images/compo-3.png" alt="">
</div> </div>
<div data-hover-layer="2">
<img class="jumbotron-plant-1" src="~examples/assets/images/plant-1.png" alt="">
<img class="jumbotron-figure-1" src="~examples/assets/images/figure-1.png" alt="">
<img class="jumbotron-figure-2" src="~examples/assets/images/figure-2.png" alt="">
</div>
</div> </div>
<div class="cards"> <div class="cards">
<ul class="container"> <ul class="container">
@ -309,17 +307,14 @@
export default { export default {
mounted() { mounted() {
new Hover('.jumbotron', { // eslint-disable-line new Hover('.jumbotron', { // eslint-disable-line
max: 1, max: 3,
scale: 1, scale: 1,
perspective: 700, perspective: 700,
layers: [{ layers: [{
multiple: 0.01, multiple: 0.01,
reverseTranslate: true reverseTranslate: true
}, { }, {
multiple: 0.04, multiple: 0.02,
reverseTranslate: true
}, {
multiple: 0.015,
reverseTranslate: true reverseTranslate: true
}] }]
}); });

View File

@ -5,6 +5,7 @@
:readonly="!editable || readonly" :readonly="!editable || readonly"
:disabled="disabled" :disabled="disabled"
:size="pickerSize" :size="pickerSize"
:id="id"
:name="name" :name="name"
v-if="!ranged" v-if="!ranged"
v-clickoutside="handleClose" v-clickoutside="handleClose"
@ -47,6 +48,7 @@
:placeholder="startPlaceholder" :placeholder="startPlaceholder"
:value="displayValue && displayValue[0]" :value="displayValue && displayValue[0]"
:disabled="disabled" :disabled="disabled"
:id="id && id[0]"
:name="name && name[0]" :name="name && name[0]"
@input="handleStartInput" @input="handleStartInput"
@change="handleStartChange" @change="handleStartChange"
@ -57,6 +59,7 @@
:placeholder="endPlaceholder" :placeholder="endPlaceholder"
:value="displayValue && displayValue[1]" :value="displayValue && displayValue[1]"
:disabled="disabled" :disabled="disabled"
:id="id && id[1]"
:name="name && name[1]" :name="name && name[1]"
@input="handleEndInput" @input="handleEndInput"
@change="handleEndChange" @change="handleEndChange"
@ -272,6 +275,16 @@ const isString = function(val) {
return typeof val === 'string' || val instanceof String; return typeof val === 'string' || val instanceof String;
}; };
const validator = function(val) {
// either: String, Array of String, null / undefined
return (
val === null ||
val === undefined ||
isString(val) ||
(Array.isArray(val) && val.length === 2 && val.every(isString))
);
};
export default { export default {
mixins: [Emitter, NewPopper, Focus('reference')], mixins: [Emitter, NewPopper, Focus('reference')],
@ -291,21 +304,17 @@ export default {
endPlaceholder: String, endPlaceholder: String,
name: { name: {
default: '', default: '',
validator(val) { validator
// either: String, Array of String, null / undefined
return (
val === null ||
val === undefined ||
isString(val) ||
(Array.isArray(val) && val.length === 2 && val.every(isString))
);
}
}, },
disabled: Boolean, disabled: Boolean,
clearable: { clearable: {
type: Boolean, type: Boolean,
default: true default: true
}, },
id: {
default: '',
validator
},
popperClass: String, popperClass: String,
editable: { editable: {
type: Boolean, type: Boolean,

View File

@ -163,6 +163,7 @@
}, },
methods: { methods: {
validate(trigger, callback = noop) { validate(trigger, callback = noop) {
this.validateDisabled = false;
var rules = this.getFilteredRule(trigger); var rules = this.getFilteredRule(trigger);
if ((!rules || rules.length === 0) && !this._props.hasOwnProperty('required')) { if ((!rules || rules.length === 0) && !this._props.hasOwnProperty('required')) {
callback(); callback();

View File

@ -49,6 +49,7 @@
type="text" type="text"
:placeholder="currentPlaceholder" :placeholder="currentPlaceholder"
:name="name" :name="name"
:id="id"
:size="selectSize" :size="selectSize"
:disabled="disabled" :disabled="disabled"
:readonly="!filterable || multiple" :readonly="!filterable || multiple"
@ -208,6 +209,7 @@
props: { props: {
name: String, name: String,
id: String,
value: { value: {
required: true required: true
}, },

2
types/index.d.ts vendored
View File

@ -283,4 +283,4 @@ declare namespace ElementUI {
export class Upload extends ElUpload {} export class Upload extends ElUpload {}
} }
export = ElementUI export default ElementUI