Skip to content

请问如何调用类似showLoading这种方法? #821

Answered by kingyue737
ybtsdst asked this question in Q&A
Discussion options

You must be logged in to vote

通过模板引用获得组件实例来调用组件实例上的方法。举个例子:

<script setup>
const chartRef = useTemplateRef('chart')

onMounted(() => {
  chartRef.value.showLoading()
})
</script>

<template>
  <VChart ref="chart" />
</template>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Justineo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #817 on December 18, 2024 09:24.