{"id":23127445,"url":"https://github.com/chrisbing/vue-function-api-extra","last_synced_at":"2025-04-04T05:42:00.863Z","repository":{"id":47978004,"uuid":"203159662","full_name":"chrisbing/vue-function-api-extra","owner":"chrisbing","description":"Providing plugin and helper functions for vue-function-api, so that we can use vue-route, vuex, mixins, prototype helpers ...","archived":false,"fork":false,"pushed_at":"2021-08-11T09:16:29.000Z","size":24,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T16:04:06.948Z","etag":null,"topics":["vue","vue-function-api"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrisbing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-19T11:31:29.000Z","updated_at":"2019-08-25T04:10:17.000Z","dependencies_parsed_at":"2022-08-12T15:41:35.196Z","dependency_job_id":null,"html_url":"https://github.com/chrisbing/vue-function-api-extra","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisbing%2Fvue-function-api-extra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisbing%2Fvue-function-api-extra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisbing%2Fvue-function-api-extra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisbing%2Fvue-function-api-extra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisbing","download_url":"https://codeload.github.com/chrisbing/vue-function-api-extra/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128743,"owners_count":20888234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["vue","vue-function-api"],"created_at":"2024-12-17T09:10:07.685Z","updated_at":"2025-04-04T05:42:00.839Z","avatar_url":"https://github.com/chrisbing.png","language":"TypeScript","readme":"# vue-function-api-extra\n\nProviding plugin and helper functions for [vue-function-api](https://github.com/vuejs/vue-function-api), so that we can use vue-route, vuex, helpers in prototype ...\n\n```js\n\nimport { useGetters } from 'vue-function-api-extra'\nimport {\n    value,\n} from 'vue-function-api'\n\nexport default {\n    setup(props, context){\n        \n        const getters = useGetters(context, ['userInfo', 'otherGetter'])\n        \n        // use route\n        const route = context.route\n        const id = value(route.params.id)\n        const goBack = () =\u003e {\n            context.router.goBack()\n        }\n        \n        // use store\n        const store = context.store\n        \n        // use properties\n        // if you run \"Vue.prototype.$isAndroid = true\" before\n        const isAndroid = context.isAndroid\n        \n        \n        return {\n            ...getters,\n            id,\n            goBack,\n        }\n    }\n    \n}\n\n```\n\n# install\n\n```\nyarn add vue-function-api-extra\n```\n\nor\n\n```\nnpm install vue-function-api-extra --save\n```\n\n# Install Plugin\n\nFirst you should install the plugins.\n\n**Notice: You should install the plugin before other plugins installed**\n\n```js\n\nimport Vue from 'vue'\nimport { plugin } from 'vue-function-api-extra'\n\nVue.use(plugin)\n\n// use other plugins\n\n```\n\n# Use properties in context\n\n```js\nexport default {\n    setup(props, context){\n        \n        // use route\n        const route = context.route\n        \n        // use store\n        const store = context.store\n        \n        // use properties\n        // if you run \"Vue.prototype.$isAndroid = true\" before\n        const isAndroid = context.isAndroid\n        \n        return {\n            ...getters\n        }\n    }\n    \n}\n```\n\n\n# Helpers\n\n## useGetters\n\n### description\n \nuse Getters in Vuex\n\n### params\n\n#### context\n\n**description:** Setup Context in ```vue-function-api``` \n\n**type:** SetupContext\n\n\n#### getters\n\n**description** names of getters\n\n**type:** string[]\n\n### example\n\n```js\nimport { useGetters } from 'vue-function-api-extra'\n\nexport default {\n    setup(props, context){\n        \n        const getters = useGetters(context, ['userInfo', 'otherGetter'])\n\n        return {\n            ...getters\n        }\n    }\n    \n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisbing%2Fvue-function-api-extra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisbing%2Fvue-function-api-extra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisbing%2Fvue-function-api-extra/lists"}