更新时间:2023-01-13 12:19:01
我认为这种方式是不可能的.如果要访问视图提供的某些数据,必须将其传递给 js 函数.
I don't think it's possible this way. If you want to access some data provided by the view, you have to pass it to the js function.
示例
js 文件:
my_cool_js_function(some_param){
// do some cool stuff
}
查看
// some html code
my_cool_js_function({{param}})
希望这有帮助:)