The progressive JavaScript framework for building modern web UI.
npx @tessl/cli install tessl/npm-vue@3.5.0Vue.js is a progressive JavaScript framework for building user interfaces and single-page applications. It provides a component-based architecture with reactive data binding, declarative rendering, and comprehensive build system supporting multiple output formats. Vue 3 introduces the Composition API alongside the Options API, improved TypeScript support, better tree-shaking, and enhanced performance through optimized virtual DOM diffing and proxy-based reactivity.
npm install vueimport { createApp, ref, reactive, computed } from "vue";For CommonJS:
const { createApp, ref, reactive, computed } = require("vue");import { createApp, ref, reactive } from "vue";
// Create application instance
const app = createApp({
setup() {
// Reactive state
const count = ref(0);
const user = reactive({
name: "John",
email: "john@example.com"
});
// Computed property
const doubledCount = computed(() => count.value * 2);
// Method
const increment = () => {
count.value++;
};
return {
count,
user,
doubledCount,
increment
};
},
template: `
<div>
<h1>{{ user.name }}</h1>
<p>Count: {{ count }}</p>
<p>Doubled: {{ doubledCount }}</p>
<button @click="increment">Increment</button>
</div>
`
});
// Mount to DOM
app.mount("#app");Vue.js is built around several key systems:
.vue files containing template, script, and style in one fileCore functions for creating and configuring Vue applications.
function createApp(rootComponent?: Component): App;
function createSSRApp(rootComponent?: Component): App;Comprehensive reactive state management with refs, reactive objects, computed properties, and effect tracking. Enables fine-grained reactivity with automatic dependency collection.
function ref<T>(value: T): Ref<T>;
function reactive<T extends object>(target: T): UnwrapNestedRefs<T>;
function computed<T>(getter: () => T): ComputedRef<T>;
function watch<T>(source: T, callback: WatchCallback<T>): WatchStopHandle;Complete component lifecycle management, composition API, dependency injection, and watchers. Provides both Options API and Composition API patterns.
function defineComponent<Props, RawBindings = object>(
setup: (props: Props, ctx: SetupContext) => RawBindings | RenderFunction
): ComponentConstructor;
function onMounted(callback: () => void): void;
function onUnmounted(callback: () => void): void;
function provide<T>(key: InjectionKey<T>, value: T): void;
function inject<T>(key: InjectionKey<T>): T | undefined;Virtual DOM creation, manipulation, and rendering with built-in components and custom renderers.
function h(
type: string | Component,
props?: object | null,
children?: VNodeChildren
): VNode;
function render(vnode: VNode, container: Element): void;Complete SSR support with streaming, hydration, and context management for building universal applications.
function renderToString(app: App): Promise<string>;
function renderToNodeStream(app: App): NodeJS.ReadableStream;
function hydrate(vnode: VNode, container: Element): void;Tools for parsing, compiling, and transforming Vue Single File Components (.vue files) including template, script, and style processing.
function parse(source: string, options?: SFCParseOptions): SFCDescriptor;
function compileTemplate(options: SFCTemplateCompileOptions): SFCTemplateCompileResults;
function compileScript(sfc: SFCDescriptor, options: SFCScriptCompileOptions): SFCScriptBlock;Helper functions, type guards, string manipulation, and development tools for Vue applications.
function nextTick(callback?: () => void): Promise<void>;
function getCurrentInstance(): ComponentInternalInstance | null;
function isRef(value: any): value is Ref;
function toRaw<T>(observed: T): T;
function useCssModule(name?: string): Record<string, string>;
function useCssVars(vars: Record<string, string | Ref<string>>): void;Vue-based custom elements for framework-agnostic component distribution and web standards integration.
function defineCustomElement<T extends Component = Component>(
component: T,
options?: CustomElementOptions
): CustomElementConstructor;
function useShadowRoot(): ShadowRoot | null;
function useHost(): Element | null;Comprehensive JSX/TSX support with full TypeScript integration and Vue reactivity.
function jsx(type: any, props: any, key?: any): VNode;
function jsxs(type: any, props: any, key?: any): VNode;
const Fragment: unique symbol;Development utilities, debugging tools, version information, and DevTools integration.
const version: string;
function warn(msg: string, instance?: ComponentInternalInstance | null): void;Modern hydration strategies for optimizing SSR applications with selective hydration.
function hydrateOnIdle(component: Component): Component;
function hydrateOnVisible(component: Component): Component;
function hydrateOnMediaQuery(component: Component, query: string): Component;
function hydrateOnInteraction(component: Component, events: string[]): Component;