elementui uses: render-header="renderHeader" method to add a button to the cell in the el-table header and report an error (Support for the experimental synt)

Screenshot of the error:

Solution""

1. First you need to download dependencies

npm install @vue/babel-preset-jsx @vue/babel-helper-vue-jsx-merge-props --save

2. After the download is complete, create a new .babelrc file in the project file (if not)

After the creation is complete, write the following code in the file:


{
  "presets": [
    ["@babel/preset-env", { "modules": false }],
    "@vue/babel-preset-jsx" // 支持jsx语法
  ],
  "plugins": [
    "@babel/plugin-proposal-class-properties"
   
  ]
}

 3. After the setting is complete, restart the project

success!

Guess you like

Origin blog.csdn.net/qq_46103732/article/details/127982379