refactor(ui): 移除uni-icons和uni-scss模块,改用unocss图标
- 删除uni-icons相关组件、字体文件和文档 - 删除uni-scss样式文件和变量配置 - 更新tabbar配置使用unocss图标 - 在uno.config.ts中添加新的安全图标
This commit is contained in:
@@ -52,7 +52,7 @@ export type CustomTabBarItemBadge = number | 'dot'
|
||||
export interface CustomTabBarItem {
|
||||
text: string
|
||||
pagePath: string
|
||||
iconType: 'uniUi' | 'uiLib' | 'unocss' | 'iconfont' | 'image' // 不建议用 image 模式,需要配置2张图
|
||||
iconType: 'uiLib' | 'unocss' | 'iconfont' | 'image' // 不建议用 image 模式,需要配置2张图
|
||||
icon: any // 其实是 string 类型,这里是为了避免 ts 报错 (tabbar/index.vue 里面 uni-icons 那行)
|
||||
iconActive?: string // 只有在 image 模式下才需要,传递的是高亮的图片(PS: 不建议用 image 模式)
|
||||
badge?: CustomTabBarItemBadge
|
||||
@@ -64,11 +64,11 @@ export const customTabbarList: CustomTabBarItem[] = [
|
||||
{
|
||||
text: '首页',
|
||||
pagePath: 'pages/index/index',
|
||||
// 本框架内置了 uniapp 官方UI库 (uni-ui)的图标库
|
||||
// 使用方式如:<uni-icons type="home" size="30"/>
|
||||
// 图标列表地址:https://uniapp.dcloud.net.cn/component/uniui/uni-icons.html
|
||||
iconType: 'uniUi',
|
||||
icon: 'home',
|
||||
// 注意 unocss 图标需要如下处理:(二选一)
|
||||
// 1)在fg-tabbar.vue页面上引入一下并注释掉(见tabbar/index.vue代码第2行)
|
||||
// 2)配置到 unocss.config.ts 的 safelist 中
|
||||
iconType: 'unocss',
|
||||
icon: 'i-carbon-home',
|
||||
// badge: 'dot',
|
||||
},
|
||||
{
|
||||
@@ -84,8 +84,8 @@ export const customTabbarList: CustomTabBarItem[] = [
|
||||
{
|
||||
pagePath: 'pages/me/me',
|
||||
text: '我的',
|
||||
iconType: 'uniUi',
|
||||
icon: 'contact',
|
||||
iconType: 'unocss',
|
||||
icon: 'i-carbon-user',
|
||||
// badge: 100,
|
||||
},
|
||||
// 其他类型演示
|
||||
|
||||
Reference in New Issue
Block a user