|
@@ -47,7 +47,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div v-show="currentTab === 'stock'">
|
|
<div v-show="currentTab === 'stock'">
|
|
|
- <StockTab />
|
|
|
|
|
|
|
+ <StockTab ref="stockTabRef" />
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div v-show="currentTab === 'orders'">
|
|
<div v-show="currentTab === 'orders'">
|
|
@@ -58,7 +58,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { defineAsyncComponent, ref, shallowRef } from "vue";
|
|
|
|
|
|
|
+import { defineAsyncComponent, ref, shallowRef, watch } from "vue";
|
|
|
import { useQuasar } from "quasar";
|
|
import { useQuasar } from "quasar";
|
|
|
|
|
|
|
|
import DefaultHeaderPage from "src/components/layout/DefaultHeaderPage.vue";
|
|
import DefaultHeaderPage from "src/components/layout/DefaultHeaderPage.vue";
|
|
@@ -74,6 +74,12 @@ const search = ref("");
|
|
|
const currentPage = ref(1);
|
|
const currentPage = ref(1);
|
|
|
const totalPages = ref(1);
|
|
const totalPages = ref(1);
|
|
|
const productsTabRef = shallowRef(null);
|
|
const productsTabRef = shallowRef(null);
|
|
|
|
|
+const stockTabRef = shallowRef(null);
|
|
|
|
|
+
|
|
|
|
|
+watch(currentTab, (tab) => {
|
|
|
|
|
+ if (tab === "products") productsTabRef.value?.fetchProducts();
|
|
|
|
|
+ if (tab === "stock") stockTabRef.value?.refresh();
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
const tabs = [
|
|
const tabs = [
|
|
|
{ name: "products", label: "Produtos" },
|
|
{ name: "products", label: "Produtos" },
|