mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
Vue Store (#8071)
* vue: use our own store in place of vuex * vue store: add getters, watcher and use internal vue instance * vue store: better state getter and credits to Vuex * vue store: $watch -> watch * vuex store: pass store to getters and fix typos * add comments to store, start writing tests * fix unit tests and add missing ones * cleanup components, add less folder, fetch tassks * use Vuex helpers * pin vuex version * move semantic-ui theme to assets/less, keep website/build empty but in git * import helpers from vuex
This commit is contained in:
24
website/client/components/appHeader.vue
Normal file
24
website/client/components/appHeader.vue
Normal file
@@ -0,0 +1,24 @@
|
||||
<template lang="pug">
|
||||
#app-header
|
||||
h1 {{title}}
|
||||
ul
|
||||
li
|
||||
router-link(to='/') Home
|
||||
li
|
||||
router-link(to='/page') Another Page
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from '../store';
|
||||
|
||||
export default {
|
||||
computed: mapState(['title']),
|
||||
};
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
<style scoped>
|
||||
h1 {
|
||||
color: #42b983;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user