Skip to content

Commit 5cf42e6

Browse files
Merge pull request #15 from sduduzog/main
Update dependencies and bump version code
2 parents 56edca7 + d528e86 commit 5cf42e6

File tree

9 files changed

+873
-845
lines changed

9 files changed

+873
-845
lines changed

README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
A supa simple wrapper around Supabase.js to enable usage within Vue.
44

55
## Installation
6+
67
```bash
78
# Vue 3.x
89
yarn add vue-supabase
@@ -14,14 +15,16 @@ yarn add @vue/composition-api vue-supabase
1415
Note: Currently `@vue/composition-api` is required for this package to work for projects using Vue 2.x.
1516

1617
## Usage
18+
1719
### Vue 2.x
20+
1821
```js
19-
import VueSupabase from 'vue-supabase'
22+
import VueSupabase from "vue-supabase";
2023

2124
Vue.use(VueSupabase, {
22-
supabaseUrl: '',
23-
supabaseKey: '',
24-
supabaseOptions: {}
25+
supabaseUrl: "",
26+
supabaseKey: "",
27+
supabaseOptions: {},
2528
});
2629
```
2730

@@ -30,6 +33,7 @@ const { data, error } = await this.$supabase.from("events").select("*");
3033
```
3134

3235
### Vue 3.x
36+
3337
```js
3438
import VueSupabase from 'vue-supabase'
3539

@@ -45,15 +49,28 @@ app.mount(...)
4549
```
4650

4751
#### Options API
52+
4853
```js
4954
const { data, error } = await this.$supabase.from("events").select("*");
5055
```
5156

5257
#### Composition API
58+
5359
```js
54-
import { useSupabase } from 'vue-supabase';
60+
import { useSupabase } from "vue-supabase";
5561

56-
const supabase = useSupabase()
62+
const supabase = useSupabase();
5763

5864
const { data, error } = await supabase.from("events").select("*");
5965
```
66+
67+
Here are a couple of composables available with Vue 3.x or Vue 2.x + Composition API
68+
69+
```js
70+
import { useSuabaseAuth, useSupabaseStorage } from "vue-supabase";
71+
72+
const auth = useSupabaseAuth();
73+
const storage = useSupabaseStorage();
74+
const { data } = await storage.listBuckets();
75+
await auth.signOut();
76+
```

examples/vue2-demo/src/components/HelloWorld.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ import { Component, Prop, Vue } from "vue-property-decorator";
9191
9292
@Component
9393
export default class HelloWorld extends Vue {
94-
@Prop() private msg!: string;
94+
@Prop() public msg!: string;
9595
9696
mounted() {
97-
console.log("mounted with supabase: ", !!this.$supabase);
97+
// console.log("mounted with supabase: ", !!this.$supabase);
9898
}
9999
}
100100
</script>

examples/vue2-demo/tsconfig.json

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,11 @@
1212
"allowSyntheticDefaultImports": true,
1313
"sourceMap": true,
1414
"baseUrl": ".",
15-
"types": [
16-
"webpack-env"
17-
],
15+
"types": ["webpack-env"],
1816
"paths": {
19-
"@/*": [
20-
"src/*"
21-
]
17+
"@/*": ["src/*"]
2218
},
23-
"lib": [
24-
"esnext",
25-
"dom",
26-
"dom.iterable",
27-
"scripthost"
28-
]
19+
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
2920
},
3021
"include": [
3122
"src/**/*.ts",
@@ -34,7 +25,5 @@
3425
"tests/**/*.ts",
3526
"tests/**/*.tsx"
3627
],
37-
"exclude": [
38-
"node_modules"
39-
]
28+
"exclude": ["node_modules"]
4029
}

examples/vue2-demo/yarn.lock

Lines changed: 647 additions & 639 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)