tianyi 1 week ago
parent
commit
907b73a70b
  1. 4
      uni_modules/uni-icons/changelog.md
  2. 10
      uni_modules/uni-icons/components/uni-icons/uni-icons.uvue
  3. 6
      uni_modules/uni-icons/components/uni-icons/uni-icons.vue
  4. 109
      uni_modules/uni-icons/package.json
  5. 46
      uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue

4
uni_modules/uni-icons/changelog.md

@ -1,3 +1,7 @@
## 2.0.12(2025-08-26)
- 优化 uni-app x 下 size 类型问题
## 2.0.11(2025-08-18)
- 修复 图标点击事件返回
## 2.0.9(2024-01-12) ## 2.0.9(2024-01-12)
fix: 修复图标大小默认值错误的问题 fix: 修复图标大小默认值错误的问题
## 2.0.8(2023-12-14) ## 2.0.8(2023-12-14)

10
uni_modules/uni-icons/components/uni-icons/uni-icons.uvue

@ -29,8 +29,8 @@
default: '#333333' default: '#333333'
}, },
size: { size: {
type: Object, type: [Number, String],
default: 16 default: 16
}, },
fontFamily: { fontFamily: {
type: String, type: String,
@ -51,9 +51,9 @@
iconSize() : string { iconSize() : string {
const size = this.size const size = this.size
if (typeof size == 'string') { if (typeof size == 'string') {
const reg = /^[0-9]*$/g const reg = /^[0-9]*$/g
return reg.test(size as string) ? '' + size + 'px' : '' + size; return reg.test(size as string) ? '' + size + 'px' : '' + size;
// return '' + this.size // return '' + this.size
} }
return this.getFontSize(size as number) return this.getFontSize(size as number)
}, },

6
uni_modules/uni-icons/components/uni-icons/uni-icons.vue

@ -85,8 +85,8 @@
} }
}, },
methods: { methods: {
_onClick() { _onClick(e) {
this.$emit('click') this.$emit('click', e)
} }
} }
} }
@ -107,4 +107,4 @@
text-decoration: none; text-decoration: none;
text-align: center; text-align: center;
} }
</style> </style>

109
uni_modules/uni-icons/package.json

@ -1,7 +1,7 @@
{ {
"id": "uni-icons", "id": "uni-icons",
"displayName": "uni-icons 图标", "displayName": "uni-icons 图标",
"version": "2.0.9", "version": "2.0.12",
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。", "description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
@ -11,12 +11,14 @@
], ],
"repository": "https://github.com/dcloudio/uni-ui", "repository": "https://github.com/dcloudio/uni-ui",
"engines": { "engines": {
"HBuilderX": "^3.2.14" "HBuilderX": "^3.2.14",
"uni-app": "^4.08",
"uni-app-x": "^4.61"
}, },
"directories": { "directories": {
"example": "../../temps/example_temps" "example": "../../temps/example_temps"
}, },
"dcloudext": { "dcloudext": {
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
@ -34,55 +36,76 @@
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue" "type": "component-vue",
"darkmode": "x",
"i18n": "x",
"widescreen": "x"
}, },
"uni_modules": { "uni_modules": {
"dependencies": ["uni-scss"], "dependencies": [
"uni-scss"
],
"encrypt": [], "encrypt": [],
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "x",
"aliyun": "y" "aliyun": "x",
"alipay": "x"
}, },
"client": { "client": {
"App": { "uni-app": {
"app-vue": "y", "vue": {
"app-nvue": "y", "vue2": "√",
"app-uvue": "y" "vue3": "√"
},
"web": {
"safari": "√",
"chrome": "√"
},
"app": {
"vue": "√",
"nvue": "-",
"android": {
"extVersion": "",
"minVersion": "29"
},
"ios": "√",
"harmony": "√"
},
"mp": {
"weixin": "√",
"alipay": "√",
"toutiao": "√",
"baidu": "√",
"kuaishou": "-",
"jd": "-",
"harmony": "-",
"qq": "√",
"lark": "-"
},
"quickapp": {
"huawei": "√",
"union": "√"
}
}, },
"H5-mobile": { "uni-app-x": {
"Safari": "y", "web": {
"Android Browser": "y", "safari": "√",
"微信浏览器(Android)": "y", "chrome": "√"
"QQ浏览器(Android)": "y" },
}, "app": {
"H5-pc": { "android": {
"Chrome": "y", "extVersion": "",
"IE": "y", "minVersion": "29"
"Edge": "y", },
"Firefox": "y", "ios": "√",
"Safari": "y" "harmony": "√"
}, },
"小程序": { "mp": {
"微信": "y", "weixin": "√"
"阿里": "y", }
"百度": "y",
"字节跳动": "y",
"QQ": "y",
"钉钉": "y",
"快手": "y",
"飞书": "y",
"京东": "y"
},
"快应用": {
"华为": "y",
"联盟": "y"
},
"Vue": {
"vue2": "y",
"vue3": "y"
} }
} }
} }
} }
} }

46
uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="segmented-control"> <view class="page1">
<view v-for="(item, index) in values" class="segmented-control__item" @click="_onClick(index)"> <view v-for="(item, index) in values" class="page1__item" @click="_onClick(index)">
<view> <view>
<text :style="{color: <text :style="{color:
index === currentIndex index === currentIndex
@ -9,7 +9,7 @@
: '#fff' : '#fff'
: styleType === 'text' : styleType === 'text'
? '#000' ? '#000'
: activeColor}" class="segmented-control__text" :class="styleType === 'text' && index === currentIndex ? 'segmented-control__item--text': ''">{{ item }}</text> : activeColor}" class="page1__text" :class="styleType === 'text' && index === currentIndex ? 'page1__item--text': ''">{{ item }}</text>
</view> </view>
</view> </view>
@ -82,48 +82,30 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.segmented-control { page{
width: 500rpx; width: 100% ;
}
.page1 {
width: 100%;
overflow-x: scroll; overflow-x: scroll;
height: 100rpx; height: 80rpx;
line-height: 100rpx; line-height: 100rpx;
background: #777;
} }
.segmented-control__item { .page1__item {
display: inline-block; float: left;
box-sizing: border-box;
width: 120rpx; width: 120rpx;
justify-content: center;
align-items: center;
}
.segmented-control__item--button {
border-style: solid;
border-top-width: 1px;
border-bottom-width: 1px;
border-right-width: 1px;
border-left-width: 0;
}
.segmented-control__item--button--first {
border-left-width: 1px;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
.segmented-control__item--button--last {
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
} }
.segmented-control__item--text { .page1__item--text {
border-bottom-style: solid; border-bottom-style: solid;
border-bottom-width: 2px; border-bottom-width: 2px;
padding: 12rpx 0; padding: 12rpx 0;
} }
.segmented-control__text { .page1__text {
font-size: 28rpx; font-size: 28rpx;
line-height: 40rpx; line-height: 40rpx;
text-align: center; text-align: center;

Loading…
Cancel
Save