Skip to content

Commit f76fb96

Browse files
committed
1. 新增自定义主题功能和教程
2. 更新readme.md 3. 优化row组价可能存在边距错误的问题 4. button组件新增data-name参数
1 parent 6c668f0 commit f76fb96

File tree

11 files changed

+64
-99
lines changed

11 files changed

+64
-99
lines changed

README.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全
1919
- 按需引入,精简打包体积
2020

2121

22+
## 预览
23+
24+
您可以通过**微信**扫码,查看最佳的演示效果。
25+
<br>
26+
<br>
27+
<img src="https://uviewui.com/common/weixin_mini_qrcode.png" width="220" height="220" >
28+
29+
2230
## 友情链接
2331

2432
<br>
@@ -30,12 +38,20 @@ uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全
3038
#### **pl-table** —— [ 完美解决 element 万级表格数据渲染卡顿问题](https://github.com/livelyPeng/pl-table)
3139
<br>
3240

41+
## 链接
42+
43+
- [官方文档](https://uviewui.com/)
44+
- [更新日志](https://uviewui.com/components/changelog.html)
45+
- [升级指南](https://uviewui.com/components/changelog.html)
46+
- [关于我们](https://uviewui.com/cooperation/about.html)
47+
48+
## 交流反馈
49+
50+
欢迎加入我们的QQ群交流反馈:[点此跳转](https://www.uviewui.com/components/addQQGroup.html)
51+
3352
## 安装
3453

35-
```bash
36-
# npm方式安装
37-
npm i uview-ui
38-
```
54+
#### **下载地址** —— [https://ext.dcloud.net.cn/plugin?id=1593](https://ext.dcloud.net.cn/plugin?id=1593)
3955

4056
## 快速上手
4157

@@ -66,7 +82,7 @@ Vue.use(uView);
6682
// pages.json
6783
{
6884
"easycom": {
69-
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
85+
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
7086
},
7187
// 此为本身已有的内容
7288
"pages": [
@@ -88,26 +104,13 @@ Vue.use(uView);
88104

89105
请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
90106

91-
## 链接
92-
93-
- [官方文档](https://uviewui.com/)
94-
- [更新日志](https://uviewui.com/components/changelog.html)
95-
- [升级指南](https://uviewui.com/components/changelog.html)
96-
- [关于我们](https://uviewui.com/cooperation/about.html)
97-
98-
## 预览
99-
100-
您可以通过**微信**扫码,查看最佳的演示效果。
101-
<br>
102-
<br>
103-
<img src="https://uviewui.com/common/weixin_mini_qrcode.png" width="220" height="220" >
104107

105-
<!-- ## 捐赠uView的研发
108+
## 捐赠uView的研发
106109

107110
uView文档和源码全部开源免费,如果您认为uView帮到了您的开发工作,您可以捐赠uView的研发工作,捐赠无门槛,哪怕是一杯可乐也好(相信这比打赏主播更有意义)。
108111

109112
<img src="https://uviewui.com/common/wechat.png" width="220" >
110113
<img style="margin-left: 100px;" src="https://uviewui.com/common/alipay.png" width="220" >
111-
-->
114+
112115
## 版权信息
113116
uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name" : "uView",
33
"appid" : "__UNI__60F4B81",
44
"description" : "多平台快速开发的UI框架",
5-
"versionName" : "1.3.6",
5+
"versionName" : "1.3.8",
66
"versionCode" : "100",
77
"transformPx" : false,
88
"app-plus" : {

pages.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"easycom": {
33
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
44
},
5-
"condition": { //模式配置,仅开发期间生效
6-
"current": 0, //当前激活的模式(list 的索引项)
7-
"list": [{
8-
"name": "test", //模式名称
9-
"path": "pages/componentsC/test/index", //启动页面,必选
10-
"query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
11-
}]
12-
},
5+
// "condition": { //模式配置,仅开发期间生效
6+
// "current": 0, //当前激活的模式(list 的索引项)
7+
// "list": [{
8+
// "name": "test", //模式名称
9+
// "path": "pages/componentsC/test/index", //启动页面,必选
10+
// "query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
11+
// }]
12+
// },
1313
"pages": [
1414
// 演示-组件
1515
{

pages/componentsC/test/index.vue

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +0,0 @@
1-
<template>
2-
<view>
3-
<u-checkbox-group @change="checkboxGroupChange1">
4-
<view class="" v-for="(item, index) in list1" :key="index">
5-
<image :src="item.image" mode=""></image>
6-
<u-checkbox v-model="item.checked" :name="item.name">{{ item.name }}</u-checkbox>
7-
</view>
8-
</u-checkbox-group>
9-
<view class="">-------------------------------------------------------------------------------------</view>
10-
<u-checkbox-group @change="checkboxGroupChange2">
11-
<view class="" v-for="(item, index) in list2" :key="index">
12-
<image :src="addUrl(item.image)" mode=""></image>
13-
<u-checkbox v-model="item.checked" :name="item.name">{{ item.name }}</u-checkbox>
14-
</view>
15-
</u-checkbox-group>
16-
</view>
17-
</template>
18-
19-
<script>
20-
export default {
21-
data() {
22-
return {
23-
list1: [
24-
{
25-
name: 'item-1',
26-
checked: false,
27-
image: 'https://qiniu.jieyoukj.cn/vote/2020/5/20/11:34:7/14yvkka1oqadcxr1592624047805'
28-
},
29-
{
30-
name: 'item-2',
31-
checked: false,
32-
image: 'https://qiniu.jieyoukj.cn/vote/2020/5/20/11:34:7/14yvkka1oqadcxr1592624047805'
33-
}
34-
],
35-
list2: [
36-
{
37-
name: 'item-1',
38-
checked: false,
39-
image: '/vote/2020/5/20/11:34:7/14yvkka1oqadcxr1592624047805'
40-
},
41-
{
42-
name: 'item-2',
43-
checked: false,
44-
image: '/vote/2020/5/20/11:34:7/14yvkka1oqadcxr1592624047805'
45-
}
46-
]
47-
};
48-
},
49-
methods: {
50-
// 选中任一checkbox时,由checkbox-group触发
51-
checkboxGroupChange1(e) {
52-
console.log(e);
53-
},
54-
checkboxGroupChange2(e) {
55-
console.log(e);
56-
},
57-
58-
addUrl(url) {
59-
return 'https://qiniu.jieyoukj.cn' + url;
60-
}
61-
}
62-
};
63-
</script>
64-
65-
<style lang="scss"></style>

uview-ui/components/u-button/u-button.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
:send-message-title="sendMessageTitle"
2121
send-message-path="sendMessagePath"
2222
:lang="lang"
23+
:data-name="dataName"
2324
:session-from="sessionFrom"
2425
:send-message-img="sendMessageImg"
2526
:show-message-card="showMessageCard"
@@ -32,6 +33,7 @@
3233
@tap.stop="click($event)"
3334
:hover-class="getHoverClass"
3435
:loading="loading"
36+
data-name="dataName"
3537
>
3638
<slot></slot>
3739
<view
@@ -198,6 +200,11 @@ export default {
198200
default() {
199201
return {};
200202
}
203+
},
204+
// 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取
205+
dataName: {
206+
type: String,
207+
default: ''
201208
}
202209
},
203210
computed: {

uview-ui/components/u-row/u-row.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<template>
22
<view class="u-row" :style="{
3-
marginLeft: `-${gutter/2 + 'rpx'}`,
4-
marginRight: `-${gutter/2 + 'rpx'}`,
53
alignItems: uAlignItem,
64
justifyContent: uJustify
75
}">

uview-ui/components/u-select/u-select.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
* select 列选择器
5555
* @description 此选择器用于单列,多列,多列联动的选择场景。(从1.3.0版本起,不建议使用Picker组件的单列和多列模式,Select组件是专门为列选择而构造的组件,更简单易用。)
5656
* @tutorial http://uviewui.com/components/select.html
57-
* @property {String} mode 模式选择,"single-column"-单列模式,"mutil-column"-多列模式,"single-column-auto"-多列联动模式
57+
* @property {String} mode 模式选择,"single-column"-单列模式,"mutil-column"-多列模式,"mutil-column-auto"-多列联动模式
5858
* @property {Array} list 列数据,数组形式,见官网说明
5959
* @property {Boolean} v-model 布尔值变量,用于控制选择器的弹出与收起
6060
* @property {Boolean} safe-area-inset-bottom 是否开启底部安全区适配(默认false)

uview-ui/iconfont.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/* #endif */
1010

1111
/* 支付宝,百度,头条小程序目前读取大的本地字体文件,导致无法显示图标,故用在线加载的方式-2020-05-12 */
12-
/* #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO */
12+
/* #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO || H5 */
1313
@font-face {
1414
font-family: "uicon-iconfont";
1515
src: url('//at.alicdn.com/t/font_1529455_k9eg3z8m98');

uview-ui/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ import random from './libs/function/random.js'
5454
import trim from './libs/function/trim.js'
5555
// toast提示,对uni.showToast的封装
5656
import toast from './libs/function/toast.js'
57+
// 获取父组件参数
58+
import getParent from './libs/function/getParent.js'
5759

5860

5961
// 配置信息
@@ -83,6 +85,7 @@ const $u = {
8385
random,
8486
deepClone,
8587
deepMerge,
88+
getParent,
8689
trim,
8790
type: ['primary', 'success', 'error', 'warning', 'info'],
8891
http,

uview-ui/libs/function/getParent.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
2+
// this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
3+
export default function getParent(name, keys) {
4+
let parent = this.$parent;
5+
// 通过while历遍,这里主要是为了H5需要多层解析的问题
6+
while (parent) {
7+
// 父组件
8+
if (parent.$options.name !== name) {
9+
parent = parent.$parent;
10+
} else {
11+
return keys.reduce((result, key) => {
12+
result[key] = parent[key];
13+
return result;
14+
}, {});
15+
}
16+
}
17+
18+
return null;
19+
}

uview-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "uview-ui",
3-
"version": "1.3.61",
3+
"version": "1.3.8",
44
"description": "uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
55
"main": "index.js",
66
"keywords": ["uview", "uView", "uni-app", "uni-app ui", "uniapp", "uviewui", "uview ui", "uviewUI", "uViewui", "uViewUI", "uView UI", "uni ui", "uni UI", "uniapp ui", "ui", "UI框架", "uniapp ui框架", "uniapp UI"],

0 commit comments

Comments
 (0)