Skip to content

Quick Start

Installation

Before installing, make sure to switch your registry to a private one. You can switch the registry using the following command, or use nrm to manage your registries:

shell
npm config set registry https://npm.sinocare.com

It is recommended to use pnpm as your package manager. ez-ui depends on element-plus.

shell
pnpm add element-plus ez-ui

Usage

Import styles and configure localization in your entry file

App.vue

vue
<template>
  <el-config-provider :locale="locale">...</el-config-provider>
</template>
<script setup lang="ts">
import 'element-plus/dist/index.css'
import 'ez-ui/dist/style.css'
import { ElConfigProvider } from 'element-plus'
import elZhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { zhCn as ezZhCn } from '@sino/i18n'
const locale = { ...elZhCn, ...ezZhCn }
</script>

demo.vue

vue
<template>
  <div>
    <el-button type="primary" @click="flag = !flag">Dialog</el-button>
    <ez-dialog v-model="flag">
      <div>dialog content</div>
    </ez-dialog>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { EzDialog } from 'ez-ui'
const flag = ref(false)
</script>

Released under the MIT License