Skip to content

Commit

Permalink
1.【新增】readMore组件新增index参数和close,open事件
Browse files Browse the repository at this point in the history
2.【新增】新增man,woman,level三个图标
3.【新增】新增"注意事项"专题,记录一些踩坑知识点,让同学们少走弯路,详见[注意事项](https://uviewui.com/components/feature.html)
4.【新增】alertTips组件新增icon、title-style、desc-style、icon-style参数
5.【新增】新增节流和防抖方法,通过this.$u.debounce()和this.$u.throttle()调用,详见[节流防抖](https://uviewui.com/js/debounce.html)
6.【新增】button组件新增节流功能,以及配置间隔时间的throttle-time参数
7.【新增】field和input组件新增trim参数,默认为true,可以去除输入内容两端的空格
8.【优化】优化form-item组件的label设置为空内容时,依然显示左边的占位的问题
9.【优化】优化lazy-load组件修改图片路径后,无法再次加载的问题
10.【优化】优化navbar,upload,tabbar等组件由于各小程序props参数类型为Function,组件内执行父组件方法时this上下文丢失的问题
11.【优化】优化numberbox组件无法阻止事件冒泡的问题
12.【优化】优化timeFormat组件由于使用es7的padStart方法,导致在电脑版微信小程序无法识别的问题
13.【调整】调整this.$u.sys和this.$u.os,通过this.$u.sys()和this.$u.os()调用,详见[升级指南](https://uviewui.com/components/changeGuide.html)
14.【修复】修复无法通过手动设置popup的v-model为false来关闭popup的问题
15.【修复】修复骨架屏组件在微信小程序平台的组件中使用无效的问题。
  • Loading branch information
wlxuqu committed Aug 4, 2020
1 parent 582557e commit c1c3e00
Show file tree
Hide file tree
Showing 36 changed files with 706 additions and 318 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水

### **欢迎加群交流反馈:249718512**
### **欢迎加群交流反馈:1129077272**

## 特性

Expand Down
5 changes: 3 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name" : "uView",
"appid" : "__UNI__60F4B81",
"description" : "多平台快速开发的UI框架",
"versionName" : "1.5.7",
"versionName" : "1.5.8",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
Expand Down Expand Up @@ -126,6 +126,7 @@
"treeShaking" : {
"enable" : true
}
}
},
"title" : "uView UI"
}
}
23 changes: 15 additions & 8 deletions pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"easycom": {
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
},
"condition": { //模式配置,仅开发期间生效
"current": 0, //当前激活的模式(list 的索引项)
"list": [{
"name": "test", //模式名称
"path": "pages/componentsA/avatar/index", //启动页面,必选
"query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
}]
},
// "condition": { //模式配置,仅开发期间生效
// "current": 0, //当前激活的模式(list 的索引项)
// "list": [{
// "name": "test", //模式名称
// "path": "pages/componentsC/test/index", //启动页面,必选
// "query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
// }]
// },
"pages": [
// 演示-组件
{
Expand Down Expand Up @@ -328,6 +328,13 @@
{
"root": "pages/library",
"pages": [
// debounce-节流防抖
{
"path": "debounce/index",
"style": {
"navigationBarTitleText": "throttle | debounce-节流防抖"
}
},
// deepClone-对象深度克隆
{
"path": "deepClone/index",
Expand Down
7 changes: 6 additions & 1 deletion pages/componentsA/navbar/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<template>
<view class="">
<u-navbar title-color="#fff" back-icon-color="#ffffff" :is-fixed="isFixed" :is-back="isBack" :background="background" :back-text-style="{color: '#fff'}" :title="title" :back-icon-name="backIconName" :back-text="backText">
<u-navbar title-color="#fff" back-icon-color="#ffffff"
:is-fixed="isFixed" :is-back="isBack"
:background="background"
:back-text-style="{color: '#fff'}" :title="title"
:back-icon-name="backIconName" :back-text="backText"
>
<view class="slot-wrap" v-if="useSlot">
<view class="search-wrap" v-if="search">
<!-- 如果使用u-search组件,必须要给v-model绑定一个变量 -->
Expand Down
8 changes: 7 additions & 1 deletion pages/componentsB/readMore/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-read-more :toggle="toggle" :show-height="showHeight" ref="uReadMore">
<u-read-more @open="open" @close="close" :toggle="toggle" :show-height="showHeight" ref="uReadMore">
<!-- u-parse组件在微信小程序渲染慢,支付宝小程序rich-text不支持nodes属性 -->
<!-- #ifdef MP-ALIPAY -->
<u-parse :html="content"></u-parse>
Expand Down Expand Up @@ -48,6 +48,12 @@
},
toggleChange(index) {
this.toggle = index == 0 ? true : false;
},
open() {
// console.log('open');
},
close() {
// console.log('close');
}
}
}
Expand Down
12 changes: 10 additions & 2 deletions pages/componentsC/section/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-section :title="title" :right="right" :bold="bold" :color="color" :show-line="false"></u-section>
<u-section :title="title" :right="right" :bold="bold" :color="color" :show-line="showLine"></u-section>
</view>
</view>
<view class="u-config-wrap">
Expand All @@ -14,6 +14,10 @@
<view class="u-item-title">更换主标题</view>
<u-subsection vibrateShort :current="1" :list="['', '']" @change="titleChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">竖条状态</view>
<u-subsection vibrateShort :list="['显示', '隐藏']" @change="showLineChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">是否显示右边部分</view>
<u-subsection vibrateShort :list="['', '']" @change="rightChange"></u-subsection>
Expand All @@ -37,7 +41,8 @@
title: '红豆生南国',
bold: true,
right: true,
color: this.$u.color['mainColor']
color: this.$u.color['mainColor'],
showLine: true
}
},
methods: {
Expand All @@ -53,6 +58,9 @@
},
colorChange(index) {
this.color = index == 0 ? this.$u.color['mainColor'] : this.$u.color['primary'];
},
showLineChange(index) {
this.showLine = !index;
}
}
}
Expand Down
32 changes: 24 additions & 8 deletions pages/componentsC/test/index.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,39 @@
<template>
<view>
<u-popup v-model="show" @close="close">
<view>出淤泥而不染,濯清涟而不妖</view>
</u-popup>
<u-button @click="show = true">打开</u-button>
<view style="padding-top: 200px;">
<u-button @click="show = true" :custom-style="{
color: 'red',
borderColor: 'blue'
}">打开</u-button>
</view>
</template>

<script>
export default {
data() {
return {
show: false
show: true,
list: [{
name: '待收货'
}, {
name: '待付款'
}, {
name: '待评价'
}],
current: 0
}
},
onLoad() {
// setTimeout(() => {
// this.show = false;
// }, 2000)
},
methods: {
close() {
console.log('close');
//console.log('close');
},
change(index) {
this.current = index;
}
}
}
</script>
</script>
5 changes: 5 additions & 0 deletions pages/example/js.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export default [
{
groupName: '工具库',
list: [
{
path: 'debounce',
icon: 'debounce',
title: 'throttle | debounce 节流防抖',
},
{
path: 'deepMerge',
icon: 'deepMerge',
Expand Down
94 changes: 94 additions & 0 deletions pages/library/debounce/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<view class="no-mode-here">
选择节流或者防抖模式,点击按钮,将会执行回调并显示在下方:
</view>
<view class="u-demo-result-line" v-if="result.length">
<view v-for="(item, index) in result" :key="index">{{(index >= 1) ? '-' : ''}}回调</view>
</view>
</view>
</view>
<view class="u-config-wrap">
<view class="u-button" hover-class="u-button--hover" hover-stay-time="150" @tap="btnClick">
点击触发
</view>
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">模式</view>
<u-subsection vibrateShort :list="['节流', '防抖']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">时间间隔</view>
<u-subsection vibrateShort current="1" :list="['500ms', '1000ms', '2000ms']" @change="timeoutChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">执行时机</view>
<u-subsection vibrateShort :list="['开始处', '结束处']" @change="immediateChange"></u-subsection>
</view>
</view>
</view>
</template>

<script>
export default {
data() {
return {
result: [],
timeout: 1000,
immediate: true,
mode: 'throttle'
}
},
methods: {
modeChange(index) {
this.mode = index ? 'debouncd' : 'throttle';
},
timeoutChange(index) {
this.timeout = [500, 1000, 2000][index];
},
immediateChange(index) {
this.immediate = !index;
},
getResult() {
if(this.result.length >= 6) this.result = [];
this.result.push(0);
},
btnClick() {
if(this.mode == 'throttle') {
this.$u.throttle(this.getResult, this.timeout, this.immediate);
} else {
this.$u.debounce(this.getResult, this.timeout, this.immediate);
}
}
}
}
</script>

<style lang="scss" scoped>
.u-button {
margin-top: 50rpx;
margin-bottom: 50rpx;
display: flex;
justify-content: center;
align-items: center;
height: 80rpx;
border-radius: 6rpx;
border: 1px solid $u-type-primary;
color: $u-type-primary;
}
.u-button--hover {
color: #fff;
background-color: $u-type-primary;
}
.u-demo-result-line {
display: flex;
justify-content: center;
}
</style>
65 changes: 51 additions & 14 deletions uview-ui/components/u-alert-tips/u-alert-tips.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
borderColor: borderColor
}">
<view class="u-icon-wrap">
<u-icon v-if="showIcon" :name="$u.type2icon(type)" :size="description ? 40 : 32" class="u-icon" :color="type"></u-icon>
<u-icon v-if="showIcon" :name="uIcon" :size="description ? 40 : 32" class="u-icon" :color="uIconType" :custom-style="iconStyle"></u-icon>
</view>
<view class="u-alert-content" @tap.stop="click">
<view class="u-alert-title" :style="{fontWeight: description ? 500 : 'normal'}">
<view class="u-alert-title" :style="[uTitleStyle]">
{{title}}
</view>
<view v-if="description" class="u-alert-desc">
<view v-if="description" class="u-alert-desc" :style="[descStyle]">
{{description}}
</view>
</view>
Expand All @@ -38,6 +38,10 @@
* @property {String} title 显示的标题文字
* @property {String} description 辅助性文字,颜色比title浅一点,字号也小一点,可选
* @property {String} type 关闭按钮(默认为叉号icon图标)
* @property {String} icon 图标名称
* @property {Object} icon-style 图标的样式,对象形式
* @property {Object} title-style 标题的样式,对象形式
* @property {Object} desc-style 描述的样式,对象形式
* @property {String} close-able 用文字替代关闭图标,close-able为true时有效
* @property {Boolean} show-icon 是否显示左边的辅助图标
* @property {Boolean} show 显示或隐藏组件
Expand Down Expand Up @@ -96,12 +100,55 @@
show: {
type: Boolean,
default: true
}
},
// 左边显示的icon
icon: {
type: String,
default: ''
},
// icon的样式
iconStyle: {
type: Object,
default() {
return {}
}
},
// 标题的样式
titleStyle: {
type: Object,
default() {
return {}
}
},
// 描述文字的样式
descStyle: {
type: Object,
default() {
return {}
}
},
},
data() {
return {
}
},
computed: {
uTitleStyle() {
let style = {};
// 如果有描述文字的话,标题进行加粗
style.fontWeight = this.description ? 500 : 'normal';
// 将用户传入样式对象和style合并,传入的优先级比style高,同属性会被覆盖
return this.$u.deepMerge(style, this.titleStyle);
},
uIcon() {
// 如果有设置icon名称就使用,否则根据type主题,推定一个默认的图标
return this.icon ? this.icon : this.$u.type2icon(type);
},
uIconType() {
// 如果有设置图标的样式,优先使用,没有的话,则用type的样式
return Object.keys(this.iconStyle).length ? '' : this.type;
}
},
methods: {
// 点击内容
click() {
Expand Down Expand Up @@ -173,16 +220,6 @@
visibility: hidden;
}
@keyframes myfirst {
from {
height: 100%;
}
to {
height: 0
}
}
.u-icon {
margin-right: 16rpx;
}
Expand Down
Loading

0 comments on commit c1c3e00

Please sign in to comment.