Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Vue 3 Built-in Components

Vue 3 Built-in Components

In Vue.js, there are some built-in global components and built-in components that provide common functionality and layout support, helping developers quickly build application interfaces.

The following are some common Vue built-in components and their roles:

1. component

is an abstract component used to dynamically render different components or elements.

By binding is attribute, you can switch and render dynamic components.





2. transition and transition-group

and provides the functionality for implementing transition and animation effects in Vue.js.

By defining transition CSS class names, you can control the animation effects when elements enter or leave the DOM.



  
Hello!




  
  • {{ item.text }}
  • 3. keep-alive

    is an abstract component used to preserve component state or avoid repeated rendering.

    When a component is wrapped by , its state is cached rather than re-rendered on every switch.

    
    
      
    
    
    
    

    4. slot

    is the slot component in Vue.js for inserting content. It allows the parent component to pass child component content to a specific slot position, making components more flexible and reusable.

    
    
      
    
      
    
    
    
    

    5. teleport

    allows you to render DOM elements anywhere in the application, free from the current DOM structure's limitations. This is very useful when you need to dynamically move elements in the app, such as rendering popup content in a modal.

    
    
    
    
      
    
        
    
      
    
    
    
    

    6. Suspense

    is a component newly added in Vue.js 3.x, used to handle the loading and state of async components. It can display placeholder content before the async component finishes loading, and handle loading states and errors.