回答編集履歴
1
コード修正
test
CHANGED
@@ -11,8 +11,6 @@
|
|
11
11
|
const data = ['logo.png','search.png','stock.png'] //本当は画像データを想定した文字列
|
12
12
|
|
13
13
|
|
14
|
-
|
15
|
-
type keyType = 'logo' | 'search';
|
16
14
|
|
17
15
|
interface objType {
|
18
16
|
|
@@ -40,15 +38,7 @@
|
|
40
38
|
|
41
39
|
if (keyN !== 'logo' && keyN !== 'search' ) return;
|
42
40
|
|
43
|
-
|
44
|
-
|
45
|
-
const imgName: keyType = keyN;
|
46
|
-
|
47
|
-
if(imgName === 'logo' || 'search') {
|
48
|
-
|
49
|
-
nameObj[
|
41
|
+
nameObj[keyN] = name;
|
50
|
-
|
51
|
-
}
|
52
42
|
|
53
43
|
|
54
44
|
|
@@ -58,10 +48,4 @@
|
|
58
48
|
|
59
49
|
|
60
50
|
|
61
|
-
console.log(nameObj);
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
51
|
```
|