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

Support body as reactive variable #20

Closed
wf-soft opened this issue May 5, 2023 · 1 comment
Closed

Support body as reactive variable #20

wf-soft opened this issue May 5, 2023 · 1 comment

Comments

@wf-soft
Copy link

wf-soft commented May 5, 2023

Environment

nuxt3

Reproduction

no

Describe the bug

When I do not use .value with selId, he will be sent as a ref object. When I use .value, the selId change cannot change the result of the request. He will always issue the request with the initial value.

const { data:moneyData, refresh } = await useApi3FetchData("ack_pay/web/pay",{
                method:"POST",
                body:{
                    qmSig: useCookieToken().value,
                    cardId: selId.value,
                    buyType: selTab.value,
                    source: 2,
                    versionNumber: 0
                },
                watch:[selId, selTab],
                cache:false,
                onRequest(context) {
                    console.log(context);
                },
            });

When I use native useFetch it will work properly, whether this is a BUG or not

const { data:moneyData, refresh } = await useFetch("https://xxx.xxx.com/ack_pay/web/pay",{
                method:"POST",
                body:{
                    qmSig: useCookieToken().value,
                    cardId: selId,
                    buyType: selTab,
                    source: 2,
                    versionNumber: 0
                },
            });

Additional context

No response

Logs

No response

@johannschopplich johannschopplich changed the title Ref change failed to update request parameters Support body as reactive variable May 6, 2023
@johannschopplich
Copy link
Owner

Not a bug, rather than a feature request. 😉

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

2 participants