小编Agr*_*dha的帖子

在反应中调用组件构造函数内的函数?

我必须在构造函数中调用函数作为从回调工作,我必须包含在构造函数中,但这在构造函数中是“未定义的”。

class XXXXX extends React.Component {
        constructor(props) {
            super(props);
            this.state = 
            {
                chargebeeInstance : windowChargebeeinit({
                site: "xxxxxxxxxxxxx-test"})
            }

            this.statechargebeeInstancesetCheckoutCallbacks(function(){
                return{
                    close:function(){
                    this.moveToNextStep();
                }
            }

        })

        }
 moveToNextStep(){
this.props.jumpToNextStep(3);
}
Run Code Online (Sandbox Code Playgroud)

我无法调用 moveToNextStep 因为这是未定义的

reactjs

5
推荐指数
1
解决办法
2万
查看次数

WebUtility.HtmlEncode 和 AntiXssEncoder.HtmlEncode 有什么区别?

AntiXssEncoder.HtmlEncode 仅支持.Net 框架。当我们的应用程序位于 .net core 2.1 中时,我可以使用 WebUtility.HtmlEncode 进行 Antixss 吗?

c# antixsslibrary asp.net-core-2.1

3
推荐指数
1
解决办法
2786
查看次数

标签 统计

antixsslibrary ×1

asp.net-core-2.1 ×1

c# ×1

reactjs ×1