You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.0 KiB
39 lines
1.0 KiB
"use strict"; |
|
const common_vendor = require("../../common/vendor.js"); |
|
const _sfc_main = { |
|
data() { |
|
return { |
|
arrs: [{ |
|
age: "13", |
|
name: "小绿", |
|
sex: "男" |
|
}, { |
|
age: "10", |
|
name: "小王", |
|
sex: "女" |
|
}], |
|
htmls: "<strong>Hello, {{name}}{{age}}{{sex}}!</strong>", |
|
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);
|
|
|