From 3520fb4a41a6293ed0a530483c9487bfd737e801 Mon Sep 17 00:00:00 2001 From: theia Date: Thu, 2 Feb 2023 06:47:20 -0500 Subject: Added other methods --- plugins/vue/plugin.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/vue/plugin.js b/plugins/vue/plugin.js index 2c61f40..b0fd134 100644 --- a/plugins/vue/plugin.js +++ b/plugins/vue/plugin.js @@ -16,11 +16,19 @@ export default { app.config.globalProperties.$graffitiID.value = graffiti.myID }) - // Add logging in and out - app.config.globalProperties.$graffitiToggleLogIn = - graffiti.toggleLogIn.bind(graffiti) + // Add static functions + const methodMapping = { + 'ToggleLogIn': 'toggleLogIn', + 'Update': 'update', + 'Tags': 'myTags', + 'ObjectByKey': 'objectByKey' + } + for (const key in methodMapping) { + app.config.globalProperties['$graffiti'+key] = + graffiti[methodMapping[key]].bind(graffiti) + } - // A composable for subscribing and + // A component for subscribing and // unsubscribing to tags that returns // a reactive array of the results app.component('GraffitiObjects', { -- cgit v1.2.3-70-g09d2