"use strict"; const common_vendor = require("../../common/vendor.js"); const _sfc_main = { data() { return { arrs: [{ age: "13", name: "小绿", sex: "男" }, { age: "10", name: "小王", sex: "女" }], htmls: "Hello, {{name}}{{age}}{{sex}}!", html: "", // keys:[], names: ["Alice", "Bob", "Charlie"] // 后端返回的数组 }; }, mounted() { this.arrs.map((item) => { let strhtml = JSON.parse(JSON.stringify(this.htmls)); for (let key in item) { strhtml = strhtml.replace(`{{${key}}}`, item[key]); } console.log(strhtml); this.html += strhtml; }); } }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return { a: $data.html }; } const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "F:/物流/logPm/pages/news/news.vue"]]); wx.createPage(MiniProgramPage);