vue subassembly Get parent component properties, methods, and the parent component subassembly acquired properties, methods

vue subassembly acquired parent element method

this.$emit("searchhide");

vue subassembly parent component data acquired

Parent component

<child :trust-plan-id-list="data"></child>
  • Declare and use the variables in the sub-assembly
    declared in the props, and then you can directly use it
 props:[
      "trustPlanIdList"
    ],

Gets the parent component method:

this.$parent.methods

Obtain properties of the parent component:

this.$parent.options

 

 Gets the parent component sub-assembly method

<search ref="search" v-show="!blurBgShow" @searchshow="rankshow=false" @searchhide="rankshow=true"></search>

Acquiring property subcomponents:

this.$refs.search.searchShow 

 

Published 29 original articles · won praise 5 · Views 7984

Guess you like

Origin blog.csdn.net/qq_25194685/article/details/104752748
Recommended