Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一种情况,我需要一个请求属性来识别子组件是从哪个容器组件呈现的。基于此,我正在改变子组件的行为。但是,我想在渲染子组件后清除请求属性。我如何一目了然地做到这一点?
您可以编写一个脚本(比如 clear.js)来清除请求变量:
/* * Clear request objects */ "use strict"; use([], function () { request.removeAttribute("variableName"); request.removeAttribute("variableName"); });
从您的代码中调用此脚本:
<sly data-sly-use="clear.js"> </sly>