Socket
Socket
Sign inDemoInstall

element-ui-types

Package Overview
Dependencies
5
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    element-ui-types

ElementUI typescript definition, element ui types


Version published
Weekly downloads
6
decreased by-25%
Maintainers
1
Install size
3.36 MB
Created
Weekly downloads
 

Readme

Source

Provide types support for ElementUI under Volar.

Install and usage

1. Install element-ui-types
npm i element-ui-types -D

# Or
pnpm add element-ui-types -D
2. Add the following configuration to tsconfig.json
// tsconfig.json
{
  "vueCompilerOptions": {
    "target": 2.7,
    // "target": 2, // For Vue version <= 2.6.14
  },
  "compilerOptions": {
    "types": ["element-ui-types"]
  }
}
3. Reload IDE

Demo

<template>
  <ElForm ref="formRef">
    ...
  </ElForm>
</template>

<script lang="ts" setup>
import { type Form } from 'element-ui'

const formRef = ref<InstanceType<typeof Form>>()

formRef.value?.validate(valid => {
  // `valid` is type of  `boolean`
})
</script>

Keywords

FAQs

Last updated on 15 Aug 2023

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