When Xiaobai used element plus, an error occurred when he copied the official website code directly to the compiler. After checking the problem, he found that the problem lies in <script lang="ts" setup>, and element plus does not support the lang="ts" syntax.
Questions are as follows,
Module parse failed: The keyword "interface' is reserved (2:0)
The screenshot is shown below,
After checking the information, I found a solution, which I will record here.
- First install typescript ts-loader,
npm install -D typescript ts-loader
- Then, follow this tutorial and you will be able to solve it.