質問するログイン新規登録

質問編集履歴

1

情報の追加

2018/09/17 08:19

投稿

anonyrabbit
anonyrabbit

スコア78

title CHANGED
File without changes
body CHANGED
@@ -31,4 +31,49 @@
31
31
  users: state => state.users,
32
32
  user: state => state.user
33
33
  },
34
+ ```
35
+
36
+ **index.vue** 関係ありそうな部分のみ抜粋
37
+ ```Javascript
38
+ <template>
39
+ <div class="one-half column centered" v-else>
40
+ <div v-if="user" v-cloak>
41
+ <p>Information pulled from the firebase <code>/user</code> dataset</p>
42
+ <pre v-text="`${JSON.stringify(user, null, 2)}`"></pre>
43
+ from user: {{ user.displayName }}
44
+ from $store.state: {{ this.$store.state.user.displayName }}
45
+ uid {{ user.key }}
46
+ uid {{ this.user.key }}
47
+ </div>
48
+ </div>
49
+ </template>
50
+
51
+ <script>
52
+ export default {
53
+ // middleware: 'authenticated', // checking if auth'd with firebase kinda sucks as the middleware is triggered before firebase is ready
54
+
55
+ computed: {
56
+ ...mapState([
57
+ 'user'
58
+ ]),
59
+ ...mapGetters([
60
+ 'currentUser'
61
+ ]),
62
+ imageAlt() {
63
+ return `Profile image for ${this.user.displayName}`
64
+ }
65
+ },
66
+ data() {
67
+ return {
68
+ editing: false
69
+ }
70
+ },
71
+ methods: {
72
+ },
73
+ }
74
+ </script>
75
+
76
+
77
+
78
+
34
79
  ```