new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Vue · Tutorial · all subjects

components: extends

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

extends option type signature

The extends option type is: interface ComponentOptions { extends?: ComponentOptions }. It allows one component to extend another, inheriting its component options.

extends and mixins implementation equivalence

From an implementation perspective, extends is almost identical to mixins. The component specified by extends is treated as though it were the first mixin.

extends vs mixins intent difference

While extends and mixins are implemented similarly, they express different intents. The mixins option is primarily used to compose chunks of functionality, whereas extends is primarily concerned with inheritance.

extends option merging

With extends, any options (except for setup()) will be merged using the relevant merge strategy, similar to mixins.

extends not recommended for Composition API

extends is designed for Options API and does not handle the merging of the setup() hook. In Composition API, the preferred mental model for logic reuse is 'compose' over 'inheritance'. Extract logic into composables instead.

extends with Composition API workaround

If you still need to extend a component using Composition API, call the base component's setup() in the extending component's setup(): import Base from './Base.js'; export default { extends: Base, setup(props, ctx) { return { ...Base.setup(props, ctx), // local bindings } } }

Give your agent this brain