0 environment

System environment: Win10

1 Problem Description

Use render to search for createElement (render+if); use render to search for createElement (createElement); use render to search for createElement (createElement)

2 to solve

React uses the JSX syntax to render the Vue function. The JSX syntax is used to render the Vue function

1 corresponds to column

column: [
         
          {
            prop: "type".label: "Type".width: "100".render: (h, scope) = > {
              let type = "";
              let typeVal = "";

              if (scope.row.type === 0) {
                type = "";
                typeVal = "Directory";
              } else if (scope.row.type === 1) {
                type = "success";
                typeVal = "Menu";
              } else if (scope.row.type === 2) {
                type = "info";
                typeVal = "Button";
              }

              return (
                <el-tag size="small" type={type}>
                  {typeVal}
                </el-tag>); }},]Copy the code

2 Data in the corresponding column

data: [
          {
            type: 0}, {type: 0}, {type: 0.children: [{type: 1}, {type: 1,},],}, {type: 0}, {type: 0}, {type: 0],},Copy the code

3 the effect

3 summary

I only tried it on the table and it worked and I haven’t tried it anywhere else