Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在es6模板字符串中使用此关键字并将该字符串传递给危险的HTML ` ${optionsList} `_Javascript_Reactjs_Contenteditable - Fatal编程技术网

Javascript 在es6模板字符串中使用此关键字并将该字符串传递给危险的HTML ` ${optionsList} `

Javascript 在es6模板字符串中使用此关键字并将该字符串传递给危险的HTML ` ${optionsList} `,javascript,reactjs,contenteditable,Javascript,Reactjs,Contenteditable,我想将类函数传递给onchange属性,但此模板字符串返回到危险的setinerhtml。因此它说,this.handleDropDown不是一个函数。 我不知道怎样才能通过考试 this.handledropdown不是一个函数拼写matters@CertainPerformance改变it@YashSharma您在构造函数中绑定了this.handleDropDown()吗?在react onchange中是这样写的onChange@SubhanshuPandey-我用的是胖箭operato

我想将类函数传递给onchange属性,但此模板字符串返回到
危险的setinerhtml
。因此它说,
this.handleDropDown不是一个函数
。 我不知道怎样才能通过考试


this.handledropdown不是一个函数
拼写matters@CertainPerformance改变it@YashSharma您在构造函数中绑定了this.handleDropDown()吗?在react onchange中是这样写的onChange@SubhanshuPandey-我用的是胖箭operator@SubhanshuPandey-但它被传递给AngerouslySetinerHTML,因此不能使用onChange
`<span>
        <span contentEditable="false">
          <select
              selected=${currentPlaceholder.selected.value}
              onchange ={this.handleDropDown(${index})}
              class="custom-dropdown"
          >
                ${optionsList}
          </select>
        </span>
      </span>`