• Stars
    star
    128
  • Rank 281,044 (Top 6 %)
  • Language Vue
  • License
    MIT License
  • Created almost 2 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Element Plus module for Nuxt

Element Plus Nuxt

Element Plus module for Nuxt

Features

  • Automatically import components and styles on demand.
  • Automatically import directives and styles on demand.
  • Automatically import icons from @element-plus/icons-vue.
  • Automatically import of ElMessage, ElNotification and other methods.
  • Automatically inject the ID_INJECTION_KEY into Vue.
  • Automatically inject the teleport markup into the correct location in the final page HTML.

Installation

npm i element-plus @element-plus/nuxt -D
export default defineNuxtConfig({
  modules: [
    '@element-plus/nuxt'
  ],
  elementPlus: { /** Options */ }
})

Usage

<template>
  <el-button @click="ElMessage('hello')">button</el-button>
  <ElButton :icon="ElIconEditPen" type="success">button</ElButton>
  <LazyElButton type="warning">lazy button</LazyElButton>
</template>

Reference Nuxt documentation and playground use.

Options

importStyle

  • Type: 'css' | 'scss' | boolean
  • Default: css

import style css or sass(scss) with components, disable automatically import styles with false.

themes

  • Type: array

A list of themes that require import styles automatically.

e.g. ['dark']

icon

  • Type: string | false
  • Default: ElIcon

Icon prefix name, disable automatically import icon with false.

namespace

  • Type: string
  • Default: el

When you change the global namespace, you must change it here as well.

injectionID

  • Type: object
  • Default: { prefix: 1024, current: 0 }

Automatically inject the ID_INJECTION_KEY into Vue.

injectionZIndex

  • Type: object
  • Default: { current: 0 }

Automatically inject the Z_INDEX_INJECTION_KEY into Vue.

appendTo

  • Type: array

When you modify the append-to props in all based on ElTooltip components, you need to add the value here.

components

  • Type: array

If there are components that are not imported automatically from Element Plus, you need to add the component name here.

e.g. ['ElSubMenu']

subComponents

  • Type: object

A map of components that the definition file of subComponent is in its parent component.

directives

  • Type: object

If there are directives that are not imported automatically from Element Plus, you need to add the directive name here.

imports

  • Type: array

If you wish to add automatically import content from Element Plus, you can add it here.

noStylesComponents

  • Type: array

When a component incorrectly loads styles, you need to add the component name here.

include

  • Type: array
  • Default: [ /\.vue$/, /\.vue\?vue/, /\.vue\?v=/, /\.((c|m)?j|t)sx?$/]

Include files that need to automatically import styles.

exclude

  • Type: array
  • Default: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/]

Exclude files that do not require the automatic import of styles.

Template

element-plus-nuxt-starter

Development

  • Run pnpm i to install the dependencies.
  • Run pnpm dev:prepare to generate type stubs.
  • Run pnpm dev to start playground in development mode.
  • Run pnpm dev:build to build playground.
  • Run pnpm dev:start to locally preview playground.
  • Run pnpm build to build this project.

More Repositories

1

element-plus

πŸŽ‰ A Vue.js 3 UI Library made by Element team
TypeScript
24,417
star
2

element-plus-vite-starter

🌰 A starter kit for Element Plus with Vite
Vue
1,123
star
3

element-plus-nuxt-starter

🌰 A starter example for element-plus with Nuxt 3.
Vue
295
star
4

unplugin-element-plus

πŸ”Œ Import Element Plus on demand. Support Vite, Webpack, Vue CLI, Rollup and esbuild.
TypeScript
185
star
5

element-plus-playground

Element Plus Playground
TypeScript
174
star
6

element-plus-icons

Main package for storing Element Plus icon resources.
TypeScript
142
star
7

element-plus-vue-cli-starter

A starter kit for Element Plus generated by vue-cli
Vue
127
star
8

vue-cli-plugin-element-plus

Element Plus plugin for @vue/cli 4.5
JavaScript
122
star
9

element-plus-interactive-docs

πŸŽ‰ [WIP] Element Plus Interactive Docs
Vue
62
star
10

element-plus-in-laravel-starter

Laravel Project with Vue3 and Element Plus
JavaScript
24
star
11

vite-plugin-element-plus

This repo is for element-plus related Vite plugin
TypeScript
15
star
12

theme-chalk-preview

Preview and download custom Element Plus theme-chalk.
TypeScript
7
star
13

element-plus-issue-helper

Issue helper for Element Plus
Vue
6
star
14

colors

🎨 This repository is meant for build color utils for theme customization
TypeScript
6
star
15

design-materials

5
star
16

headless

Headless code for components
3
star
17

doc-archive

Old document website backup
JavaScript
3
star
18

el-context-menu

The main repository for el-context-menu built upon ElementPlus
2
star
19

element-plus-webpack5-starter

🌰 A starter kit for Element Plus with Webpack 5.
TypeScript
1
star
20

staging

development website of element-plus
HTML
1
star