Element-ui2 uses render to render the contents of the columns in the table

I want to dynamically customize the contents of the columns in the table according to the value of tableKey in data. Different columns generate different contents, including different HTML tags. I don"t know how to do it, for example, how to replace the gender value in the table from 1 ~ 0 to Chinese characters for men and women, and add the tag el-tag, code as follows:

    <div id="app">
      <el-table :data="items" border>
            <el-table-column v-for="(item,key) in tableKey"                   
                     :key="key"
                     :prop="item.value"
                     :label="item.label" v-if="!item.tp">
                     </el-table-column>
      <el-table-column :key="key" :prop="item.value"  :label="item.label" v-else>
              <template slot-scope="scope" :render="item.render(scope.row)">

              </template>
      </el-table-column>
      </el-table>
    </div>
 <script>
     new Vue({
              el: "-sharpapp",
              data:{
                     items: [{ name: "steven", age: 36, sex: 1},
                                        {name: "xixi", age: 5, sex: 0}
                                        ],
                     visible : false,
                     value1: "",
                     tableKey: [
                               { label: "", value: "name", tp: false },
                               { label: "", value: "age", tp: false },
                               { label: "", value: "sex", tp: true,
                                  render: (h, parms) => {
                                      return h("el-tag", {
                                              props: {
                                                      type: "success",
                                                      size: "mini",
                                              },
                                   }, parms.row.status === 1 ? "" : "")
                                },
                             },
                      ],
             },
                        
                        
   })
 </script>
Jul.01,2021

did not find that template has the attribute render. This rendering function should not be used directly in the template.
if different columns display different content, you can use dynamic components

<el-table-column :key="key" :prop="item.value"  :label="item.label" v-else>
    <template slot-scope="scope">
        <component :is="item.component" :row="scope.row"></component>
    </template>
</el-table-column>
...
data: {
    return {
         tableKey: [
             { label: "", value: "name", tp: false },
             { label: "", value: "age", tp: false },
             { label: "", value: "sex", tp: true, component: "tagElem"}
         ]
    }
},
components: {
    "tagElem": {
         template: "<el-tag type='success' size='mini'>{{row.sex === 1 ? '':''}}</el-tag>",
         props: {row:{type: Object, required: true}}
    }
}

realization effect:
clipboard.png


tableKeyhtml select, tag:


Scoped slot row, column, $index storetable demo



image.png
image.png

can't show
Why
@ summer homework

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e55c75-44093.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e55c75-44093.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?