【发布时间】:2019-08-02 20:03:24
【问题描述】:
我在 React 中有带有模板文字的变量:
const weatherForecast = `
Today in <strong>${this.state.cityName}</strong>
weather will be with <strong>${today.weather_state_name}</strong>,
min temperature <strong>${parseInt(today.min_temp)}°C</strong>,
max temperature <strong>${parseInt(today.max_temp)}°C</strong>,
and humidity will be <strong>${today.humidity}%</strong>
`;
我想在其中插入 HTML 代码,如您所见,它是 tag 。这可能吗,我该怎么做。我用谷歌搜索了它,但我找不到答案。
【问题讨论】:
标签: javascript reactjs template-literals