快速开始
特性
- 支持 easycom 自动导入
- 基于 Vue 3
<script setup>+ TypeScript - 支持微信小程序、Uni-app 等平台
安装
npm install @rao2126340634/yt-ui
# 或
pnpm add @rao2126340634/yt-ui
# 或
yarn add @rao2126340634/yt-ui
配置
在项目的 pages.json 文件中配置 easycom:
{
"easycom": {
"autoscan": true,
"custom": {
"^yt-(.*)": "@rao2126340634/yt-ui/src/components/yt-$1/yt-$1.vue"
}
}
}
使用示例
在任意页面中直接使用:
<template>
<yt-button>点击我</yt-button>
<yt-avatar :url="avatarUrl" />
</template>
注意事项
- 确保已安装 Vue 3
- 确保配置 easycom
- 所有组件以
yt-开头