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

質問編集履歴

2

mod

2017/07/07 08:50

投稿

namenamenameko
namenamenameko

スコア234

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

2017/07/07 08:50

投稿

namenamenameko
namenamenameko

スコア234

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
- data: {
13
+ data: {
13
- stationExists: true
14
+ stationExists: true
14
- }
15
+ }
15
- methods: {
16
+ methods: {
16
- switchStation: ->
17
+ switchStation: ->
17
- stationExists = !@.$data.stations.length == 0
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}