在我的应用程序中,我有一个H自定义组件,它接受一个标题和一个子标题作为props .
对于我的header prop,我想将lodash表达式与字符串连接起来.请参见下面的我的代码.
<H
header= `${_.startCase(type)} SomeString`
subheader= "Lorem ipsum do eiusmod"
/>
我在这里try 了https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals条建议,但可能因为我使用的是lodash,所以不起作用.