", " Built-in components in vuejs include: "
Matching first checks the component's own name option, and if the name option is not available, matches its local registration name (the key value of the parent component's components option). Anonymous components cannot be matched.
Common attributes: name: string, used to automatically generate CSS transition class name; css: Boolean type, Whether to use CSS transition classes. Defaults to true. If set to false, the registered JavaScript hook will only be triggered through component events hello Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris facilisis enim libero, at lacinia diam fermentum id. Pellentesque habitant morbi tristique senectus et netus. 也可以在属性中声明 JavaScript 钩子函数,在钩子函数中,使用js进行动画的操作;
Props: tag - string - 如果未定义,则不渲染动画元素。 move-class - 覆盖移动过渡期间应用的 CSS 类。 除了 mode - 其他 attribute 和
事件: 事件和
用法:
注意,每个
vue的内容分发非常适合“固定部分+动态部分”的组件的场景,固定部分可以是结构固定,也可以是逻辑固定,比如下拉loading,下拉loading只是中间内容是动态的,而拉到底部都会触发拉取更多内容的操作,因此我们可以把下拉loading做成一个有slot的插件 Props: name - string,用于具名插槽 用法:
Props: to - string。需要 prop,必须是有效的查询选择器或 HTMLElement (如果在浏览器环境中使用)。指定将在其中移动
disabled - boolean。此可选属性可用于禁用
请注意,这将移动实际的 DOM 节点,而不是被销毁和重新创建,并且它还将保持任何组件实例的活动状态。所有有状态的 HTML 元素 (即播放的视频) 都将保持其状态。 相关推荐:《vue.js教程》 The above is the detailed content of What are the built-in components in vuejs. For more information, please follow other related articles on the PHP Chinese website!
What are the built-in components in vuejs

vue built-in components
Built-in components can be used directly in templates without registration.
// Vue 的 CDN 构建版本 const { KeepAlive, Teleport, Transition, TransitionGroup } = Vue
// Vue 的 ESM 构建版本 import { KeepAlive, Teleport, Transition, TransitionGroup } from 'vue'
The parameters include is and inline-template, The former are mostly strings or custom components, while the latter are Boolean types,
Code examples
The attributes on this component include include, exclude, and max. The first two are strings or this expression. Cache/not cache the matched components. Max represents the maximum number of components that can be cached.
Code examples
This component is usually used in conjunction with v-show, v-if, v-else-if, v-else, is and other components containing conditions
There are css transition and js transition
You can also customize the class name through enter-class, leave-class and other attributes, which is usually used in conjunction with a third-party animation library;
The class name of css transition has the name attribute value of the transition attribute (recorded as v, if there is no name attribute value, the default is v-), the combination is as follows Several compositions:
v-enter: Defines the starting state of entering the transition. It takes effect before the element is inserted and is removed on the next frame after the element is inserted.
v-enter-active: Define the state when the entry transition takes effect. Applies throughout the transition, takes effect before the element is inserted, and removes after the transition/animation completes. This class can be used to define process times, delays and curve functions for entering transitions.
v-enter-to: Version 2.1.8 and above Defines the end state of the entry transition. Takes effect the next frame after the element is inserted (at the same time v-enter is removed), and is removed after the transition/animation is complete.
v-leave: Defines the starting state of the leave transition. It takes effect immediately when the leaving transition is triggered and is removed the next frame.
v-leave-active: Defines the state when the leave transition takes effect. Applies throughout the exit transition, takes effect immediately when the exit transition is triggered, and removes after the transition/animation completes. This class can be used to define process times, delays and curve functions for exit transitions.
v-leave-to: Version 2.1.8 and above Defines the end state of the leave transition. Takes effect the next frame after the leave transition is triggered (at the same time the v-leave is deleted), and is removed after the transition/animation completes.
当只用 JavaScript 过渡的时候,在 enter 和 leave 中必须使用 done 进行回调。否则,它们将被同步调用,过渡会立即完成
对于仅使用 JavaScript 过渡的元素添加 v-bind:css=“false”,Vue 会跳过 CSS 的检测。这也可以避免过渡过程中 CSS 的影响。// 使用js过渡,通常在组件中监听事件,并写好监听到的回调函数即可