UNPKG
@hanxx/vue-hooks
Version:
latest (1.1.1)
1.1.1
1.1.0
1.0.2
1.0.1
⚡️ Awesome Vue Hooks
github.com/lianghx-319/vue-hooks
lianghx-319/vue-hooks
@hanxx/vue-hooks
/
esm
/
useStore.js
7 lines
(6 loc)
•
222 B
JavaScript
View Raw
1
2
3
4
5
6
7
import
{ computed, getCurrentInstance }
from
'@vue/composition-api'
;
export
default
function
useStore
(
) {
var
vm =
getCurrentInstance
();
var
store =
computed
(
function
(
) {
return
vm.
$store
; });
return
store; }