用法:
首先引入对应的组件,注意这里不要用compoents,应该使用setUp
<script>
import { User } from "@element-plus/icons-vue";
import { Lock } from "@element-plus/icons-vue";
export default {
name: "Login",
setup(){
return {
User,Lock,
}
},
</script>
然后在<el-input>中使用
<el-form-item prop="username">
<el-input size="medium" :prefix-icon="User" style="margin: 10px 0" v-model="user.username"></el-input>
</el-form-item>