code: function (str, obj) {
        return str.replace(/\$\w+\$/gi, function (matchs) {
          var returns = obj[matchs.replace(/\$/g, "")];
          return typeof returns === "undefined" ? "" : returns;
        })
      }
docs: 简单模版