Skip to content
This repository was archived by the owner on Jun 27, 2024. It is now read-only.

Commit b6ce299

Browse files
committed
Optional inertia prop
1 parent 8f38e9d commit b6ce299

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

js/Components/Table.vue

+12-3
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,21 @@ import isEqual from "lodash-es/isEqual";
209209
import map from "lodash-es/map";
210210
import pickBy from "lodash-es/pickBy";
211211
212-
const app = getCurrentInstance()
213-
const $inertia = app.appContext.config.globalProperties.$inertia;
214-
215212
const props = defineProps({
213+
inertia: {
214+
type: Object,
215+
default: () => {
216+
return {};
217+
},
218+
required: false,
219+
},
220+
216221
name: {
217222
type: String,
218223
default: "default",
219224
required: false,
220225
},
226+
221227
striped: {
222228
type: Boolean,
223229
default: false,
@@ -267,6 +273,9 @@ const props = defineProps({
267273
},
268274
});
269275
276+
const app = getCurrentInstance()
277+
const $inertia = app ? app.appContext.config.globalProperties.$inertia : props.inertia;
278+
270279
const updates = ref(0)
271280
272281
const queryBuilderProps = computed(() => {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@protonemedia/inertiajs-tables-laravel-query-builder",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Inertia.js Front-end Components for Spatie's Laravel Query Builder",
55
"author": "Pascal Baljet <[email protected]>",
66
"license": "MIT",

0 commit comments

Comments
 (0)