Skip to content

component's compiled code from 2.6 not compatible with Vue 2.5.* when include scopedSlot #9545

Closed
@tweet

Description

@tweet

Version

2.5.22

Reproduction link

https://jsfiddle.net/tweet/arjw5sg8/15/

Steps to reproduce

There is a vue component which written used scopedSlot feature, if I compile the source using vue's version larger than 2.6.2, the output content cannot run in 2.5.* environment.

i.e. a vue templete demo like this

  <div>
    <card slot-scope="{item}" :keyType="keyType">
      <div>test slot1</div>
      <div v-if="item.keyType=='real'">
        <slot :item="item"></slot>
      </div>
    </card>
  </div>

if it compiled from vue 2.6.6, then it cannot be work properly in vue 2.5.*

What is expected?

The output code should work in both vue 2.6 and 2.5 env

What is actually happening?

Only Vue 2.6 env works, vue 2.5 env broken.


Vue 2.6 change the 'resolveScopedSlots' function's parameter, you can see the following differance.

// 2.5.*
function resolveScopedSlots (
  fns, // see flow/vnode
  res
) {
...

// 2.6.*
function resolveScopedSlots (
  fns, // see flow/vnode
  hasDynamicKeys,
  res
) {
...

After the issue #9438 resolved, this problem occured.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions