質問編集履歴
2
find関数にthisをつけて、returnで値を返すようにしましたが、<Product.vue> での値の受け取り方がわかりません。。
test
CHANGED
File without changes
|
test
CHANGED
@@ -106,11 +106,9 @@
|
|
106
106
|
|
107
107
|
asyncFind(id) {
|
108
108
|
|
109
|
-
let vm = this;
|
110
|
-
|
111
109
|
setTimeout(() => {
|
112
110
|
|
113
|
-
|
111
|
+
return this.find(id) // callbackを削除してfind関数を配置
|
114
112
|
|
115
113
|
}, 1000)
|
116
114
|
|
1
find関数の前のthisの参照を、変更しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -106,9 +106,11 @@
|
|
106
106
|
|
107
107
|
asyncFind(id) {
|
108
108
|
|
109
|
+
let vm = this;
|
110
|
+
|
109
111
|
setTimeout(() => {
|
110
112
|
|
111
|
-
|
113
|
+
vm.find(id) // callbackを削除してfind関数を配置
|
112
114
|
|
113
115
|
}, 1000)
|
114
116
|
|