嗨,任何人都可以告诉我,我怎么能只做占位符斜体,但当有人在测试盒内写字时,书面文字不应该有斜体.
mycode的:
<input type="text" id="search" placeholder="Search" style="font-style:italic">
Run Code Online (Sandbox Code Playgroud)
我怎么能把斜体放在占位符上而不是整个输入?
我们都知道我们需要在React中绑定函数以使其起作用。我知道为什么我们需要绑定它。
但是我不确定为什么我们不需要绑定箭头功能。
示例:使用箭头功能(无需绑定)
handleClick = () => {
this.setState({
isToggleOn: !this.state.isToggleOn
});
Run Code Online (Sandbox Code Playgroud)
};
现在,使用功能(需要绑定)
this.handleClick = this.handleClick.bind(this);
handleClick() {
this.setState({
isToggleOn: !this.state.isToggleOn
});
Run Code Online (Sandbox Code Playgroud)
};
我不是在问为什么我们需要绑定功能。我只想知道为什么箭头功能不需要绑定。
谢谢。
For simple html projects i can simple refer this link.
But I'm trying to implement in react app . So I'm not able to replicate the code in react app.
componentDidMount() {
googleTranslateElementInit(() => {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
});
const script = document.createElement("script");
script.src = "//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit";
script.async = true;
document.body.appendChild(script);
}
Run Code Online (Sandbox Code Playgroud)
And return render element .
render() {
return (
<div id="google_translate_element"></div>
);
}
Run Code Online (Sandbox Code Playgroud)
This is showing me error saying google , googleTranslateElementInit is not defined.
How can …
我们假设我的列表是这样的:
List<List<string>> zz = new List<List<string>>() { new List<string>{"1","2","3"}, new List<string> { "4", "5", "6" } };
Run Code Online (Sandbox Code Playgroud)
我想要一个列表作为输出如下:
List<string> finalList = new List<string>{"1","2","3","4", "5", "6"};
Run Code Online (Sandbox Code Playgroud)
我该如何做到这一点?