Explore-UI
基于 Vant Vue3 的增强组件
安装
使用 npm
npm i "jobsys-explore"
使用 yarn
yarn i "jobsys-explore"
使用 pnpm
pnpm i "jobsys-explore"
由于
explore-ui使用了rem作为单位以适应不同的屏幕尺寸,所以需要在Vite里进行适配
pnpm i -D "postcss-pxtorem"
//vite.config.js
import pixelToRem from "postcss-pxtorem"
export default defineConfig({
css: {
postcss: {
plugins: [
pixelToRem({
rootValue({file}) {
//在这里可以根据 file 路径进行判断与定制,默认的 rootValue 是 37.5
return 37.5
},
propList: ["*"],
}),
],
},
},
})
示例
引入样式
//app.js
import "jobsys-explore/dist/style.css"
//app.js
import { createApp } from "vue"
import Explore from "jobsys-explore"
const app = createApp({
setup: () => {}
})
app.use(Explore).mount("#app")
<template>
<ExButton type="primary">点兵</ExButton>
</template>
<script setup>
import { ref } from "vue"
const password = ref("")
</script>