//declare the property so that it can be used by ts
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$socket: SocketIOClient.Socket;
}
}
const app = createApp(App)
//mount app with the vue 3 global properties api
app.config.globalProperties.$socket = socket;
app.mount('#app')
Created
November 8, 2020 13:45
-
-
Save soulsam480/2c769cd156462f8add5c23d145566f85 to your computer and use it in GitHub Desktop.
Declaring custom instance properties in Vue 3 and typescript
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment