In express+hbs, how do you define the routed data as a variable on the page?

when using express+hbs, routing incoming data needs to be used in the page js. My idea is to define the data as variables in the data, as follows:

clipboard.png

:

clipboard.png

clipboard.png

is this way of thinking wrong? Or can only write an interface, js directly request the interface to get data, ask for advice! Thank you

Feb.26,2021

var arr = {{JSON.stringify(layoutPage)}}
Menu