ref失效问题
Vue version
3.2.37
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-dls8zb?file=src%2FApp.vue,package.json&terminal=dev
Steps to reproduce
What is expected?
正常显示docid字符串xxx
What is actually happening?
目前显示为空白
System Info
No response
Any additional comments?
No response
The problem has not been solved!
it's ok.
<template>
{{docid}}
</template>
<script setup>
import axios from 'axios';
import { ref, reactive, onMounted } from 'vue';
const docid = ref('');
docid.value= 'xxx';
onMounted(async() => {
const md5 = (await axios.get(`https://cs-api.sh-d.com/md5?str=xxx`)).data;
docid.value = md5;
})
</script>