Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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,}}}

install

yarn add vue-function-api-extra

or

npm install vue-function-api-extra --save

Install Plugin

First 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

Use properties in context

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}}}

Helpers

useGetters

description

use Getters in Vuex

params

context

description: Setup Context invue-function-api

type: SetupContext

getters

description names of getters

type: string[]

example

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

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp