We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
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
我实际的代码 /**
const temHumData = ref([]);
const { data, run } = useRequest(apiTemHumAirQuality, { pollingInterval: 5000, manual: true });
watch(spaceId, (val: any) => { if (val) { run(val); } });
watch(data, (val: any) => { if (val?.data) { temHumData.value = handleTemHumData(val.data, functionSetData.value); } });
onMounted(() => { if (spaceId.value) { run(spaceId.value); } }); return { temHumData }; }; 我希望的代码 export const useRequestTemHum = (spaceId: any) => { const { functionSetData } = storeToRefs(useConditionerStore(),{ refreshDeps: [spaceId], // 加个为空不请求的条件 });
}); return { temHumData }; };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
我实际的代码
/**
*/
export const useRequestTemHum = (spaceId: any) => {
const { functionSetData } = storeToRefs(useConditionerStore());
const temHumData = ref([]);
const { data, run } = useRequest(apiTemHumAirQuality, {
pollingInterval: 5000,
manual: true
});
watch(spaceId, (val: any) => {
if (val) {
run(val);
}
});
watch(data, (val: any) => {
if (val?.data) {
temHumData.value = handleTemHumData(val.data, functionSetData.value);
}
});
onMounted(() => {
if (spaceId.value) {
run(spaceId.value);
}
});
return {
temHumData
};
};
我希望的代码
export const useRequestTemHum = (spaceId: any) => {
const { functionSetData } = storeToRefs(useConditionerStore(),{
refreshDeps: [spaceId], // 加个为空不请求的条件
});
const temHumData = ref([]);
const { data, run } = useRequest(apiTemHumAirQuality, {
pollingInterval: 5000,
manual: true
});
watch(data, (val: any) => {
if (val?.data) {
temHumData.value = handleTemHumData(val.data, functionSetData.value);
}
});
});
return {
temHumData
};
};
The text was updated successfully, but these errors were encountered: