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:3:17 lint/nursery/noVueDeprecatedScopedSlots  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The Vue $scopedSlots API is deprecated.

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

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.

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

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