{"id":473,"date":"2023-02-25T13:44:17","date_gmt":"2023-02-25T05:44:17","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=473"},"modified":"2023-04-29T20:54:55","modified_gmt":"2023-04-29T12:54:55","slug":"js-replace-strings-with-placeholders","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/25\/js-replace-strings-with-placeholders\/","title":{"rendered":"JS\u4f7f\u7528\u5360\u4f4d\u7b26\u66ff\u6362\u5b57\u7b26\u4e32"},"content":{"rendered":"<p>JS\u4f7f\u7528\u5360\u4f4d\u7b26\u66ff\u6362\u5b57\u7b26\u4e32\u662f\u4e00\u4e2aES6\u4e2d\u7684\u6a21\u7248\u5b57\u7b26\u4e32\u8bed\u6cd5\u3002\u5728 <code>{% raw %}<\/code><code>{% endraw %}<\/code> \u4e2d\u4f7f\u7528 <code>${}<\/code><\/p>\n<p><!-- more --><\/p>\n<pre><code class=\"language-javascript\">var a = 5\nvar b = 10\nconsole.log(`Fifteen is ${a + b} and not ${2 * a + b}.`)\n\nFifteen is 15 and not 20.<\/code><\/pre>\n<pre><code class=\"language-javascript\">\/\/ \u67e5\u8be2\u7528\u6237\u8ba2\u5355\u5217\u8868\norder_list (pageIndex, pageSize, params) {\n  return Vue.http.get(`api\/order\/order_list\/${pageIndex}\/${pageSize}`, params)\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>JS\u4f7f\u7528\u5360\u4f4d\u7b26\u66ff\u6362\u5b57\u7b26\u4e32\u662f\u4e00\u4e2aES6\u4e2d\u7684\u6a21\u7248\u5b57\u7b26\u4e32\u8bed\u6cd5\u3002\u5728 {% raw %}{% endraw %} \u4e2d\u4f7f\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[84],"class_list":["post-473","post","type-post","status-publish","format-standard","hentry","category-frontend-basic","tag-javascript"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=473"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/473\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}