Socket
Socket
Sign inDemoInstall

@vue/runtime-dom

Package Overview
Dependencies
4
Maintainers
2
Versions
206
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @vue/runtime-dom

@vue/runtime-dom


Version published
Maintainers
2
Install size
3.21 MB
Created

Package description

What is @vue/runtime-dom?

The @vue/runtime-dom package is a core part of Vue.js, specifically designed for working with the DOM in web browsers. It provides methods and utilities for managing the DOM, handling events, and rendering components dynamically. This package is essential for building interactive web applications using Vue.js.

What are @vue/runtime-dom's main functionalities?

DOM Manipulation

This feature allows developers to manipulate the DOM by creating and mounting Vue components. The code sample demonstrates how to create a simple Vue application that renders 'Hello World' inside a div element.

import { createApp, h } from 'vue';
const App = { render() { return h('div', 'Hello World'); } };
createApp(App).mount('#app');

Event Handling

This feature enables handling of user events such as clicks. The code sample shows how to create a Vue component with a button that alerts the user when clicked.

import { createApp, h } from 'vue';
const App = {
  render() {
    return h('button', {
      onClick: this.handleClick
    }, 'Click me');
  },
  methods: {
    handleClick() {
      alert('Button clicked');
    }
  }
};
createApp(App).mount('#app');

Component Rendering

This feature deals with rendering components within other components. The code sample illustrates how to define and render nested components using Vue's composition API.

import { createApp, defineComponent, h } from 'vue';
const ChildComponent = defineComponent({
  render() {
    return h('p', 'I am a child component');
  }
});
const ParentComponent = defineComponent({
  render() {
    return h('div', [
      h('h1', 'This is a parent component'),
      h(ChildComponent)
    ]);
  }
});
createApp(ParentComponent).mount('#app');

Other packages similar to @vue/runtime-dom

Changelog

Source

3.4.19 (2024-02-13)

Bug Fixes

  • deps: pin lru-cache to avoid hashing error (b8be990), closes #10300
  • hydration: fix css vars hydration mismatch false positive on non-root nodes (995d2fd), closes #10317 #10325
  • runtime-dom: should not trigger transition when v-show value is falsy (#10311) (e509639)

Features

Note: this warning is categorized as a feature but released in a patch because it does not affect public APIs.

  • dx: warn users when computed is self-triggering (#10299) (f7ba97f)

Performance Improvements

Readme

Source

@vue/runtime-dom

import { h, createApp } from '@vue/runtime-dom'

const RootComponent = {
  render() {
    return h('div', 'hello world')
  }
}

createApp(RootComponent).mount('#app')

Keywords

FAQs

Last updated on 13 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc