Skip to content

Commit 41ece7d

Browse files
authored
docs: upd vue example with script setup
1 parent 2a909f9 commit 41ece7d

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

README.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Use it
7272
GoogleAuth.signIn();
7373
```
7474

75-
#### AngularFire2
75+
#### Angular
7676

7777
init hook
7878

@@ -101,27 +101,20 @@ async googleSignIn() {
101101

102102
#### Vue 3
103103

104-
```ts
105-
// App.vue
106-
import { defineComponent, onMounted } from 'vue';
107-
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';
108-
109-
export default defineComponent({
110-
setup() {
111-
onMounted(() => {
112-
GoogleAuth.initialize();
113-
});
104+
```vue
105+
<script setup lang="ts">
106+
import { defineComponent, onMounted } from 'vue'
107+
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth'
114108
115-
const logIn = async () => {
116-
const response = await GoogleAuth.signIn();
117-
console.log(response);
118-
};
109+
onMounted(() => {
110+
GoogleAuth.initialize();
111+
})
119112
120-
return {
121-
logIn,
122-
};
123-
},
124-
});
113+
async function logIn() {
114+
const response = await GoogleAuth.signIn();
115+
console.log(response);
116+
}
117+
</script>
125118
```
126119

127120
or see more [CapacitorGoogleAuth-Vue3-example](https://github.com/reslear/CapacitorGoogleAuth-Vue3-example)

0 commit comments

Comments
 (0)