feat: 自动引入fly-xxx组件
This commit is contained in:
parent
af06e8b6ad
commit
dfabbc6342
@ -11,6 +11,9 @@ export default defineUniPages({
|
||||
easycom: {
|
||||
autoscan: true,
|
||||
custom: {
|
||||
// 以 Fly 开头的组件,在 components 文件夹中查找引入(需要重启服务器)
|
||||
'^Fly(.*)': '@/components/fly-$1/fly-$1.vue',
|
||||
'^fly-(.*)': '@/components/fly-$1/fly-$1.vue',
|
||||
// uni-ui 规则如下配置
|
||||
'^uni-(.*)': '@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue',
|
||||
},
|
||||
|
3
src/components/fly-header/fly-header.vue
Normal file
3
src/components/fly-header/fly-header.vue
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<view class="text-green-500"> header </view>
|
||||
</template>
|
@ -16,6 +16,8 @@
|
||||
"easycom": {
|
||||
"autoscan": true,
|
||||
"custom": {
|
||||
"^Fly(.*)": "@/components/fly-$1/fly-$1.vue",
|
||||
"^fly-(.*)": "@/components/fly-$1/fly-$1.vue",
|
||||
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
|
||||
}
|
||||
},
|
||||
|
@ -16,6 +16,7 @@
|
||||
<uni-badge text="1"></uni-badge>
|
||||
<!-- Sun in light mode, Moon in dark mode, from Carbon -->
|
||||
<button class="i-carbon-sun dark:i-carbon-moon" />
|
||||
<fly-header></fly-header>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user