Skip to content

Commit

Permalink
fix : 修复 uni-rate 使用npm 的方式,图标不显示的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
mehaotian committed Jul 8, 2020
1 parent 904132e commit f9d4ec1
Show file tree
Hide file tree
Showing 15 changed files with 1,045 additions and 229 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ui是一种需求非常发散的产品,DCloud官方也无意用 `uni-ui` 压

#### **方式一 (推荐)**

`HBuilderX 2.5.5`起支持 `easycom` 组件模式。在使用 `uni-ui` 的时候,只要[`uni-ui` 组件](https://ext.dcloud.net.cn/plugin?id=55) 安装在项目的 `components` 目录下,并符合 `omponents/组件名称/组件名称.vue` 目录结构。就可以不用引用、注册,直接在页面中使用 `uni-ui`
`HBuilderX 2.5.5`起支持 `easycom` 组件模式。在使用 `uni-ui` 的时候,只要[`uni-ui` 组件](https://ext.dcloud.net.cn/plugin?id=55) 安装在项目的 `components` 目录下,并符合 `components/组件名称/组件名称.vue` 目录结构。就可以不用引用、注册,直接在页面中使用 `uni-ui`

`easycom` 组件模式的好处在于不管 `components` 目录下安装了多少组件,`easycom` 打包后会自动剔除没有使用的组件,对组件库的使用尤为友好,组件库批量安装,随意使用,自动按需打包。 关于 `easycom` 更详细内容 [参考文档](https://uniapp.dcloud.io/collocation/pages?id=easycom)

Expand Down Expand Up @@ -101,34 +101,34 @@ export default {
|组件名 |引用路径 |说明 |
|--- |--- |--- |
|uniBadge |'@dcloudio/uni-ui/lib/uni-badge/uni-badge.vue' |[数字角标](https://ext.dcloud.net.cn/plugin?id=21) |
|uniCalendar | '@dcloudio/uni-ui/lib/uni-calendar/uni-calendar.vue' |[日历](https://ext.dcloud.net.cn/plugin?id=56) |
|uniCalendar |'@dcloudio/uni-ui/lib/uni-calendar/uni-calendar.vue' |[日历](https://ext.dcloud.net.cn/plugin?id=56) |
|uniCard |'@dcloudio/uni-ui/lib/uni-card/uni-card.vue' |[卡片](https://ext.dcloud.net.cn/plugin?id=22) |
|uniCollapse | '@dcloudio/uni-ui/lib/uni-collapse/uni-collapse.vue' |[折叠面板](https://ext.dcloud.net.cn/plugin?id=23) |
|uniCombox | '@dcloudio/uni-ui/lib/uni-combox/uni-combox.vue' |[组合框](https://ext.dcloud.net.cn/plugin?id=1261) |
|uniCollapse |'@dcloudio/uni-ui/lib/uni-collapse/uni-collapse.vue' |[折叠面板](https://ext.dcloud.net.cn/plugin?id=23) |
|uniCombox |'@dcloudio/uni-ui/lib/uni-combox/uni-combox.vue' |[组合框](https://ext.dcloud.net.cn/plugin?id=1261) |
|uniCountdown |'@dcloudio/uni-ui/lib/uni-countdown/uni-countdown.vue' | [倒计时](https://ext.dcloud.net.cn/plugin?id=25) |
|uniDrawer |'@dcloudio/uni-ui/lib/uni-drawer/uni-drawer.vue' |[抽屉](https://ext.dcloud.net.cn/plugin?id=26) |
|uniFab |'@dcloudio/uni-ui/lib/uni-fab/uni-fab.vue' |[悬浮按钮](https://ext.dcloud.net.cn/plugin?id=144) |
|uniFav | '@dcloudio/uni-ui/lib/uni-fav/uni-fav.vue' |[收藏按钮](https://ext.dcloud.net.cn/plugin?id=864) |
|uniGoodsNav | '@dcloudio/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue' |[商品导航](https://ext.dcloud.net.cn/plugin?id=865) |
|uniGrid | '@dcloudio/uni-ui/lib/uni-grid/uni-grid.vue' |[宫格](https://ext.dcloud.net.cn/plugin?id=27) |
|uniFav |'@dcloudio/uni-ui/lib/uni-fav/uni-fav.vue' |[收藏按钮](https://ext.dcloud.net.cn/plugin?id=864) |
|uniGoodsNav |'@dcloudio/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue' |[商品导航](https://ext.dcloud.net.cn/plugin?id=865) |
|uniGrid |'@dcloudio/uni-ui/lib/uni-grid/uni-grid.vue' |[宫格](https://ext.dcloud.net.cn/plugin?id=27) |
|uniIcons |'@dcloudio/uni-ui/lib/uni-icons/uni-icons.vue' |[图标](https://ext.dcloud.net.cn/plugin?id=28) |
|uniIndexedList |'@dcloudio/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue' | [索引列表](https://ext.dcloud.net.cn/plugin?id=375) |
|uniList | '@dcloudio/uni-ui/lib/uni-list/uni-list.vue' |[列表](https://ext.dcloud.net.cn/plugin?id=24) |
|uniLoadMore | '@dcloudio/uni-ui/lib/uni-load-more/uni-load-more.vue' |[加载更多](https://ext.dcloud.net.cn/plugin?id=29) |
|uniList |'@dcloudio/uni-ui/lib/uni-list/uni-list.vue' |[列表](https://ext.dcloud.net.cn/plugin?id=24) |
|uniLoadMore |'@dcloudio/uni-ui/lib/uni-load-more/uni-load-more.vue' |[加载更多](https://ext.dcloud.net.cn/plugin?id=29) |
|uniNavBar |'@dcloudio/uni-ui/lib/uni-nav-bar/uni-nav-bar.vue' |[自定义导航栏](https://ext.dcloud.net.cn/plugin?id=52) |
|uniNoticeBar |'@dcloudio/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue' |[通告栏](https://ext.dcloud.net.cn/plugin?id=30) |
|uniNumberBox |'@dcloudio/uni-ui/lib/uni-number-box/uni-number-box.vue' |[数字输入框](https://ext.dcloud.net.cn/plugin?id=31) |
|uniPagination |'@dcloudio/uni-ui/lib/uni-pagination/uni-pagination.vue' |[分页器](https://ext.dcloud.net.cn/plugin?id=32) |
|uniPopup | '@dcloudio/uni-ui/lib/uni-popup/uni-popup.vue' |[弹出层](https://ext.dcloud.net.cn/plugin?id=329) |
|uniPopup |'@dcloudio/uni-ui/lib/uni-popup/uni-popup.vue' |[弹出层](https://ext.dcloud.net.cn/plugin?id=329) |
|uniRate |'@dcloudio/uni-ui/lib/uni-rate/uni-rate.vue' |[评分](https://ext.dcloud.net.cn/plugin?id=33) |
|uniSearchBar | '@dcloudio/uni-ui/lib/uni-search-bar/uni-search-bar.vue' |[搜索栏](https://ext.dcloud.net.cn/plugin?id=866) |
|uniSearchBar |'@dcloudio/uni-ui/lib/uni-search-bar/uni-search-bar.vue' |[搜索栏](https://ext.dcloud.net.cn/plugin?id=866) |
|uniSegmentedControl|'@dcloudio/uni-ui/lib/uni-segmented-control/uni-segmented-control.vue' |[分段器](https://ext.dcloud.net.cn/plugin?id=54) |
|uniSteps |'@dcloudio/uni-ui/lib/uni-steps/uni-steps.vue' |[步骤条](https://ext.dcloud.net.cn/plugin?id=34) |
|uniSwipeAction | '@dcloudio/uni-ui/lib/uni-swipe-action/uni-swipe-action.vue' |[滑动操作](https://ext.dcloud.net.cn/plugin?id=181) |
|uniSwipeAction |'@dcloudio/uni-ui/lib/uni-swipe-action/uni-swipe-action.vue' |[滑动操作](https://ext.dcloud.net.cn/plugin?id=181) |
|uniSwiperDot |'@dcloudio/uni-ui/lib/uni-swiper-dot/uni-swiper-dot.vue' |[轮播图指示点](https://ext.dcloud.net.cn/plugin?id=284)|
|uniTag | '@dcloudio/uni-ui/lib/uni-tag/uni-tag.vue' |[标签](https://ext.dcloud.net.cn/plugin?id=35) |
|uniTitle | '@dcloudio/uni-ui/lib/uni-title/uni-title.vue' |[章节标题](https://ext.dcloud.net.cn/plugin?id=1066) |
|uniTransition | '@dcloudio/uni-ui/lib/uni-transition/uni-transition.vue' |[过渡动画](https://ext.dcloud.net.cn/plugin?id=985) |
|uniTag |'@dcloudio/uni-ui/lib/uni-tag/uni-tag.vue' |[标签](https://ext.dcloud.net.cn/plugin?id=35) |
|uniTitle |'@dcloudio/uni-ui/lib/uni-title/uni-title.vue' |[章节标题](https://ext.dcloud.net.cn/plugin?id=1066) |
|uniTransition |'@dcloudio/uni-ui/lib/uni-transition/uni-transition.vue' |[过渡动画](https://ext.dcloud.net.cn/plugin?id=985) |


#### 其他
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "55",
"name": "@dcloudio/uni-ui",
"version": "1.2.1",
"description": "+ uni-ui 修复 npm run sever 报错的Bug",
"version": "1.2.2",
"description": "- uni-list 新增 link 属性,显示右侧箭头并开启点击反馈\n- uni-list 新增 to 属性,直接跳转到指定页面\n- uni-list 新增 border 属性,是否显示列表分割线\n- uni-list 废弃 showArrow 属性,使用 link 属性代替\n- uni-rate 新增 disabled 属性,可设置组件禁用状态(之前版本的不可点击状态)\n- uni-rate 新增 disabledColor 属性,可设置禁用颜色\n- uni-rate 新增 readonly 属性,可设置组件只读属性\n- uni-rate 新增 allowHalf 属性,可设置组件是否开启半星选择\n- uni-rate 新增 touchable 属性,可设置组件是否支持滑动手势\n- uni-rate 修复 动态传值不更新的问题\n- uni-rate 优化 value 属性可使用 v-model 双向绑定数据",
"author": "dcloud",
"license": "Apache-2.0",
"repository": {
Expand Down
90 changes: 90 additions & 0 deletions packages/uni-ui/lib/uni-list-ad/uni-list-ad.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<template>
<!-- #ifdef APP-NVUE -->
<cell>
<!-- #endif -->
<view class="uni-list-ad">
<view v-if="borderShow" :class="{'uni-list--border':border,'uni-list-item--first':isFirstChild}"></view>
<ad style="width: 200px;height: 300px;border-width: 1px;border-color: red;border-style: solid;" adpid="1111111111" unit-id="" appid="" apid="" type="feed" @error="aderror" @close="closeAd"></ad>
</view>
<!-- #ifdef APP-NVUE -->
</cell>
<!-- #endif -->

</template>

<script>
// #ifdef APP-NVUE
const dom = uni.requireNativePlugin('dom');
// #endif
export default {
name: 'UniListAd',
props: {
title: {
type: String,
default: '',
}
},
inject: ['list'],
data() {
return {
isFirstChild: false,
border: false,
borderShow: true,
}
},
mounted() {
if (!this.list.firstChildAppend) {
this.list.firstChildAppend = true
this.isFirstChild = true
}
this.border = this.list.border
},
methods: {
aderror(e) {
console.log("aderror: " + JSON.stringify(e.detail));
},
closeAd(e) {
this.borderShow = false
}
}
}
</script>

<style lang="scss" scoped>
.uni-list-ad {
position: relative;
border: 1px red solid;
}
.uni-list--border {
position: relative;
padding-bottom: 1px;
/* #ifdef APP-PLUS */
border-top-color: $uni-border-color;
border-top-style: solid;
border-top-width: 0.5px;
/* #endif */
margin-left: $uni-spacing-row-lg;
}
/* #ifndef APP-NVUE */
.uni-list--border:after {
position: absolute;
top: 0;
right: 0;
left: 0;
height: 1px;
content: '';
-webkit-transform: scaleY(.5);
transform: scaleY(.5);
background-color: $uni-border-color;
}
.uni-list-item--first:after {
height: 0px;
}
/* #endif */
</style>
58 changes: 58 additions & 0 deletions packages/uni-ui/lib/uni-list-chat/uni-list-chat.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* 这里是 uni-list 组件内置的常用样式变量
* 如果需要覆盖样式,这里提供了基本的组件样式变量,您可以尝试修改这里的变量,去完成样式替换,而不用去修改源码
*
*/

// 背景色
$background-color : #fff;
// 分割线颜色
$divide-line-color : #e5e5e5;

// 默认头像大小,如需要修改此值,注意同步修改 js 中的值 const avatarWidth = xx ,目前只支持方形头像
// nvue 页面不支持修改头像大小
$avatar-width : 45px ;

// 头像边框
$avatar-border-radius: 5px;
$avatar-border-color: #eee;
$avatar-border-width: 1px;

// 标题文字样式
$title-size : 16px;
$title-color : #3b4144;
$title-weight : normal;

// 描述文字样式
$note-size : 12px;
$note-color : #999;
$note-weight : normal;

// 右侧额外内容默认样式
$right-text-size : 12px;
$right-text-color : #999;
$right-text-weight : normal;

// 角标样式
// nvue 页面不支持修改圆点位置以及大小
// 角标在左侧时,角标的位置,默认为 0 ,负数左/下移动,正数右/上移动
$badge-left: 0px;
$badge-top: 0px;

// 显示圆点时,圆点大小
$dot-width: 10px;
$dot-height: 10px;

// 显示角标时,角标大小和字体大小
$badge-size : 18px;
$badge-font : 12px;
// 显示角标时,角标前景色
$badge-color : #fff;
// 显示角标时,角标背景色
$badge-background-color : #ff5a5f;
// 显示角标时,角标左右间距
$badge-space : 6px;

// 状态样式
// 选中颜色
$hover : #f5f5f5;
Loading

0 comments on commit f9d4ec1

Please sign in to comment.