Socket
Socket
Sign inDemoInstall

element-plus

Package Overview
Dependencies
70
Maintainers
1
Versions
229
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    element-plus

A Component Library for Vue3.0


Version published
Weekly downloads
226K
decreased by-2.22%
Maintainers
1
Created
Weekly downloads
 

Package description

What is element-plus?

Element Plus is a Vue 3 UI library that provides a wide range of customizable components for building modern web applications. It is designed to be easy to use and integrate, offering a consistent and polished look and feel.

What are element-plus's main functionalities?

Form Components

Element Plus provides a variety of form components such as input fields, buttons, and form containers. This example demonstrates a simple login form with username and password fields.


<template>
  <el-form :model="form">
    <el-form-item label="Username">
      <el-input v-model="form.username"></el-input>
    </el-form-item>
    <el-form-item label="Password">
      <el-input type="password" v-model="form.password"></el-input>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">Submit</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  data() {
    return {
      form: {
        username: '',
        password: ''
      }
    };
  },
  methods: {
    onSubmit() {
      console.log('Form submitted:', this.form);
    }
  }
};
</script>

Data Display

Element Plus offers data display components like tables, which can be used to present data in a structured format. This example shows a simple table with columns for date, name, and address.


<template>
  <el-table :data="tableData">
    <el-table-column prop="date" label="Date" width="180"></el-table-column>
    <el-table-column prop="name" label="Name" width="180"></el-table-column>
    <el-table-column prop="address" label="Address"></el-table-column>
  </el-table>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        { date: '2016-05-02', name: 'John Smith', address: 'No. 1, Lake Park' },
        { date: '2016-05-04', name: 'Jane Doe', address: 'No. 2, Lake Park' }
      ]
    };
  }
};
</script>

Navigation

Element Plus includes navigation components such as menus, which can be used to create navigational structures for your application. This example demonstrates a horizontal menu with three items.


<template>
  <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
    <el-menu-item index="1">Home</el-menu-item>
    <el-menu-item index="2">About</el-menu-item>
    <el-menu-item index="3">Contact</el-menu-item>
  </el-menu>
</template>

<script>
export default {
  data() {
    return {
      activeIndex: '1'
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log('Selected menu item:', key);
    }
  }
};
</script>

Other packages similar to element-plus

Readme

Source


Element Plus - A Vue.js 3.0 UI library

  • 💪 Vue 3.0 Composition API
  • 🔥 Written in TypeScript

Status: Beta

This project is still under heavy development. Feel free to join us and make your first pull request.

Edit element-plus


Special thanks to the generous sponsorship by:



Documentation

You can find for more details, API, and other docs on https://element-plus.org

国内加速镜像站点

Join our Discord to start communicating with everybody.

Bootstrap project

With command

$ yarn bootstrap

the project will install all dependencies and run lerna bootstrap to initialize the project

Website preview

With command

$ yarn website-dev

the project will launch website for you to preview all existing component

You can also use this command to start a blank page to debug

$ yarn website-dev:play
//source file: ./website/play/index.vue

Component migration process

  1. Convert the item in https://github.com/element-plus/element-plus/projects/1 to an issue
  2. Assign yourself to the issue
  3. Author your component by generating new component command below
  4. Migrate tests and docs
  5. Open a new pull request, fill in the component issue link in 1

Generate new component

With command

$ yarn gen component-name

Note the component-name must be in kebab-case, combining words by replacing each space with a dash.

Commit template

With command

yarn cz

Example

[TYPE](SCOPE):DESCRIPTION#[ISSUE]
# example feat(button):add type 'button' for form usage #1234

FAQs

Last updated on 16 Dec 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc