質問編集履歴
1
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -14,4 +14,27 @@
|
|
14
14
|
|
15
15
|
またwhite-space: nowrap; で隠れている部分の横幅のpxの取り方も不明です
|
16
16
|
|
17
|
-
よろしくお願いします。
|
17
|
+
よろしくお願いします。
|
18
|
+
|
19
|
+
回答を受けての追記
|
20
|
+
---
|
21
|
+
下記のようにしてみましたが、「this.$refs.scrollBox.scrollLeft is not a function」のエラーが出ます。
|
22
|
+
```
|
23
|
+
//子componentからemitでデータを送り <scroll>(←右・左に移動させるためのボタン) 内でイベント発火
|
24
|
+
<div v-else class="teachers border" id="teachers" ref="scrollBox">
|
25
|
+
<ul>
|
26
|
+
<li>
|
27
|
+
//省略
|
28
|
+
</li>
|
29
|
+
</ul>
|
30
|
+
<scroll @left-button="leftSlide" @right-button="rightSlide"></scroll>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
//js側
|
34
|
+
leftSlide : function(){
|
35
|
+
this.$refs.scrollBox.scrollLeft(300);
|
36
|
+
},
|
37
|
+
rightSlide : function () {
|
38
|
+
this.$refs.scrollBox.scrollRight(300);
|
39
|
+
}
|
40
|
+
```
|