快速开始
安装
安装之前请确保镜像源已切换到私服, 你可以使用以下命令切换源,也可以使用 nrm 管理你的镜像源
shell
npm config set registry https://npm.sinocare.com推荐使用 pnpm 作为包管理器,其中 ez-ui 依赖 element-plus 。
shell
pnpm add element-plus ez-ui使用
在入口文件引入样式及多语言配置, @sino/i18n 已集成 element-plus 词条
App.vue
vue
<template>
<el-config-provider :locale="zhCn">...</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 { zhCn } from '@sino/i18n'
</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>