Vue2.5 scoped slots deprecated

 the "scope" attribute for scoped slots have been deprecated and replaced by "slot-scope" since 2.5. The new "slot-scope" attribute can also be used on plain elements in addition to <template> to denote scoped slots.

This is a new error that I’m getting with vue2.5, when used with https://github.com/Akryum/vue-virtual-scroller.

Was there a release note associated with this change? It looks like this component isn’t being actively maintained, so if I need to fork it I’d like to know what the correct architecture should be going forward. Alternatively, if there is another virtual scroller implementation that’s recommended I would look into that as well.

Thanks!

The code will still work, it’s only deprecated for now. In production you won’t get this message. The new syntax for scoped slots is way nicer, but yeah it can be a pain for 3rd party libraries that are rarely maintained.

You can find the details of that change here:

Awesome, made the change and Vue was able to correctly use the new syntax without changes to the library. Here is my change log for where I was using this:

 		<virtual-scroller v-cloak id="a" v-if="fuseData.length > 0" class="scroller" :items="fuseData" :itemHeight="nodeHeight" content-tag="div">
-			<template scope="props">
-				<node-cell :node="props.item" :key="props.itemKey" :isChild="false"></node-cell>
-			</template>
+			<node-cell  slot-scope="props" :node="props.item" :key="props.itemKey" :isChild="false"></node-cell>
 		</virtual-scroller>

Thanks again!

I’ve changed all “scope=” to “slot-scope=” and I’m still getting the warnings. Is this normal?

Strange question. Of course it’s not expected that a waring appears if no reason for the warning exists. So either your forgot one instance, or some 3rd party code uses a template wiht the old style.

1 Like