Skip to content

noVueDeprecatedScopedSlots (JavaScript)

Language JavaScript (and super languages)
biome.json
{
"linter": {
"rules": {
"nursery": {
"noVueDeprecatedScopedSlots": "error"
}
}
}
}

Disallow the deprecated Vue $scopedSlots API.

Vue 3 unifies normal and scoped slots under $slots. Replace $scopedSlots with $slots when migrating a component from Vue 2.

See the Vue 3 migration guide for more information.

<script>
export default {
render() {
return this.$scopedSlots.default;
}
};
</script>
code-block.vue:4:17 lint/nursery/noVueDeprecatedScopedSlots  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The Vue $scopedSlots API is deprecated.

2 │ export default {
3 │ render() {
> 4 │ return this.$scopedSlots.default;
^^^^^^^^^^^^
5 │ }
6 │ };

Vue 3 exposes all slots through $slots. See the Vue 3 migration guide for more information.

This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

Unsafe fix: Replace $scopedSlots with $slots.

2 2 export default {
3 3 render() {
4 - ····return·this.$scopedSlots.default;
4+ ····return·this.$slots.default;
5 5 }
6 6 };

<script>
export default {
render() {
return this.$slots.default;
}
};
</script>