← All repositories
209,962 stars33,873 forksTypeScriptmit2 views
v2.vuejs.org

Vue

Features

  • Reactive Directive SystemsSpecial attributes with a prefix that reactively apply side effects to the DOM, supporting arguments, dynamic arguments, and modifiers to customize behavior and event handling.
  • Component Composition PatternsA mechanism for parent components to inject custom content into a child component's template, facilitating flexible and reusable component composition.
  • Template Compilation ToolsTemplates can be pre-compiled into render functions during the build process to avoid runtime compilation overhead, which is recommended for performance-sensitive applications.
  • Configuration Merge StrategiesDevelopers can define custom merge strategies for specific options by attaching functions to the global configuration object, enabling tailored logic for non-standard component properties.
  • Production Build ModesA production mode that disables development warnings and optimizes runtime performance, which can be enabled via build tool configuration or by using minified production builds.
  • CSS Extraction ToolsComponent CSS can be extracted into a single file during the build process to improve caching, minification, and prevent flashes of unstyled content during server-side rendering.
  • Iteration DirectivesA directive for rendering lists by iterating over arrays, supporting index access and full parent scope visibility within the rendered elements.
  • List Transition ComponentsA specialized component for animating lists of items rendered with loops, supporting entering, leaving, and move transitions for individual items within the group.
  • Animation ToolsState transitions can be updated dynamically in real-time, enabling interactive prototyping and complex visual effects by manipulating variables that drive component rendering.
  • Animation PatternsA pattern for creating reusable transition effects by wrapping standard transition components within custom template or functional components to encapsulate animation logic and hooks.
  • Component-Based Animation OrchestratorsAnimation logic can be encapsulated into dedicated child components to maintain clean code and improve reusability when managing multiple state transitions.
  • State Transition AnimatorsNumerical state changes can be animated by using watchers to tween values, often integrating with external animation libraries for smooth transitions between numeric data points.
  • Template EnginesA declarative template syntax using mustache-style text interpolation and directive attributes to bind data reactively to the DOM, supporting JavaScript expressions and dynamic attribute binding.
  • JSX Syntax SupportA syntax extension that allows writing HTML-like structures within JavaScript, providing a more readable and template-like experience when authoring complex render functions.
  • Template Definition StrategiesSupport for alternative template definitions including inline templates for flexible authoring and external template references by ID.
  • Cross-Site Scripting ProtectionsThe framework automatically sanitizes HTML content and attribute bindings to prevent common cross-site scripting vulnerabilities when rendering data in the browser.
  • Backend Security MiddlewareSecurity concerns like cross-site request forgery and script inclusion are handled on the backend, requiring coordination to implement proper token submission and API interaction.
  • Security Best PracticesDevelopers should follow established security guidelines, audit third-party dependencies for dangerous patterns, and consult industry-standard resources to mitigate risks like cross-site scripting.
  • Server-Side Rendering SecurityServer-side rendering introduces unique security considerations that require adherence to specific framework guidelines to prevent vulnerabilities during the initial page generation process.
  • Initialization PatternsAn application is initialized by creating a root instance with an options object, which can be organized into a tree of nested, reusable components.
  • Plugin ArchitecturesPlugins are defined by an install method that receives the framework constructor, enabling the addition of global methods, assets, mixins, and instance-level functionality.
  • Plugin Installation UtilitiesA global installation method allows developers to register plugins, ensuring they are initialized once and preventing duplicate installations across the application lifecycle.
  • Component Composition SystemsA component-based architecture that enables the construction of large-scale applications using reusable, self-contained instances with support for property-based data passing.
  • Custom DirectivesA shorthand function syntax is available for directives that require identical behavior during both the initial binding and subsequent updates, simplifying the definition of common directive patterns.
  • Data Binding DirectivesA directive for creating two-way data bindings on form elements, automatically selecting the appropriate property and event based on the input type.
  • Directive Hook InterfacesDirective hooks receive context objects including the target element, binding metadata, and virtual nodes, enabling read-only access to directive values, expressions, arguments, and modifiers.
  • Dynamic Value BindingsA mechanism to bind input values to dynamic properties or non-string data types using attribute binding syntax on form elements.
  • Event ModifiersEvent modifiers allow developers to handle common DOM event tasks like propagation control and default behavior prevention directly in the template, keeping component methods focused on data logic.
  • Lifecycle HooksLifecycle hooks allow developers to execute custom logic at specific stages of an instance's initialization, mounting, updating, and destruction process.
  • Reactive Data Binding SystemsProperties defined in the data object are automatically added to the reactivity system, ensuring that view updates are triggered whenever these property values change.
  • Reconciliation AlgorithmsA unique key attribute allows the framework to track node identity, enabling efficient element reuse and reordering during list updates instead of relying on default in-place patching.
  • RoutersAn officially supported router library designed to handle complex navigation and state management requirements in single-page applications.
  • Component SlotsA mechanism for defining multiple named slots within a component template to allow granular control over where specific content is injected.
  • Functional ComponentsStateless and instanceless components that optimize performance by acting as simple functions receiving properties and context, ideal for lightweight UI elements.
  • Form Binding DirectivesA pattern for building reusable custom input components that support two-way data binding via a standard directive.
  • Routing AdaptersThe framework architecture allows for seamless integration with third-party routing libraries, providing flexibility for developers who prefer alternative navigation solutions.
  • Routing MechanismsDevelopers can implement basic navigation by dynamically rendering components based on the current URL path without requiring a full-featured routing library.
  • Template Syntax ExtensionsConcise syntax alternatives for frequently used directives, providing a shorthand notation for attribute binding and event listening to reduce template verbosity.
  • Global Mixin InjectorsGlobal mixins allow developers to inject logic into every instance created, though they should be used sparingly to avoid unintended side effects.
  • Runtime Error TrackersA global error handler hook that can be used to capture and report runtime component errors to external monitoring services.
  • Component Testing UtilitiesComponent testing involves mounting UI components to a DOM environment to verify their behavior, often requiring integrations with state management, routing, and other plugins for reliable validation.
  • End-to-End Testing FrameworksEnd-to-end testing validates the entire application stack, including frontend code and backend services, by simulating real user actions to ensure holistic functionality in production-like environments.
  • Unit Testing FrameworksUnit testing allows developers to validate individual code units in isolation, ensuring application stability and functionality through meaningful assertions and reliable error reporting.
  • Attribute Inheritance MechanismsComponents automatically inherit arbitrary attributes passed to them, appending them to the component's root element unless attribute inheritance is explicitly disabled.
  • Component Rendering PatternsA special element allows for dynamic switching between different components, which is useful for interfaces like tabbed views.
  • Component UtilitiesComponents are reusable, named instances that can be defined with custom data and templates, allowing them to be used as custom elements within an application.
  • Asynchronous Component LoadersA mechanism to define components as factory functions that resolve asynchronously, enabling code-splitting and deferred loading of components only when they are required for rendering.
  • Component Slot SystemsA directive-based syntax allowing the definition of dynamic slot names to support flexible component composition based on runtime values.
  • Prop Type ValidatorsComponents can define properties as objects to enforce specific data types, providing automatic console warnings when passed values do not match the expected type definitions.
  • Prop Validation RulesComponents can define complex validation requirements for properties, including type checks, required status, and default values, with automatic console warnings for invalid inputs.
  • Scoped SlotsA pattern for passing data from a child component to its slot content by binding attributes as slot properties for parent-scope access.
  • Component Communication PatternsComponents can communicate back to parent components by emitting custom events, enabling a reactive flow of information from child to parent.
  • Component MixinsMixins provide a flexible mechanism to distribute reusable component options, allowing developers to inject shared functionality into multiple components seamlessly.
  • Component Composition StrategiesThe framework automatically merges overlapping options between mixins and components, using recursive data merging and array-based hook concatenation to ensure all logic is executed.
  • Component Data PassingProperties are custom attributes registered on a component that allow parent components to pass data down, which then becomes accessible as properties on the child component instance.
  • Component Registration PatternsComponents can be registered globally for use in any root instance or locally within specific parent components to optimize bundle size and scope.
  • Data Flow PatternsProperties maintain a one-way data flow from parent to child, ensuring that parent updates refresh child properties while preventing child components from directly mutating parent state.
  • Event Handling SystemsA directive-based event handling system that allows developers to attach listeners to DOM elements for invoking methods on component instances.
  • Inline Style BindingsDynamic inline style binding supports object and array syntax, allowing direct JavaScript object mapping to CSS properties with automatic vendor prefixing and multiple value support.
  • Element Transitioning MechanismsA mechanism for animating transitions between multiple elements or components, requiring unique keys to distinguish between elements with the same tag name during state changes.
  • Component Caching UtilitiesA component wrapper that caches inactive component instances to maintain their state and avoid unnecessary re-rendering when switching between dynamic components.
  • Animation Transition ComponentsA wrapper component that enables entering and leaving transitions for elements or components using CSS classes, animations, or lifecycle hooks during conditional rendering or display changes.
  • Conditional Rendering DirectivesA directive that conditionally renders a block of elements only when the provided expression evaluates to a truthy value, supporting else and else-if logic.
  • Component Data BindingA shorthand event pattern facilitates two-way binding behavior for properties while maintaining explicit event-based communication.
  • Component Lifecycle UtilitiesDevelopers can manually force component updates when necessary or optimize performance by caching static content using a directive that prevents re-evaluation of static elements.
  • State WatchersWatchers provide a generic way to perform asynchronous or expensive operations in response to data changes, offering more control than computed properties for side-effect-heavy logic.
  • Programmatic Event ListenersInstances provide programmatic event methods for manually listening to, emitting, and removing event handlers, useful for integrating third-party libraries.
  • Modifier Key ListenersSystem modifier keys enable the creation of event listeners that trigger only when specific keys like Ctrl, Alt, or Shift are held during a mouse or keyboard interaction.
  • Data Binding UtilitiesA configuration option allows components to customize the property and event used for two-way data binding, enabling support for non-standard input types like checkboxes and radio buttons.
  • List Filtering UtilitiesComputed properties allow for the display of filtered or sorted list subsets without modifying the underlying source data, ensuring clean separation of data and presentation.
  • Component Lifecycle ManagementComponents can recursively invoke themselves by name or handle circular dependencies between components, provided they are registered correctly and recursive calls are guarded by conditional logic.
  • Event Communication SystemsComponents use custom events for communication, requiring exact name matching and recommending kebab-case to avoid issues with HTML case-insensitivity in templates.
  • Visibility DirectivesA directive that toggles the visibility of an element by modifying its CSS display property, keeping the element in the DOM regardless of the condition.
  • Keyboard Event ModifiersKeyboard event listeners can be constrained to specific keys using built-in aliases or key codes, simplifying the logic required to handle user input interactions.
  • HTML Class Binding UtilitiesDynamic HTML class binding allows toggling classes based on data property truthiness, supporting object and array syntax alongside static class attributes.
  • Single File ComponentsA file format that consolidates HTML, JavaScript, and CSS into a single file, enabling syntax highlighting, scoped styling, and the use of preprocessors within a modern build-tool ecosystem.
  • Conditional and List RenderingA directive-based system for conditionally rendering elements and iterating over data collections to dynamically manage the structure of the DOM.
  • Declarative Data Binding SystemsA reactive data-binding system that automatically synchronizes application state with the DOM using declarative template syntax and attribute binding.
  • Directive Lifecycle HooksCustom directives allow developers to hook into the lifecycle of DOM elements, providing methods for binding, insertion, updating, and unbinding to perform direct DOM manipulation.
  • Event Handling DirectivesA directive for binding DOM event listeners to JavaScript expressions or component methods, enabling interactive behavior within the user interface.
  • Reactive State ManagementThe framework wraps standard array mutation methods to trigger view updates, while providing heuristics for efficient DOM reuse when replacing arrays with non-mutating operations.
  • Render FunctionsA programmatic alternative to templates that allows developers to use full JavaScript power for generating virtual DOM nodes and managing complex component rendering logic.
  • Virtual DOM ImplementationsA lightweight representation of the DOM that enables efficient UI updates by comparing virtual node trees and applying only necessary changes to the actual browser DOM.
  • Virtual DOM UtilitiesA core function for creating virtual nodes, accepting tag names, data objects for attributes and properties, and children arrays to construct component trees programmatically.
  • Asynchronous Update QueuesData changes are buffered in a queue and DOM updates are performed asynchronously in the next event loop tick to optimize performance and avoid redundant calculations.
  • Computed PropertiesComputed properties are reactive data accessors that automatically cache their results based on their dependencies, re-evaluating only when those specific reactive dependencies change.
  • Reactivity SystemsGetter/setter conversion on data objects enables dependency tracking and automatic component re-rendering when reactive properties are accessed or modified.
  • State Management LibrariesA centralized state management library that integrates with developer tools to provide time-travel debugging and a predictable architecture.
  • Reactivity PrimitivesMethods are provided to manually add reactive properties to objects or arrays when standard detection mechanisms fail due to JavaScript limitations.
  • Store Pattern ImplementationsA pattern for sharing state across multiple instances by using a reactive object as a single source of truth, enabling automatic view updates.
  • Server-Side Rendering GuidesA comprehensive guide for developers to implement server-side rendering, covering client-side rendering, server development, and build-tooling integration.
  • SSR FrameworksA development environment that generates server-rendered applications with optional progressive web app support, featuring a robust component library and build system.
  • Universal FrameworksA higher-level framework that provides a streamlined development experience for universal applications and static site generation.
  • Input ModifiersInput modifiers that allow for lazy synchronization, automatic typecasting to numbers, and whitespace trimming on form inputs.