File tree Expand file tree Collapse file tree 3 files changed +9
-17
lines changed Expand file tree Collapse file tree 3 files changed +9
-17
lines changed Original file line number Diff line number Diff line change 11# Quasar 2 + Typescript + Overmind
22
3- Simple example of using Quasar 2 + TypeScript + Overmind 28 with connect
3+ Simple example of using Quasar v2 + TypeScript + Overmind v28 ( with [ connect() ] ( https://overmindjs.org/views/vue#connect ) )
44
5- - Quasar 2 < https://next. quasar.dev/ >
5+ - Quasar 2 < https://quasar.dev/ >
66- Overmind < https://www.overmindjs.org/ >
77- TypeScript < https://www.typescriptlang.org/ >
88
Original file line number Diff line number Diff line change 11<template >
22 <div class =" q-pb-lg" >
3- <q-btn round color =" primary" icon =" add" @click =" actions.inc " />
3+ <q-btn round color =" primary" icon =" add" @click =" increment " />
44 <span class =" bg-gray-200 text-xl ml-3 mr-3 q-mx-sm text-h6" >
5- Counter: {{ state. counter }}
5+ Counter: {{ counter }}
66 </span >
7- <q-btn round color =" primary" icon =" remove" @click =" actions.dec " />
7+ <q-btn round color =" primary" icon =" remove" @click =" decrement " />
88 </div >
99</template >
1010
@@ -14,18 +14,14 @@ import { connect, Context } from '../overmind';
1414
1515const Component = defineComponent ({
1616 name: ' SimpleCounter' ,
17- setup() {
18- // const state = hooks.state();
19- // const actions = hooks.actions();
20- // return { state, actions };
21- },
2217});
2318
2419// eslint-disable-next-line @typescript-eslint/no-unsafe-call
2520export default connect ((context : Context ) => {
2621 return {
27- state: context .state ,
28- actions: context .actions
22+ counter: context .state .counter ,
23+ increment: context .actions .inc ,
24+ decrement: context .actions .dec ,
2925 }
3026}, Component );
3127 </script >
Original file line number Diff line number Diff line change @@ -4,8 +4,6 @@ import { createConnect } from 'overmind-vue';
44import * as actions from './actions' ;
55import { state } from './state' ;
66
7- // import { createHooks } from 'overmind-vue/vue3';
8-
97export const config = {
108 state,
119 actions
@@ -21,7 +19,5 @@ export type Config = {
2119// TS 3.9 using a TYPE (not INTERFACE)
2220export type Context = IContext < Config >
2321
24- // export const hooks = createHooks()
25-
26- const overmind = createOvermind ( config , { devtools : false } ) ;
22+ const overmind = createOvermind ( config , { devtools : true } ) ;
2723export const connect = createConnect ( overmind )
You can’t perform that action at this time.
0 commit comments