8000 slots should have highest compilation priority (fix #2163) · vuejs/vue@7fd665f · GitHub
[go: up one dir, main page]

Skip to content

Commit 7fd665f

Browse files
committed
slots should have highest compilation priority (fix #2163)
1 parent 01f4e1e commit 7fd665f

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

src/directives/priorities.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export const TRANSITION = 1100
55
export const EL = 1500
66
export const COMPONENT = 1500
77
export const PARTIAL = 1750
8-
export const SLOT = 1750
98
export const FOR = 2000
109
export const IF = 2000
10+
export const SLOT = 2100

test/unit/specs/misc_spec.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,4 +445,27 @@ describe('Misc', function () {
445445
})
446446
expect(vm.$el.firstChild.className).toBe('outer-hi')
447447
})
448+
449+
// #2163
450+
it('slot compilation order with v-if', function () {
451+
var vm = new Vue({
452+
el: document.createElement('div'),
453+
template:
454+
'<test>' +
455+
'<div slot="one">slot1</div>' +
456+
'default content' +
457+
'</test>',
458+
components: {
459+
test: {
460+
template:
461+
'<div>' +
462+
'<slot v-if="true"></slot> ' +
463+
'<slot name="one"></slot>' +
464+
'</div>',
465+
replace: true
466+
}
467+
}
468+
})
469+
expect(vm.$el.textContent).toBe('default content slot1')
470+
})
448471
})

0 commit comments

Comments
 (0)
0