fix: Fix Datepicker bind attr to panel error (#1277)

* fix: Fix Datepicker bind attr to panel error

* fix: Fix Datepicker bind attr to panel error
This commit is contained in:
zazzaz
2021-01-15 18:08:09 +08:00
committed by GitHub
parent b5be4443e3
commit 05f62fa75f
3 changed files with 6 additions and 2 deletions

View File

@@ -50,10 +50,11 @@ describe('TimePicker', () => {
expect(outterInput.attributes().style).toBeDefined()
})
it('set format && default value && set AM/PM spinner', async () => {
it('set format && default value && set AM/PM spinner && no $attr to panel', async () => {
const wrapper = _mount(`<el-time-picker
:format="format"
v-model="value"
class="customClass"
/>`, () => ({ format: 'hh-mm:ss A',
value: new Date(2016, 9, 10, 18, 40) }))
await nextTick()
@@ -73,6 +74,8 @@ describe('TimePicker', () => {
expect(times[0].textContent).toBe('06 PM')
expect(times[1].textContent).toBe('40') // default value
expect(times[2].textContent).toBe('00')
const panel = document.querySelector('.el-time-panel') as any
expect(panel.classList).not.toContain('customClass')
})
it('select time', async () => {

View File

@@ -108,9 +108,9 @@
:actual-visible="pickerActualVisible"
:parsed-value="parsedValue"
:format="format"
:unlink-panels="unlinkPanels"
:type="type"
:default-value="defaultValue"
v-bind="$attrs"
@pick="onPick"
@select-range="setSelectionRange"
@set-picker-option="onSetPickerOption"

View File

@@ -95,4 +95,5 @@ export const defaultProps = {
type: Boolean,
default: true,
},
unlinkPanels: Boolean,
}