v1.0
This commit is contained in:
2
uni_modules/uv-toolbar/changelog.md
Normal file
2
uni_modules/uv-toolbar/changelog.md
Normal file
@ -0,0 +1,2 @@
|
||||
## 1.0.0(2023-08-02)
|
||||
1. 新增工具条组件
|
40
uni_modules/uv-toolbar/components/uv-toolbar/props.js
Normal file
40
uni_modules/uv-toolbar/components/uv-toolbar/props.js
Normal file
@ -0,0 +1,40 @@
|
||||
export default {
|
||||
props: {
|
||||
// 是否展示工具条
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 是否显示下边框
|
||||
showBorder: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 取消按钮的文字
|
||||
cancelText: {
|
||||
type: String,
|
||||
default: '取消'
|
||||
},
|
||||
// 确认按钮的文字
|
||||
confirmText: {
|
||||
type: String,
|
||||
default: '确认'
|
||||
},
|
||||
// 取消按钮的颜色
|
||||
cancelColor: {
|
||||
type: String,
|
||||
default: '#909193'
|
||||
},
|
||||
// 确认按钮的颜色
|
||||
confirmColor: {
|
||||
type: String,
|
||||
default: '#3c9cff'
|
||||
},
|
||||
// 标题文字
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
...uni.$uv?.props?.toolbar
|
||||
}
|
||||
}
|
109
uni_modules/uv-toolbar/components/uv-toolbar/uv-toolbar.vue
Normal file
109
uni_modules/uv-toolbar/components/uv-toolbar/uv-toolbar.vue
Normal file
@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<view
|
||||
:class="['uv-toolbar',{'uv-border-bottom':showBorder}]"
|
||||
@touchmove.stop.prevent="noop"
|
||||
v-if="show"
|
||||
>
|
||||
<view
|
||||
class="uv-toolbar__cancel__wrapper"
|
||||
hover-class="uv-hover-class"
|
||||
>
|
||||
<text
|
||||
class="uv-toolbar__wrapper__cancel"
|
||||
@tap="cancel"
|
||||
:style="{
|
||||
color: cancelColor
|
||||
}"
|
||||
>{{ cancelText }}</text>
|
||||
</view>
|
||||
<text
|
||||
class="uv-toolbar__title uv-line-1"
|
||||
v-if="title"
|
||||
>{{ title }}</text>
|
||||
<view
|
||||
class="uv-toolbar__confirm__wrapper"
|
||||
hover-class="uv-hover-class"
|
||||
>
|
||||
<text
|
||||
class="uv-toolbar__wrapper__confirm"
|
||||
@tap="confirm"
|
||||
:style="{
|
||||
color: confirmColor
|
||||
}"
|
||||
>{{ confirmText }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import mpMixin from '@/uni_modules/uv-ui-tools/libs/mixin/mpMixin.js'
|
||||
import mixin from '@/uni_modules/uv-ui-tools/libs/mixin/mixin.js'
|
||||
import props from './props.js';
|
||||
/**
|
||||
* Toolbar 工具条
|
||||
* @description
|
||||
* @tutorial https://www.uvui.cn/components/toolbar.html
|
||||
* @property {Boolean} show 是否展示工具条(默认 true )
|
||||
* @property {Boolean} showBorder 是否展示工具条下方边框(默认 false )
|
||||
* @property {String} cancelText 取消按钮的文字(默认 '取消' )
|
||||
* @property {String} confirmText 确认按钮的文字(默认 '确认' )
|
||||
* @property {String} cancelColor 取消按钮的颜色(默认 '#909193' )
|
||||
* @property {String} confirmColor 确认按钮的颜色(默认 '#3c9cff' )
|
||||
* @property {String} title 标题文字
|
||||
* @event {Function}
|
||||
* @example
|
||||
*/
|
||||
export default {
|
||||
name: 'uv-toolbar',
|
||||
emits: ['confirm', 'cancel'],
|
||||
mixins: [mpMixin, mixin, props],
|
||||
methods: {
|
||||
// 点击取消按钮
|
||||
cancel() {
|
||||
this.$emit('cancel')
|
||||
},
|
||||
// 点击确定按钮
|
||||
confirm() {
|
||||
this.$emit('confirm')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$show-lines: 1;
|
||||
$show-hover: 1;
|
||||
$show-border: 1;
|
||||
$show-border-bottom: 1;
|
||||
@import '@/uni_modules/uv-ui-tools/libs/css/variable.scss';
|
||||
@import '@/uni_modules/uv-ui-tools/libs/css/components.scss';
|
||||
$uv-tips-color: #909193 !default;
|
||||
$uv-main-color: #303133 !default;
|
||||
$uv-primary: #3c9cff !default;
|
||||
.uv-toolbar {
|
||||
height: 42px;
|
||||
@include flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
&__wrapper {
|
||||
&__cancel {
|
||||
color: $uv-tips-color;
|
||||
font-size: 15px;
|
||||
padding: 0 15px;
|
||||
}
|
||||
}
|
||||
&__title {
|
||||
color: $uv-main-color;
|
||||
padding: 0 60rpx;
|
||||
font-size: 16px;
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
&__wrapper {
|
||||
&__confirm {
|
||||
color: $uv-primary;
|
||||
font-size: 15px;
|
||||
padding: 0 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
87
uni_modules/uv-toolbar/package.json
Normal file
87
uni_modules/uv-toolbar/package.json
Normal file
@ -0,0 +1,87 @@
|
||||
{
|
||||
"id": "uv-toolbar",
|
||||
"displayName": "uv-toolbar 工具条",
|
||||
"version": "1.0.0",
|
||||
"description": "该组价是仅用于uv-ui中一个公共小工具,提供一个取消和确定的样式,可以设置标题,主要用于弹窗顶部的选择确定工具条",
|
||||
"keywords": [
|
||||
"uv-toolbar",
|
||||
"uvui",
|
||||
"uv-ui",
|
||||
"工具条",
|
||||
"工具"
|
||||
],
|
||||
"repository": "",
|
||||
"engines": {
|
||||
"HBuilderX": "^3.1.0"
|
||||
},
|
||||
"dcloudext": {
|
||||
"type": "component-vue",
|
||||
"sale": {
|
||||
"regular": {
|
||||
"price": "0.00"
|
||||
},
|
||||
"sourcecode": {
|
||||
"price": "0.00"
|
||||
}
|
||||
},
|
||||
"contact": {
|
||||
"qq": ""
|
||||
},
|
||||
"declaration": {
|
||||
"ads": "无",
|
||||
"data": "插件不采集任何数据",
|
||||
"permissions": "无"
|
||||
},
|
||||
"npmurl": ""
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": [
|
||||
"uv-ui-tools"
|
||||
],
|
||||
"encrypt": [],
|
||||
"platforms": {
|
||||
"cloud": {
|
||||
"tcb": "y",
|
||||
"aliyun": "y"
|
||||
},
|
||||
"client": {
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
"vue3": "y"
|
||||
},
|
||||
"App": {
|
||||
"app-vue": "y",
|
||||
"app-nvue": "y"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "y",
|
||||
"Android Browser": "y",
|
||||
"微信浏览器(Android)": "y",
|
||||
"QQ浏览器(Android)": "y"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "y",
|
||||
"IE": "y",
|
||||
"Edge": "y",
|
||||
"Firefox": "y",
|
||||
"Safari": "y"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "y",
|
||||
"阿里": "y",
|
||||
"百度": "y",
|
||||
"字节跳动": "y",
|
||||
"QQ": "y",
|
||||
"钉钉": "u",
|
||||
"快手": "u",
|
||||
"飞书": "u",
|
||||
"京东": "u"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "u",
|
||||
"联盟": "u"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
31
uni_modules/uv-toolbar/readme.md
Normal file
31
uni_modules/uv-toolbar/readme.md
Normal file
@ -0,0 +1,31 @@
|
||||
## Toolbar 工具条
|
||||
|
||||
> **组件名:uv-toolbar**
|
||||
|
||||
该组价是仅用于uv-ui中一个公共小工具,提供一个取消和确定的样式,可以设置标题,主要用于弹窗顶部的选择确定工具条。
|
||||
|
||||
### 基本使用
|
||||
|
||||
```vue
|
||||
<uv-toolbar title="标题文字"></uv-toolbar>
|
||||
```
|
||||
|
||||
### Toolbar Props
|
||||
|
||||
| 属性名 | 类型 | 默认值 | 说明 |
|
||||
|:-|:-|:-|:-|
|
||||
| show | Boolean | true | 是否展示工具条 |
|
||||
| showBorder | Boolean | false | 是否显示下边框 |
|
||||
| cancelText | String | '取消' | 取消按钮的文字 |
|
||||
| confirmText | String | '确定' | 确定按钮的文字 |
|
||||
| cancelColor | String | '#909193' | 取消按钮的颜色 |
|
||||
| confirmColor | String | '#3c9cff' | 确认按钮的颜色 |
|
||||
| title | String | - | 标题文字 |
|
||||
|
||||
## [下载完整示例项目](https://ext.dcloud.net.cn/plugin?name=uv-ui)
|
||||
|
||||
### [更多插件,请关注uv-ui组件库](https://ext.dcloud.net.cn/plugin?name=uv-ui)
|
||||
|
||||

|
||||
|
||||
#### 如使用过程中有任何问题反馈,或者您对uv-ui有一些好的建议,欢迎加入uv-ui官方交流群:<a href="https://www.uvui.cn/components/addQQGroup.html" target="_blank">官方QQ群</a>
|
Reference in New Issue
Block a user