function createProxy() {
const myArray = [Math.random(), Math.random()];
return new Proxy(myArray, {});
}
const myProxy = createProxy();
Run Code Online (Sandbox Code Playgroud)
如何访问这里的target(是myArray)myProxy?
我尝试了很多方法。在Google上搜索了许多博客文章,但没有找到目标的方法:(
我遇到的对象问题是,当我将对象分配给数据属性时,它会转换为代理对象。
\n这就是我正在做的事情
\n data() {\n return {\n msg: "",\n notifications: {},\n\n };\n },\n this.notifications = TokenService.getUserInfo().unread_notifications;\nRun Code Online (Sandbox Code Playgroud)\n这就是我接收对象的方式
\nProxy {0: {\xe2\x80\xa6}, 1: {\xe2\x80\xa6}, 2: {\xe2\x80\xa6}, 3: {\xe2\x80\xa6}, 4: {\xe2\x80\xa6}}\n[[Handler]]: Object\n[[Target]]: Array(5)\n[[IsRevoked]]: false\nRun Code Online (Sandbox Code Playgroud)\n是什么原因?
\n