The question of Mini Program's Modularization

I have a tab bar in index.wxml, and when I switch tabview, I load the custom template template. At present, we encounter a problem: because the multiple template template under the tab column have a lot of data, it is too complicated to deal with it uniformly in index.js. Is there a good way to introduce a proprietary js scope to the template template corresponding to each tabview, and the data interaction in a single template is handled by its own template.js?

clipboard.png
if the tabview, in the red circle in the figure has different template data, it must be very complicated to deal with each template, separately and put the processing method of each template directly into the index.js. How to separate them and correspond one to one?
is the same as the structure of each page file in Mini Program"s:

detail
    detail.js
    detail.wxml
index
    index.js
    index.wxml

but not a separate page, but a custom template template?
can also be equivalent to embedding an iframe page in a web page, and the iframe page has its own js scope, but in Mini Program, since there is no iframe component, I made a template corresponding to the tan column switch of a page

.

Please advise

Apr.14,2021

Hello, when the wepy, framework we use now is introduced into the module, you can pull the data of your tabview module and pass it to this component, and the corresponding data formats can be handled separately within the component.


just contacted Mini Program to do the project according to the document. At present, there is no corresponding way to deal with this problem in the document, so I would like to ask you how to deal with similar problems? Have I ever thought of creating multiple template.js, under the index folder and then introducing each template.js, into the index.js, but it doesn't seem to be very good to handle


custom components? hands-on teaching you to implement custom components in Mini Program

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35aac-2bfc6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35aac-2bfc6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?