8000 vue 3.3.5+ in compat mode throws errors · Issue #7181 · bootstrap-vue/bootstrap-vue · GitHub
[go: up one dir, main page]

Skip to content
vue 3.3.5+ in compat mode throws errors #7181
Open
@kalekseev

Description

@kalekseev

@VividLemon is it possible to create one more release to continue support vue3 in compat mode?

Describe the bug

In this pr "_assign" key was changed to Symbol("_assign") vuejs/core#8681
As a result this code doesn't work anymore:

bootstrap-vue/src/vue.js

Lines 37 to 48 in 5173dd1

Vue.vModelDynamic.created = function(el, binding, vnode) {
originalVModelDynamicCreated.call(this, el, binding, vnode)
if (!el._assign) {
el._assign = () => {}
}
}
Vue.vModelDynamic.beforeUpdate = function(el, binding, vnode) {
originalVModelDynamicBeforeUpdate.call(this, el, binding, vnode)
if (!el._assign) {
el._assign = () => {}
}
}

Possible solution

  let assignSymbol;

  // See https://github.com/vuejs/vue-next/pull/4121 for details
  Vue.vModelDynamic.created = function(el, binding, vnode) {
    originalVModelDynamicCreated.call(this, el, binding, vnode)
    if(!assignSymbol) {
      assignSymbol = Object.getOwnPropertySymbols(el).find(s => s.description === '_assign');
    }
    if (!el[assignSymbol]) {
      el[assignSymbol] = function () {};
    }
  }
  Vue.vModelDynamic.beforeUpdate = function(el, binding, vnode) {
    originalVModelDynamicBeforeUpdate.call(this, el, binding, vnode)
    if(!assignSymbol) {
      assignSymbol = Object.getOwnPropertySymbols(el).find(s => s.description === '_assign');
    }
    if (!el[assignSymbol]) {
      el[assignSymbol] = function () {};
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0