質問編集履歴
2
htmlを変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -32,12 +32,12 @@
|
|
32
32
|
|
33
33
|
html
|
34
34
|
```
|
35
|
-
|
35
|
+
<form v-on:submit.prevent="addMessage">
|
36
|
-
|
36
|
+
<textarea v-model="message.user_id" class="hidden" value="<%= @current_user.id %>"></textarea>
|
37
|
-
|
37
|
+
<textarea v-model="message.board_id" class="hidden" value="<%= @post.id %>"></textarea>
|
38
|
-
|
38
|
+
<input type="text" name="" v-model="message.contents" class="col-sm-8 form-control show_form"></textarea>
|
39
|
-
|
39
|
+
<button type="submit" name="button" class="btn btn-primary col-sm-3">送信</button>
|
40
|
-
</
|
40
|
+
</form>
|
41
41
|
```
|
42
42
|
|
43
43
|
エラー内容
|
1
jsのコード部分を新しいバージョンに変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,13 +2,11 @@
|
|
2
2
|
が、下記のエラーが出てしまい。。。refを上手く設定できていないんでしょうか?
|
3
3
|
|
4
4
|
```
|
5
|
-
import Vue from 'vue/dist/vue.esm';
|
6
|
-
import App from '../app.vue'
|
7
5
|
var Vue = require("vue");
|
8
6
|
var VueFire = require("vuefire");
|
9
7
|
var Firebase = require("firebase");
|
10
8
|
|
11
|
-
var firetalks =
|
9
|
+
var firetalks = firebase.database().ref('talks')
|
12
10
|
var chat = new Vue({
|
13
11
|
el: "#chat",
|
14
12
|
data: {
|
@@ -24,6 +22,9 @@
|
|
24
22
|
methods: {
|
25
23
|
addMessage: function(){
|
26
24
|
firetalks.push(this.message)
|
25
|
+
this.message.user_id = ''
|
26
|
+
this.message.board_id = ''
|
27
|
+
this.message.contents = ''
|
27
28
|
}
|
28
29
|
}
|
29
30
|
})
|