由于element-plus版本更新迭代较快,直接安装npm install element-plus -D会默认安装最新版本,使用时可能会报错:

Module not found: Error: Can't resolve 'element-plus/es/components/button/style/css'

可以安装这个稳定的版本:

npm i element-plus@1.3.0-beta.5 -D

就可以直接在vue文件中调用了:

<template>
  <el-row class="mb-4">
    <el-button>Default</el-button>
    <el-button type="primary">Primary</el-button>
    <el-button type="success">Success</el-button>
    <el-button type="info">Info</el-button>
    <el-button type="warning">Warning</el-button>
    <el-button type="danger">Danger</el-button>
  </el-row>
</template>

在这里插入图片描述

Logo

前往低代码交流专区

更多推荐