awesome-repositories.com
博客
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
vuejs avatar

vuejs/composition-api

0
View on GitHub↗
4,184 星标·340 分支·TypeScript·MIT·9 次浏览composition-api.vuejs.org↗

Composition Api

这是一个响应式插件,将 Vue 3 的 Composition API 和响应式状态管理引入 Vue 2 应用。它作为组件逻辑组织器,以及将响应式状态和函数封装为可重用工具的系统。

该插件支持使用组合式函数 (Composable functions) 在组件间共享有状态逻辑,而无需依赖 Mixins。它提供了一种基于普通变量和函数的结构,以促进自动类型推断和编辑器自动补全。此外,它还包含一个基于 Provider 的依赖注入系统,用于在组件树中共享数据和函数。

该系统涵盖了响应式状态、计算属性和侦听器的管理,以及挂载组件生命周期的能力。它允许将第三方有状态库集成到原生响应式系统中,并支持在服务器端预取数据。

该项目使用 TypeScript 编写。

Features

  • Logic Organizers - Provides a system to group related functions and state by logical concern within Vue 2 components.
  • Vue Composition API Plugins - Brings the Vue 3 Composition API and reactive state management capabilities to Vue 2 applications.
  • Stateful Composables - Offers reusable functions that encapsulate reactive state and lifecycle hooks for efficient component composition.
  • Compositional Logic Organizations - Groups related data and methods into functional blocks to improve code reuse and maintainability.
  • Dependency Injection Providers - Implements a provider-based dependency injection system to share data and functions across a component tree.
  • Dependency Injection - Implements a function-based dependency injection system to share data and functions across a component tree.
  • Logic Reuse Patterns - Provides patterns for sharing stateful functionality across components using composable functions.
  • Separation of Concerns - Implements a design pattern to decouple component logic from fixed option blocks, improving separation of concerns.
  • Stateful Logic Encapsulation - Provides a system for extracting repetitive state management and business logic into standalone reusable composable functions.
  • Component Lifecycle Hooks - Executes custom logic during component rendering, updates, or removal via lifecycle hooks.
  • Component Lifecycle Management - Manages the creation, updates, and destruction of components throughout their operational lifecycle.
  • Component Lifecycle Hooks - Provides methods to execute specific logic at defined stages of a component's existence, such as mounting.
  • Lifecycle Hooks - Implements mechanisms to execute custom logic during specific phases of a component's mounting and unmounting process.
  • Component-Based State Management - Manages component state and watchers using imported functions instead of static component options.
  • Proxy-Based Reactivity - Uses JavaScript Proxy objects to intercept data changes and automatically trigger UI updates.
  • Reactive State Management - Provides functions to create reactive variables and computed properties for tracking application state.
  • Bundle Size Optimization - Reduces the final bundle size by removing instance proxies to allow for more efficient minification.
  • Automatic Type Inferences - Leverages plain variables and functions to enable automatic determination of types for better editor autocomplete.
  • Code Block Grouping - Clusters related variables and functions together in the source code to ensure cohesive execution and organization.
  • Static Type Inference - Provides a structure using plain variables and functions to enable native TypeScript static type inference.
  • Component Type Inferences - Enables automatic derivation and validation of types for component options and properties.
  • Component Option Translations - Converts traditional object-based component options into a single setup function for improved organization and type inference.
  • Concern-Based Logic Grouping - Organizes related code by functional purpose to reduce file navigation and simplify refactoring.
  • Instance Proxy Bypasses - Enables more efficient minification and smaller production bundle sizes by accessing variables directly instead of through component instance proxies.
  • Structural Typing and Inference - Leverages plain variables and functions to enable native TypeScript structural typing and automatic inference for better autocomplete.
  • Dependency Injection for UI - Provides a provider-based mechanism for passing data and functions across a component tree without manual prop drilling.
  • Bundle Size Optimizers - Shrinks production output by compiling templates as inlined functions to remove instance proxies.

Star 历史

vuejs/composition-api 的 Star 历史图表vuejs/composition-api 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

Composition Api 的开源替代方案

相似的开源项目,按与 Composition Api 的功能重合度排序。
  • didi/mpxdidi 的头像

    didi/mpx

    3,905在 GitHub 上查看↗

    MPX is a cross-platform framework designed to build applications for multiple mini-program ecosystems and the web from a single codebase. It utilizes a static transpilation pipeline to transform source code into platform-specific bundles, employing a single-file component system that encapsulates templates, logic, and styles. The framework provides a reactive state management system that automatically synchronizes application data with the user interface through computed properties and watchers. The project distinguishes itself through a robust build-time toolchain that supports sub-package p

    JavaScript
    在 GitHub 上查看↗3,905
  • vuejs/vuevuejs 的头像

    vuejs/vue

    209,900在 GitHub 上查看↗

    Vue is a progressive, component-based JavaScript framework designed for building reactive user interfaces and single-page applications. It centers on a declarative template system that transforms HTML into efficient render functions, allowing developers to organize complex interfaces into isolated, reusable units that synchronize automatically with application state. The framework distinguishes itself through a dependency-tracking reactivity system that monitors data access during rendering to trigger precise updates. It provides a flexible architecture that supports both incremental adoption

    TypeScriptframeworkfrontendjavascript
    在 GitHub 上查看↗209,900
  • reactjs/react.devreactjs 的头像

    reactjs/react.dev

    11,765在 GitHub 上查看↗

    React is a JavaScript library for building user interfaces through the composition of modular, self-contained components. It employs a declarative programming model where developers describe the desired visual state, and the library automatically manages the underlying document updates and state synchronization. By utilizing a virtual representation of the document, it calculates and applies minimal changes to the browser, ensuring efficient rendering even in complex applications. The library distinguishes itself through a sophisticated scheduling system that manages rendering work in increme

    JavaScriptdocumentationjavascriptreact
    在 GitHub 上查看↗11,765
  • ygs-code/vueygs-code 的头像

    ygs-code/vue

    7,321在 GitHub 上查看↗

    This project is a technical study guide and architectural analysis of the Vue.js framework. It serves as an educational resource for understanding the implementation of a reactive framework, providing source code analysis and architectural visualizations to explain the internal workings of the Model-View-ViewModel pattern. The project focuses on the mechanics of reactive framework implementation, specifically how dependency tracking, getters, and setters are used to synchronize state with a user interface. It includes detailed examinations of the virtual DOM and the process of reconciling ele

    JavaScript
    在 GitHub 上查看↗7,321
查看 Composition Api 的所有 30 个替代方案→

常见问题解答

vuejs/composition-api 是做什么的?

这是一个响应式插件,将 Vue 3 的 Composition API 和响应式状态管理引入 Vue 2 应用。它作为组件逻辑组织器,以及将响应式状态和函数封装为可重用工具的系统。

vuejs/composition-api 的主要功能有哪些?

vuejs/composition-api 的主要功能包括:Logic Organizers, Vue Composition API Plugins, Stateful Composables, Compositional Logic Organizations, Dependency Injection Providers, Dependency Injection, Logic Reuse Patterns, Separation of Concerns。

vuejs/composition-api 有哪些开源替代品?

vuejs/composition-api 的开源替代品包括: didi/mpx — MPX is a cross-platform framework designed to build applications for multiple mini-program ecosystems and the web from… vuejs/vue — Vue is a progressive, component-based JavaScript framework designed for building reactive user interfaces and… reactjs/react.dev — React is a JavaScript library for building user interfaces through the composition of modular, self-contained… ygs-code/vue — This project is a technical study guide and architectural analysis of the Vue.js framework. It serves as an… flightjs/flight — Flight is a JavaScript component framework and DOM interactivity library used to map behavioral logic to HTML nodes.… vobyjs/voby — Voby is a signal-based framework for building reactive user interfaces. It utilizes fine-grained observables to track…