The value of Vue splicing variable

1. Do a project to get all the data at once, Then click the display list
through the tab panel to return the ret data as follows:
{"code": 200, "msg": "query success", "time": "1543567309", "data":
{"a": [{"id": 10, "type": "a", "qa": "Animal extract"}, {"id": 5, "type": "a", "qa": "Chemical Daily Chemical"}],
"d": [{"id" "type": "d", "qa": "Feed material"}, {"id": 7, "type": "d", "qa": "21312312"}],
"s": [{"id": 9, "type": "s", "qa": "Plant extract"}, {"id": 6, "type": "s", "qa": "Test Interface data"}],
"w": [{"id": 8, "type" "qa": "Test packet data 111l"}, {"id": 4, "type": "w", "qa": "Pharmaceutical Raw material data"}}
vm assigned as vm.lists = ret.data;
the logo of the tab panel is in turn:
the vm.lists.an is taken out when you click tab a, and because the subscript index, is returned when you click, the data is spliced
setting variable var tabs = ["a gift, force, and memory,"],

, the setting variable,

, and so on, the vm.lists.an is taken out, and the data is stitched together because the subscript is returned when you click on it.

when you click to pull out the data, the spliced tabs is vm.lists.tabs [index]; the actual printed data is empty
but the vm.lists.a has the data directly
ask the boss to explain why

problem description

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?


is not = "vm.listings [tables];


vm.lists.tabs is to take the tabs attribute in lists, and lists has no tabs attribute, so return undefined, and run the following [index] will report an error. It is also magical for you to print out empty data here and change it to: vm.lists [tabs [index]]

.
Menu