vue-调用子组件方法-ref

<ProductMen-view
ref="productMen"
:isForecast="'true'"
:isSliderShow="isSliderShow"
:sliderInfo="sliderInfo"
:layerList="layerList"
@layerAttributeOperation="layerAttributeOperation"
@layerOperation="layerOperation"
></ProductMen-view>

const productMen = ref();先定义一个变量,就可以调用子组件方法

productMen.value.closeActive(val.layerId);

productMen.value.loadFinish(val.layerID);
posted @ 2022-06-14 16:35  小林222  阅读(151)  评论(0)    收藏  举报