- Notifications
You must be signed in to change notification settings - Fork0
Providing plugin and helper functions for vue-function-api, so that we can use vue-route, vuex, mixins, prototype helpers ...
License
NotificationsYou must be signed in to change notification settings
chrisbing/vue-function-api-extra
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Providing plugin and helper functions forvue-function-api, so that we can use vue-route, vuex, helpers in prototype ...
import{useGetters}from'vue-function-api-extra'import{value,}from'vue-function-api'exportdefault{setup(props,context){constgetters=useGetters(context,['userInfo','otherGetter'])// use routeconstroute=context.routeconstid=value(route.params.id)constgoBack=()=>{context.router.goBack()}// use storeconststore=context.store// use properties// if you run "Vue.prototype.$isAndroid = true" beforeconstisAndroid=context.isAndroidreturn{ ...getters, id, goBack,}}}
yarn add vue-function-api-extraor
npm install vue-function-api-extra --saveFirst you should install the plugins.
Notice: You should install the plugin before other plugins installed
importVuefrom'vue'import{plugin}from'vue-function-api-extra'Vue.use(plugin)// use other plugins
exportdefault{setup(props,context){// use routeconstroute=context.route// use storeconststore=context.store// use properties// if you run "Vue.prototype.$isAndroid = true" beforeconstisAndroid=context.isAndroidreturn{ ...getters}}}
use Getters in Vuex
description: Setup Context invue-function-api
type: SetupContext
description names of getters
type: string[]
import{useGetters}from'vue-function-api-extra'exportdefault{setup(props,context){constgetters=useGetters(context,['userInfo','otherGetter'])return{ ...getters}}}
About
Providing plugin and helper functions for vue-function-api, so that we can use vue-route, vuex, mixins, prototype helpers ...
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.