Vue instance parameter options description

Data related options

Options Description
data Declare data objects that require reactive binding
props Receive data from the parent component
propsData Manually pass props when creating an instance to facilitate testing props",
computed Calculated attributes",
methods Define the methods that can be accessed through the vm object",
watch When Vue is instantiated, it will call the $watch() method to traverse each attribute of the watch object",

DOM related options

Options Description
the Use existing DOM elements on the page as the mount target of the Vue instance",
template Can replace the string template of the mounted element",
render Rendering function, alternative to string template",
renderError Only used in the development environment, when an error occurs in render(), provide additional rendering output",

Lifecycle hook related options

Options Description
beforeCreate Occurs after the initialization of the Vue instance, before the data observer and event/watcher events are configured",
created Occurs after the initialization of the Vue instance and the data observer and event/watcher events are configured",
beforeMount Called before the start of the mount, at this time render() is called for the first time",
mounted el is replaced by the newly created vm.$el and is called after it is mounted on the instance",
beforeUpdate Called when the data is updated, before the virtual DOM is re-rendered and patched",
updated Data changes cause the virtual DOM to be called after re-rendering and patching",
activated Called when the keep-alive component is activated",
deactivated Called when the keep-alive component is disabled",
beforeDestroy Called before the instance is destroyed, the Vue instance is still available",
destroyed Called after the Vue instance is destroyed, event listeners and sub-instances are all removed, and system resources are released",

Resource related options

Options Description
directives A hash table containing the instructions available for the Vue instance",
filters A hash table containing the filters available for the Vue instance",
components A hash table containing the available components of the Vue instance

Combination options

Options Description
parent Specify the parent instance of the current instance, the child instance uses this. parent to access the parent instance, the parent instance accesses the parent instance through parent, and the parent instance passesP A R & lt E n- T access Q parent real cases , the parent real embodiment via through the children array access subinstances
mixins Mix properties into Vue instance objects and get executed before the properties of Vue's own instance objects are called
extends Used to declare the inheritance of another component, so that Vue.extend is not needed, and it is convenient to extend the single-file component
provide&inject The two attributes need to be used together to inject dependencies into all child components, similar to React's Context

Other options

name|允许组件递归调用自身,便于调试时显示更加友好的警告信息
delimiters|改变模板字符串的风格,默认为{ {}}
functional|让组件无状态(没有data)和无实例(没有this上下文)
model|允许自定义组件使用v-model时定制prop和event
inheritAttrs|默认情况下,父作用域的非props属性绑定会应用在子组件的根元素上。当编写嵌套有其它组件或元素的组件时,可以将该属性设置为false关闭这些默认行为
comments|设为true时会保留并且渲染模板中的HTML注释

Vue 实例属性

Guess you like

Origin blog.csdn.net/dreamingbaobei3/article/details/103286992