草庐IT

categoryElements

全部标签

javascript - 像 'some ${string}' 这样的 ECMAScript 模板文字不起作用

我想尝试使用templateliterals它不起作用:它显示的是文字变量名称,而不是值。我正在使用Chromev50.0.2(和jQuery)。例子console.log('categoryName:${this.categoryName}\ncategoryElements:${this.categoryElements}');输出${this.categoryName}categoryElements:${this.categoryElements} 最佳答案 JavaScript模板文字需要反引号,而不是直引号。您需要使用反

javascript - 像 'some ${string}' 这样的 ECMAScript 模板文字不起作用

我想尝试使用templateliterals它不起作用:它显示的是文字变量名称,而不是值。我正在使用Chromev50.0.2(和jQuery)。例子console.log('categoryName:${this.categoryName}\ncategoryElements:${this.categoryElements}');输出${this.categoryName}categoryElements:${this.categoryElements} 最佳答案 JavaScript模板文字需要反引号,而不是直引号。您需要使用反