Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

element-ui

Package Overview
Dependencies
Maintainers
11
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

element-ui

A Component Library for Vue.js.

  • 2.15.14
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
11
Created

What is element-ui?

Element UI is a Vue 2.0-based component library for developers, designers, and product managers. It provides a comprehensive set of UI components to build rich and interactive web applications.

What are element-ui's main functionalities?

Form

Element UI provides a robust form component that includes form items, input fields, and buttons. 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>

Table

The table component in Element UI allows for the display of data in a tabular format. This example shows a 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. 1518, Jinshajiang Road, Putuo District, Shanghai'
      }, {
        date: '2016-05-04',
        name: 'Jane Doe',
        address: 'No. 1518, Jinshajiang Road, Putuo District, Shanghai'
      }]
    };
  }
};
</script>

Dialog

Element UI's dialog component is used to create modal dialogs. This example demonstrates a simple dialog that can be opened by clicking a button.

<template>
  <el-button type="text" @click="dialogVisible = true">Open Dialog</el-button>
  <el-dialog title="Hello, world" :visible.sync="dialogVisible">
    <p>Try Element</p>
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      dialogVisible: false
    };
  }
};
</script>

Other packages similar to element-ui

Keywords

FAQs

Package last updated on 24 Aug 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc