Skip to content

VantageRef,VantageApi 组件收集器

基础用法

vue

<script setup lang="ts">
  //引入
  import {onUnmounted, watch} from "vue";
  import { VantageRef,VantageApi } from "@nexacore/vantage";
  //VantageRef 为获取rer值 VantageApi为绑定ref  当组件被卸载后 对应的ref也会被卸载

  //   因为ref绑定的异步的如果其他页面要绑定成功立马执行需要进行监听
  watch(() => VantageRef.绑定的唯一ref名称, (ref) => {
    if (VantageRef.绑定的唯一ref名称) {
      console.log("组件加载完毕")
    }
  }, {
    deep: true
  })




</script>
<!---->
<template>

  <div :ref="(e)=>VantageApi('绑定的唯一ref名称',e)"> 在需要绑定ref上的任意vue文件上写法</div>

</template>