Skip to content

refactor: custom plugin supports adding custom parameters in options#249

Open
lamprose wants to merge 1 commit intoAttoJS:masterfrom
lamprose:master
Open

refactor: custom plugin supports adding custom parameters in options#249
lamprose wants to merge 1 commit intoAttoJS:masterfrom
lamprose:master

Conversation

@lamprose
Copy link

custom plugin supports adding custom parameters in options,example:

declare module 'vue-request' {
  interface PluginOptions {
    customParameters?: Ref<boolean>
  }
}

const useReadyPlugin = definePlugin((queryInstance, { customParameters = ref(true),// ...otherOptionsParameters }) => {
  return {
    onBefore() {
      if (!customParameters.value) {
        return {
          isBreak: true,
        }
      }
    },
  }
})

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

Successfully merging this pull request may close these issues.

1 participant