letVm = new Vue({});$root// Instance object // console.log(VM.$root); 

vm.$el// Root element (real DOM element) // console.log(vm).$el);

vm.$el.innerhtml // Get the contents of the root element (the actual DOM element) // console.log(vm).$el.innerHTML);

vm.$nextTick// For operations performed after DOM rendering // console.log(vm).$nextTick); / / by the vm.$elThe.innerhtml data may be pre-update // To get the latest data, it is best to get the // VM in the next event ring.$nextTick(()=>{
//     console.log(vm.$el.innerHTML)
// })

vm.$data// Data object in the instance // console.log(vm.$data);

vm.$options// Mount item under instance // console.log(VM.$options);

vm.$props// Data for communication between components // console.log(VM.$props);

vm.$parent// In the component, the parent element // console.log(vm).$parent);

vm.$children// In the component, the child element // console.log(vm).$children);

vm.$attrs// To get all the attributes passed by the parent component // console.log(vm).$attrs);

vm.$listeners// To get all the methods passed by the parent component // console.log(vm).$listeners);

vm.$slots// Slot in component // console.log(VM.$slots);

vm.$scopedSlots// To access the scope slot // console.log(VM).$scopedSlots);

vm.$refs// used to locate DOM elements (traced using ref) // console.log(vm).$refs);

vm.$isServer// Console. Log (vm) // console. Log (vm)$isServer);

vm.$watch// Used to listen for data (which is automatically destroyed when used in vue files) // console.log(vm).$watch);

vm.$emit// Used to distribute events (often used for data communication) // console.log(VM).$emit);

vm.$on// used to listen for dispatch of events // console.log(VM).$on);

vm.$once// only listen for events once (not after that) // console.log(vm).$once);

vm.$set// You can dynamically add data to data (provided you can only add data to objects) // console.log(vm).$set); // Example: VM.$set(vm.obj, "name"."Fan"//obj is an object VM.$delete// Used to delete a property // console.log(vm).$delete); // LifecyclebeforeCreate() {}created() {}beforeMount() {}mounted() {}beforeUpdate() {}updated() {}beforeDestroy() {}destroyed() {}Copy the code

Among them more important knowledge points:

  • Summary of Vue instructions

  • Detailed explanation of data transfer (communication, interaction) between Vue components

  • Vue lifecycle and hook functions

  • Understand nextTick in Vue

  • Vue slot usage (Easy to understand)


Y_Y