[Vue] Detailed introduction to lauch.js in Vue and the connotation of each parameter

"lauch.js" is a startup file in Vue, usually used to create a Vue instance and configure some default settings.

The following are common "lauch.js" parameters and their meanings:

  1. el: Represents the element to be mounted, usually a string or a DOM object.

  2. router: represents the route used, usually a Vue Router instance.

  3. store: Represents the state manager used, usually a Vuex Store instance.

  4. components: Represents the components used, usually an object. You can use custom components as keys and component definitions as values.

  5. render: A function representing rendering, usually a function used to generate HTML or VNode. If the render function exists, Vue ignores template and el.

  6. template: Represents a template string, usually a string used to specify an HTML template. If template exists, Vue ignores el.

  7. data: Represents the data of the Vue instance, usually an object used to initialize the data.

  8. computed: represents a computed attribute, usually an object used to define attributes that can be cached.

  9. methods: Represents a method, usually an object, used to define methods that can be called.

  10. mounted: Represents the mounting function of the Vue instance, usually a function used to specify the operations to be performed after the Vue instance is mounted to the DOM.

The above are the common parameters and their meanings of "lauch.js". The specific usage methods can be flexibly configured according to needs.

Guess you like

Origin blog.csdn.net/wenhuakulv2008/article/details/133097409
Recommended