質問編集履歴
2
mod
title
CHANGED
File without changes
|
body
CHANGED
@@ -22,4 +22,8 @@
|
|
22
22
|
で適当なタイミングでswitchStation()が発動するのですが、
|
23
23
|
ブラウザのコンソールでinvalid expression: v-bind:class='{text-danger:stationExists}
|
24
24
|
と言われて表示されません、、
|
25
|
-
そもそも問題の切り分けが不確かなのですが、HTML(Slim)の構文エラーなのか、JS側のバグの可能性もあるのかわかっていませんが、何か違わないかチェックしていただけると嬉しいです。
|
25
|
+
そもそも問題の切り分けが不確かなのですが、HTML(Slim)の構文エラーなのか、JS側のバグの可能性もあるのかわかっていませんが、何か違わないかチェックしていただけると嬉しいです。
|
26
|
+
|
27
|
+
追記:
|
28
|
+
こちらはVue1.xならv-bind:class='{'text-danger':stationExists},
|
29
|
+
2.xならv-bind:class='{'text-danger':stationExists}というように記法が分かれているのでしょうか?
|
1
mod
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,16 +7,17 @@
|
|
7
7
|
```
|
8
8
|
|
9
9
|
```CoffeeScript
|
10
|
+
$ ->
|
10
|
-
new Vue(
|
11
|
+
new Vue(
|
11
|
-
|
12
|
+
...
|
12
|
-
|
13
|
+
data: {
|
13
|
-
|
14
|
+
stationExists: true
|
14
|
-
|
15
|
+
}
|
15
|
-
|
16
|
+
methods: {
|
16
|
-
|
17
|
+
switchStation: ->
|
17
|
-
|
18
|
+
stationExists = !@.$data.stations.length == 0
|
18
|
-
|
19
|
+
}
|
19
|
-
)
|
20
|
+
)
|
20
21
|
```
|
21
22
|
で適当なタイミングでswitchStation()が発動するのですが、
|
22
23
|
ブラウザのコンソールでinvalid expression: v-bind:class='{text-danger:stationExists}
|