From 5d87a85d32437211290c422fb20230399719ede9 Mon Sep 17 00:00:00 2001 From: eunjae-lee Date: Thu, 24 Jun 2021 11:19:19 +0200 Subject: [PATCH] fix: Revert "feat(vue 3): support inject without `this` (#951)" This reverts commit cf7f20abf7d3ecea8ff0a22f197785a3f8cb4df6, because the issue has been fixed since Vue@3.1.2 by https://github.com/vuejs/vue-next/pull/3925 --- src/mixins/widget.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mixins/widget.js b/src/mixins/widget.js index a71b8310..c6b6fd50 100644 --- a/src/mixins/widget.js +++ b/src/mixins/widget.js @@ -12,7 +12,12 @@ export const createWidgetMixin = ({ connector } = {}) => ({ ); }, }, - getProvidedParentIndex: '$_ais_getParentIndex', + getParentIndex: { + from: '$_ais_getParentIndex', + default() { + return () => this.instantSearchInstance.mainIndex; + }, + }, }, data() { return { @@ -68,11 +73,6 @@ Read more on using connectors: https://alg.li/vue-custom` }, }, methods: { - getParentIndex() { - return this.getProvidedParentIndex - ? this.getProvidedParentIndex() - : this.instantSearchInstance.mainIndex; - }, updateState(state = {}, isFirstRender) { if (!isFirstRender) { // Avoid updating the state on first render