-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: 新增up-picker/up-toolbar组件uni-app-x版本及全局样式兼容
- Loading branch information
jry
committed
Sep 12, 2024
1 parent
4e77f32
commit f8959da
Showing
20 changed files
with
837 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/uni_modules/uview-plus/components/up-picker-column/props.uts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { defineMixin } from '../../libs/vue' | ||
|
||
export const propsPickerColumn = defineMixin({ | ||
props: { | ||
|
||
} | ||
}) |
28 changes: 28 additions & 0 deletions
28
src/uni_modules/uview-plus/components/up-picker-column/up-picker-column.uvue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template> | ||
<picker-view-column> | ||
<view class="up-picker-column"> | ||
</view> | ||
</picker-view-column> | ||
</template> | ||
|
||
<script> | ||
import { propsPickerColumn } from './props'; | ||
import { mpMixin } from '../../libs/mixin/mpMixin'; | ||
import { mixin } from '../../libs/mixin/mixin'; | ||
/** | ||
* PickerColumn | ||
* @description | ||
* @tutorial url | ||
* @property {String} | ||
* @event {Function} | ||
* @example | ||
*/ | ||
export default { | ||
name: 'up-picker-column', | ||
mixins: [mpMixin, mixin, propsPickerColumn], | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@import "../../libs/css/components.scss"; | ||
</style> |
30 changes: 30 additions & 0 deletions
30
src/uni_modules/uview-plus/components/up-picker/picker.uts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* @Author : jry | ||
* @Description : | ||
* @version : 4.0 | ||
* @Date : 2024-09-12 15:25:27 | ||
* @LastAuthor : jry | ||
* @lastTime : 2024-09-12 15:25:27 | ||
* @FilePath : /uview-plus/libs/config/props/picker | ||
*/ | ||
export default { | ||
// picker | ||
picker: { | ||
show: false, | ||
popupMode: 'bottom', | ||
showToolbar: true, | ||
title: '', | ||
columns: [] as Array<Array<any>>, | ||
loading: false, | ||
itemHeight: 44, | ||
cancelText: '取消', | ||
confirmText: '确定', | ||
cancelColor: '#909193', | ||
confirmColor: '#3c9cff', | ||
visibleItemCount: 5, | ||
keyName: 'text', | ||
closeOnClickOverlay: false, | ||
defaultIndex: [] as number[], | ||
immediateChange: true | ||
} | ||
} as UTSJSONObject |
114 changes: 114 additions & 0 deletions
114
src/uni_modules/uview-plus/components/up-picker/props.uts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
/* | ||
* @Author : jry | ||
* @Description : | ||
* @version : 4.0 | ||
* @Date : 2024-09-12 15:25:27 | ||
* @LastAuthor : jry | ||
* @lastTime : 2024-09-12 15:25:27 | ||
* @FilePath : /uview-plus/libs/config/props/picker | ||
*/ | ||
import { defineMixin } from '../../libs/vue' | ||
import defProps from './picker' | ||
let crtProp = defProps['picker'] as UTSJSONObject | ||
|
||
export const propsPicker = defineMixin({ | ||
props: { | ||
modelValue: { | ||
type: Array, | ||
default: [] as Array<any> | ||
}, | ||
hasInput: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
placeholder: { | ||
type: String, | ||
default: '请选择' | ||
}, | ||
// 是否展示picker弹窗 | ||
show: { | ||
type: Boolean, | ||
default: crtProp['show'] | ||
}, | ||
// 弹出的方向,可选值为 top bottom right left center | ||
popupMode: { | ||
type: String, | ||
default: crtProp['popupMode'] | ||
}, | ||
// 是否展示顶部的操作栏 | ||
showToolbar: { | ||
type: Boolean, | ||
default: crtProp['showToolbar'] | ||
}, | ||
// 顶部标题 | ||
title: { | ||
type: String, | ||
default: crtProp['title'] | ||
}, | ||
// 对象数组,设置每一列的数据 | ||
columns: { | ||
type: Array, | ||
default: crtProp['columns'] | ||
}, | ||
// 是否显示加载中状态 | ||
loading: { | ||
type: Boolean, | ||
default: crtProp['loading'] | ||
}, | ||
// 各列中,单个选项的高度 | ||
itemHeight: { | ||
type: [String, Number], | ||
default: crtProp['itemHeight'] | ||
}, | ||
// 取消按钮的文字 | ||
cancelText: { | ||
type: String, | ||
default: crtProp['cancelText'] | ||
}, | ||
// 确认按钮的文字 | ||
confirmText: { | ||
type: String, | ||
default: crtProp['confirmText'] | ||
}, | ||
// 取消按钮的颜色 | ||
cancelColor: { | ||
type: String, | ||
default: crtProp['cancelColor'] | ||
}, | ||
// 确认按钮的颜色 | ||
confirmColor: { | ||
type: String, | ||
default: crtProp['confirmColor'] | ||
}, | ||
// 每列中可见选项的数量 | ||
visibleItemCount: { | ||
type: [String, Number], | ||
default: crtProp['visibleItemCount'] | ||
}, | ||
// 选项对象中,需要展示的属性键名 | ||
keyName: { | ||
type: String, | ||
default: crtProp['keyName'] | ||
}, | ||
// 是否允许点击遮罩关闭选择器 | ||
closeOnClickOverlay: { | ||
type: Boolean, | ||
default: crtProp['closeOnClickOverlay'] | ||
}, | ||
// 各列的默认索引 | ||
defaultIndex: { | ||
type: Array, | ||
default: crtProp['defaultIndex'] | ||
}, | ||
// 是否在手指松开时立即触发 change 事件。若不开启则会在滚动动画结束后触发 change 事件,只在微信2.21.1及以上有效 | ||
immediateChange: { | ||
type: Boolean, | ||
default: crtProp['immediateChange'] | ||
}, | ||
// 工具栏右侧插槽是否开启 | ||
toolbarRightSlot: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
} | ||
}) |
Oops, something went wrong.