<template>
    <view style="padding-top: 150rpx;">
		<view v-html="html"></view>
	</view>
  </template>
  
  <script>
  export default {
    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
		})
    },
  };
  </script>