Skip to content

Commit

Permalink
Merge branch 'yiruiwen' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
wlxuqu committed Jul 21, 2020
2 parents d330db1 + 3d74f39 commit 6355799
Show file tree
Hide file tree
Showing 27 changed files with 212 additions and 279 deletions.
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.3",
"versionName" : "1.5.4",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
Expand Down Expand Up @@ -106,7 +106,8 @@
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
"usingComponents" : true,
"component2": true
},
"mp-baidu" : {
"usingComponents" : true,
Expand Down
16 changes: 8 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/componentsB/readMore/index", //启动页面,必选
"query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
}]
},
// "condition": { //模式配置,仅开发期间生效
// "current": 0, //当前激活的模式(list 的索引项)
// "list": [{
// "name": "test", //模式名称
// "path": "pages/componentsB/table/index", //启动页面,必选
// "query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
// }]
// },
"pages": [
// 演示-组件
{
Expand Down
48 changes: 1 addition & 47 deletions pages/componentsB/table/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-table :align="align" :borderColor="borderColor" :style="{
display: !mode ? 'block' : 'none'
}">
<u-table :align="align" :borderColor="borderColor">
<u-tr>
<u-th>姓名</u-th>
<u-th>年龄</u-th>
Expand All @@ -32,56 +30,12 @@
<u-td>女</u-td>
</u-tr>
</u-table>
<u-table :align="align" :borderColor="borderColor" :style="{
display: mode ? 'block' : 'none'
}">
<u-tr>
<u-th>姓名</u-th>
<u-th>年龄</u-th>
<u-th>籍贯</u-th>
<u-th>性别</u-th>
</u-tr>
<u-tr>
<u-td width="25%">吕布</u-td>
<u-td>
<u-tr>
<u-td>28</u-td>
<u-td>楚河</u-td>
<u-td>男</u-td>
</u-tr>
<u-tr>
<u-td>28</u-td>
<u-td>楚河</u-td>
<u-td>男</u-td>
</u-tr>
</u-td>
</u-tr>
<u-tr>
<u-td width="50%">项羽</u-td>
<u-td>
<u-tr>
<u-td>汉界</u-td>
<u-td>男</u-td>
</u-tr>
</u-td>
</u-tr>
<u-tr>
<u-td>木兰</u-td>
<u-td>24</u-td>
<u-td>南国</u-td>
<u-td>女</u-td>
</u-tr>
</u-table>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">合并单元格(微信小程序不支持合并)</view>
<u-subsection vibrateShort current="1" :list="['是', '否']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">边框颜色</view>
<u-subsection vibrateShort :list="['gray', 'primary', 'warning']" @change="borderColorChange"></u-subsection>
Expand Down
2 changes: 1 addition & 1 deletion pages/componentsC/numberBox/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default {
this.step = index == 0 ? 1 : index == 1 ? 3 : index == 2 ? 5 : 8;
},
change(e) {
console.log(this.value);
//console.log(e.value);
}
}
};
Expand Down
16 changes: 12 additions & 4 deletions pages/example/components.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,15 @@ export default [{
path: '/pages/componentsB/sticky/index',
icon: 'sticky',
title: 'Sticky 吸顶',
}, {
},
// #ifndef MP-ALIPAY
{
path: '/pages/componentsB/waterfall/index',
icon: 'waterfall',
title: 'Waterfall 瀑布流',
}, {
},
// #endif
{
path: '/pages/componentsB/divider/index',
icon: 'divider',
title: 'Divider 分割线',
Expand All @@ -224,11 +228,15 @@ export default [{
path: '/pages/componentsA/tabs/index',
icon: 'tabs',
title: 'Tabs 标签',
}, {
},
// #ifndef MP-ALIPAY
{
path: '/pages/template/order/index',
icon: 'tabsSwiper',
title: 'TabsSwiper 全屏选项卡',
}, {
},
// #endif
{
path: '/pages/componentsC/subsection/index',
icon: 'subsection',
title: 'Subsection 分段器',
Expand Down
3 changes: 3 additions & 0 deletions pages/example/components.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
}
}
},
created() {
},
methods: {
openPage(path) {
Expand Down
15 changes: 9 additions & 6 deletions uview-ui/components/u-index-anchor/u-index-anchor.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<template>
<view class="u-index-anchor-wrapper" :id="$u.guid()" :style="[wrapperStyle]">
<view class="u-index-anchor " :class="[active ? 'u-index-anchor--active' : '']" :style="[customAnchorStyle]">
<slot v-if="useSlot" />
<block v-else>
<text>{{ index }}</text>
</block>
<!-- 支付宝小程序使用$u.getRect()获取组件的根元素尺寸,所以在外面套一个"壳" -->
<view>
<view class="u-index-anchor-wrapper" :id="$u.guid()" :style="[wrapperStyle]">
<view class="u-index-anchor " :class="[active ? 'u-index-anchor--active' : '']" :style="[customAnchorStyle]">
<slot v-if="useSlot" />
<block v-else>
<text>{{ index }}</text>
</block>
</view>
</view>
</view>
</template>
Expand Down
27 changes: 15 additions & 12 deletions uview-ui/components/u-index-list/u-index-list.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<template>
<view class="u-index-bar">
<slot />
<view v-if="showSidebar" class="u-index-bar__sidebar" @touchstart.stop.prevent="onTouchMove" @touchmove.stop.prevent="onTouchMove"
@touchend.stop.prevent="onTouchStop" @touchcancel.stop.prevent="onTouchStop">
<view v-for="(item, index) in indexList" :key="index" class="u-index-bar__index" :style="{zIndex: zIndex + 1, color: activeAnchorIndex === index ? activeColor : ''}"
:data-index="index">
{{ item }}
<!-- 支付宝小程序使用$u.getRect()获取组件的根元素尺寸,所以在外面套一个"壳" -->
<view>
<view class="u-index-bar">
<slot />
<view v-if="showSidebar" class="u-index-bar__sidebar" @touchstart.stop.prevent="onTouchMove" @touchmove.stop.prevent="onTouchMove"
@touchend.stop.prevent="onTouchStop" @touchcancel.stop.prevent="onTouchStop">
<view v-for="(item, index) in indexList" :key="index" class="u-index-bar__index" :style="{zIndex: zIndex + 1, color: activeAnchorIndex === index ? activeColor : ''}"
:data-index="index">
{{ item }}
</view>
</view>
<view class="u-indexed-list-alert" v-if="touchmove && indexList[touchmoveIndex]" :style="{
zIndex: alertZIndex
}">
<text>{{indexList[touchmoveIndex]}}</text>
</view>
</view>
<view class="u-indexed-list-alert" v-if="touchmove && indexList[touchmoveIndex]" :style="{
zIndex: alertZIndex
}">
<text>{{indexList[touchmoveIndex]}}</text>
</view>
</view>
</template>
Expand Down
2 changes: 1 addition & 1 deletion uview-ui/components/u-keyboard/u-keyboard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<u-popup class="" :mask="mask" :maskCloseAble="maskCloseAble" mode="bottom" :popup="false" v-model="value" length="auto"
:safeAreaInsetBottom="safeAreaInsetBottom" @close="popupClose">
:safeAreaInsetBottom="safeAreaInsetBottom" @close="popupClose" :zIndex="uZIndex">
<slot />
<view class="u-tooltip" v-if="tooltip">
<view class="u-tooltip-item u-tooltip-cancel" hover-class="u-tooltip-cancel-hover" @tap="onCancel">
Expand Down
6 changes: 5 additions & 1 deletion uview-ui/components/u-line-progress/u-line-progress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
type ? `u-type-${type}-bg` : '',
striped ? 'u-striped' : '',
striped && stripedActive ? 'u-striped-active' : ''
]" class="u-active" :style="[progressStyle]">{{showPercent ? percent + '%' : ''}}
]" class="u-active" :style="[progressStyle]">
<slot v-if="$slots.default" />
<block v-else-if="showPercent">
{{percent + '%'}}
</block>
</view>
</view>
</template>
Expand Down
9 changes: 1 addition & 8 deletions uview-ui/components/u-number-box/u-number-box.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@
}
},
watch: {
value(val, val1) {
// 防止用户在change事件回调中将回调值赋值给valut变量,导致change事件触发两次
if(Number(val) != this.inputVal) this.inputVal = Number(val);
},
inputVal(v1, v2) {
// 为了让用户能够删除所有输入值,重新输入内容,删除所有值后,内容为空字符串
if (v1 == '') return;
Expand All @@ -144,10 +140,8 @@
let tmp = this.$u.test.number(v1);
if (tmp && v1 >= this.min && v1 <= this.max) value = v1;
else value = v2;
// 发出change事件
this.handleChange(value, 'change');
this.$nextTick(() => {
this.inputVal = v1;
})
}
},
data() {
Expand Down Expand Up @@ -258,7 +252,6 @@
this.$nextTick(() => {
this.inputVal = val;
})
this.handleChange(val, "blur");
},
handleChange(value, type) {
if (this.disabled) return;
Expand Down
6 changes: 2 additions & 4 deletions uview-ui/components/u-parse/libs/MpHtmlParser.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* html 解析器
* @tutorial https://github.com/jin-yufeng/Parser
* @version 20200712
* @version 20200719
* @author JinYufeng
* @listens MIT
*/
Expand Down Expand Up @@ -233,8 +233,6 @@ MpHtmlParser.prototype.setNode = function() {
style += ';-webkit-touch-callout:none';
styleObj['max-width'] = '100%';
}
if (!styleObj.position)
styleObj.top = styleObj.bottom = styleObj.left = styleObj.right = styleObj['z-index'] = void 0;
var width;
if (styleObj.width) width = styleObj.width;
else if (attrs.width) width = attrs.width.includes('%') ? attrs.width : attrs.width + 'px';
Expand Down Expand Up @@ -305,7 +303,7 @@ MpHtmlParser.prototype.remove = function(node) {
if (!node.attrs.xmlns) src = ' xmlns="http://www.w3.org/2000/svg"' + src;
var i = j;
while (this.data[j] != '<') j--;
src = this.data.substring(j, i) + src;
src = this.data.substring(j, i).replace("viewbox", "viewBox") + src;
var parent = this.parent();
if (node.attrs.width == '100%' && parent && (parent.attrs.style || '').includes('inline'))
parent.attrs.style = 'width:300px;max-width:100%;' + parent.attrs.style;
Expand Down
Loading

0 comments on commit 6355799

Please sign in to comment.