使用getCurrentInstance方法获取data内的数据
import { getCurrentInstance } from "vue";
export default {
data() {
return {
b: "data数据",
};
},
setup() {
const datab = getCurrentInstance();
async function getdata(){
let dataa=datab.data.b;
console.log(dataa)
}
},
};