问题描述
我正在使用Update(){
Movement();
ChangeDirection();
}
void Movement(){
//move object every frame without any conditions. Don't use GetMouseButtonDown() here****
}
void ChangeDirection(){
if(GetMouseButtonDown(0)){
//Change the direction of object. For example,if it currently goes to the
//left,set the direction to the right. Because your Movement() works every
//frame,just changing the direction to the opposite is will be enough.
}
}
来实现。
我正在使用lightning-web-components
将不同的样式应用于多行。
此处,<div contenteditable>
和assetSerialNumber
在js的assetLocation
方法中填充。
我在课堂上使用connectedcallback()
来使divTextarea
看起来像div
一样正常。
textarea
.html file
<div id="divcontenteditable" class="divTextarea slds-textarea" contenteditable onkeyup={handleChange}>
<p>Device request: {assetSerialNumber}</p>
<p>Device location {assetLocation}</p>
</div>
.js file
方案1:如果我将任何文本添加到handleChange(event) {
var input = this.template.querySelector(".divTextarea");
console.log(input.innerText);
console.log(input.textContent);
}
下的<p>
标签中,则<div contenteditable>
方法将能够检索更新的文本值。 / p>
方案2:如果我按handleChange
并开始输入,则我无法获取更新的文本。每次按下ENTER
时,都会在ENTER
下添加一个新的<p>
,如下所示,并且<div contenteditable>
方法仍然返回原始文本。
handleChange
如何实现方案2,即在新行中添加文本时获取更新的内容。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)