DatePicker: fix editable and readonly in range pick

pull/7926/head
Leopoldthecoder 2017-11-01 11:16:37 +08:00 committed by 杨奕
parent 98bf5d7f28
commit 343e9fa438
4 changed files with 35 additions and 44 deletions

View File

@ -247,7 +247,7 @@ Use `list-type` to change the fileList style.
:on-remove="handleRemove">
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog v-model="dialogVisible" size="tiny">
<el-dialog :visible.sync="dialogVisible" size="tiny">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
<script>

View File

@ -247,7 +247,7 @@
:on-remove="handleRemove">
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog v-model="dialogVisible" size="tiny">
<el-dialog :visible.sync="dialogVisible" size="tiny">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
<script>

View File

@ -49,6 +49,7 @@
:value="displayValue && displayValue[0]"
:disabled="disabled"
:id="id && id[0]"
:readonly="!editable || readonly"
:name="name && name[0]"
@input="handleStartInput"
@change="handleStartChange"
@ -60,6 +61,7 @@
:value="displayValue && displayValue[1]"
:disabled="disabled"
:id="id && id[1]"
:readonly="!editable || readonly"
:name="name && name[1]"
@input="handleEndInput"
@change="handleEndChange"

View File

@ -205,57 +205,46 @@ describe('Popover', () => {
});
});
describe('event', (done) => {
const createVM = (trigger) => {
return createVue({
template: `
<div>
<el-popover
ref="popover"
trigger="${trigger}"
@show="handleShow"
@hide="handleHide"
content="content">
<button slot="reference">trigger ${trigger}</button>
</el-popover>
</div>
`,
it('show/hide events', done => {
vm = createVue({
template: `
<div>
<el-popover
ref="popover"
trigger="click"
@show="handleShow"
@hide="handleHide"
content="content">
<button slot="reference">trigger</button>
</el-popover>
</div>
`,
methods: {
handleShow() {
this.trigger = true;
},
handleHide() {
this.trigger = false;
}
methods: {
handleShow() {
this.trigger = true;
},
data() {
return {
trigger: false
};
handleHide() {
this.trigger = false;
}
}, true);
};
},
it('show/hide', () => {
vm = createVM('click');
const compo = vm.$refs.popover;
data() {
return {
trigger: false
};
}
}, true);
vm.$el.querySelector('button').click();
expect(compo.showPopper).to.true;
expect(vm.trigger).to.false;
vm.$el.querySelector('button').click();
setTimeout(_ => {
expect(vm.trigger).to.true;
document.body.click();
expect(compo.showPopper).to.false;
setTimeout(_ => {
expect(vm.trigger).to.true;
document.body.click();
setTimeout(_ => {
expect(vm.trigger).to.false;
}, 50);
expect(vm.trigger).to.false;
done();
}, 50);
});
}, 50);
});
it('destroy event', () => {