mirror of https://github.com/vuejs/core.git
fix(compat): should not warn COMPILER_V_BIND_OBJECT_ORDER when using v-bind together with v-for (#12993)
fix #12992
This commit is contained in:
parent
949df80880
commit
93949e6587
|
@ -594,11 +594,9 @@ export function buildProps(
|
||||||
hasDynamicKeys = true
|
hasDynamicKeys = true
|
||||||
if (exp) {
|
if (exp) {
|
||||||
if (isVBind) {
|
if (isVBind) {
|
||||||
// #10696 in case a v-bind object contains ref
|
if (__COMPAT__) {
|
||||||
pushRefVForMarker()
|
|
||||||
// have to merge early for compat build check
|
// have to merge early for compat build check
|
||||||
pushMergeArg()
|
pushMergeArg()
|
||||||
if (__COMPAT__) {
|
|
||||||
// 2.x v-bind object order compat
|
// 2.x v-bind object order compat
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
const hasOverridableKeys = mergeArgs.some(arg => {
|
const hasOverridableKeys = mergeArgs.some(arg => {
|
||||||
|
@ -641,6 +639,9 @@ export function buildProps(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #10696 in case a v-bind object contains ref
|
||||||
|
pushRefVForMarker()
|
||||||
|
pushMergeArg()
|
||||||
mergeArgs.push(exp)
|
mergeArgs.push(exp)
|
||||||
} else {
|
} else {
|
||||||
// v-on="obj" -> toHandlers(obj)
|
// v-on="obj" -> toHandlers(obj)
|
||||||
|
|
|
@ -93,6 +93,16 @@ test('COMPILER_V_BIND_OBJECT_ORDER', () => {
|
||||||
).toHaveBeenWarned()
|
).toHaveBeenWarned()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('should not warn COMPILER_V_BIND_OBJECT_ORDER work with vFor', () => {
|
||||||
|
const vm = new Vue({
|
||||||
|
template: `<div><div v-bind="{ id: 'bar', class: 'baz' }" v-for="item in 5" /></div>`,
|
||||||
|
}).$mount()
|
||||||
|
expect(vm.$el).toBeInstanceOf(HTMLDivElement)
|
||||||
|
expect(
|
||||||
|
CompilerDeprecationTypes.COMPILER_V_BIND_OBJECT_ORDER,
|
||||||
|
).not.toHaveBeenWarned()
|
||||||
|
})
|
||||||
|
|
||||||
test('COMPILER_V_ON_NATIVE', () => {
|
test('COMPILER_V_ON_NATIVE', () => {
|
||||||
const spy = vi.fn()
|
const spy = vi.fn()
|
||||||
const vm = new Vue({
|
const vm = new Vue({
|
||||||
|
|
Loading…
Reference in New Issue