fix(compiler-core/compat): fix is prop usage on components

also fix v-bind:is usage on plain element in compat mode

fix #3934
This commit is contained in:
Evan You
2021-06-21 16:16:49 -04:00
parent 4de5d24aa7
commit 08e93220f1
4 changed files with 144 additions and 57 deletions

View File

@@ -35,6 +35,22 @@ test('COMPILER_IS_ON_ELEMENT', () => {
expect(CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT).toHaveBeenWarned()
})
test('COMPILER_IS_ON_ELEMENT (dynamic)', () => {
const MyButton = {
template: `<div><slot/></div>`
}
const vm = new Vue({
template: `<button :is="'MyButton'">text</button>`,
components: {
MyButton
}
}).$mount()
expect(vm.$el.outerHTML).toBe(`<div>text</div>`)
expect(CompilerDeprecationTypes.COMPILER_IS_ON_ELEMENT).toHaveBeenWarned()
})
test('COMPILER_V_BIND_SYNC', async () => {
const MyButton = {
props: ['foo'],