easyadmin icon indicating copy to clipboard operation
easyadmin copied to clipboard

服务端的变量数据怎么传入到public的后台js上使用

Open potternice opened this issue 2 years ago • 5 comments

potternice avatar Jan 14 '23 12:01 potternice

封装控制器的assign,到页面上,比如一个bom上的json数据,再封装一个js方法获取。

最原始的方法是直接在对应的html上输出数据,然后再js上获取。再json一下

augushong avatar Jan 14 '23 14:01 augushong

我现在用这样子的处理,要么赋值到dom节点上,要么直接在html下设置js echo的变量,但是加载的时候存在在js的页面无法获取的问题,尤其是清除缓存的情况下,部分的变量直接没掉,导致js那边报错,感觉加载有点问题,尤其是用websocker的时候

potternice avatar Jan 15 '23 01:01 potternice

你这个思路没问题。应该是你代码实现有问题。

augushong avatar Jan 15 '23 01:01 augushong

菜单的点击怎么设置点击能进行页面数据的重载呀

potternice avatar Jan 15 '23 06:01 potternice