Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【支付宝】页面级别无法获取前端vue页面中的挂载的refs #5301

Open
karoboflower opened this issue Feb 7, 2025 · 0 comments

Comments

@karoboflower
Copy link

页面内容

<template>
  <view class="login">
    <mot-modal ref="ModalRef" id="ModalRef"></mot-modal>
  </view>
</template>

<script setup lang="ts">
const ModalRef = ref();
</script>

其他地方获取页面上面挂载的ref

 var pages = getCurrentPages();
 var page = pages[pages.length - 1];
 console.log('当前页面', page.$vm?.$refs);

结果:微信和h5可以获取到,支付宝在页面实例上面没有挂载refs导致获取不到
源码分析
支付宝未获取当前页面ref挂载上去
微信源码:
Image
支付宝源码

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant