mirror of
https://gitee.com/vant-contrib/vant.git
synced 2026-06-04 09:38:09 +08:00
Compare commits
4 Commits
3a53fa3aed
...
1fd630a9d2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1fd630a9d2 | ||
|
|
76e8e62efd | ||
|
|
1167293d12 | ||
|
|
a69385d867 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vant",
|
"name": "vant",
|
||||||
"version": "2.12.26",
|
"version": "2.12.27-beta.0",
|
||||||
"description": "Mobile UI Components built on Vue",
|
"description": "Mobile UI Components built on Vue",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
|
|||||||
@ -307,7 +307,7 @@ How to use: [Custom Theme](#/en-US/theme).
|
|||||||
| @field-clear-icon-color | `@gray-5` | - |
|
| @field-clear-icon-color | `@gray-5` | - |
|
||||||
| @field-right-icon-color | `@gray-6` | - |
|
| @field-right-icon-color | `@gray-6` | - |
|
||||||
| @field-error-message-color | `@red` | - |
|
| @field-error-message-color | `@red` | - |
|
||||||
| @field-error-message-text-color | `12px` | - |
|
| @field-error-message-font-size | `12px` | - |
|
||||||
| @field-text-area-min-height | `60px` | - |
|
| @field-text-area-min-height | `60px` | - |
|
||||||
| @field-word-limit-color | `@gray-7` | - |
|
| @field-word-limit-color | `@gray-7` | - |
|
||||||
| @field-word-limit-font-size | `@font-size-sm` | - |
|
| @field-word-limit-font-size | `@font-size-sm` | - |
|
||||||
|
|||||||
@ -332,7 +332,7 @@ export default {
|
|||||||
| @field-clear-icon-color | `@gray-5` | - |
|
| @field-clear-icon-color | `@gray-5` | - |
|
||||||
| @field-right-icon-color | `@gray-6` | - |
|
| @field-right-icon-color | `@gray-6` | - |
|
||||||
| @field-error-message-color | `@red` | - |
|
| @field-error-message-color | `@red` | - |
|
||||||
| @field-error-message-text-color | `12px` | - |
|
| @field-error-message-font-size | `12px` | - |
|
||||||
| @field-text-area-min-height | `60px` | - |
|
| @field-text-area-min-height | `60px` | - |
|
||||||
| @field-word-limit-color | `@gray-7` | - |
|
| @field-word-limit-color | `@gray-7` | - |
|
||||||
| @field-word-limit-font-size | `@font-size-sm` | - |
|
| @field-word-limit-font-size | `@font-size-sm` | - |
|
||||||
|
|||||||
@ -134,7 +134,7 @@
|
|||||||
|
|
||||||
&__error-message {
|
&__error-message {
|
||||||
color: @field-error-message-color;
|
color: @field-error-message-color;
|
||||||
font-size: @field-error-message-text-color;
|
font-size: @field-error-message-font-size;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
||||||
&--center {
|
&--center {
|
||||||
|
|||||||
@ -340,6 +340,14 @@ messageConfig: {
|
|||||||
setTimeout(() => resolve('https://img01.yzcdn.cn/upload_files/2017/02/21/FjKTOxjVgnUuPmHJRdunvYky9OHP.jpg!100x100.jpg'), 1000);
|
setTimeout(() => resolve('https://img01.yzcdn.cn/upload_files/2017/02/21/FjKTOxjVgnUuPmHJRdunvYky9OHP.jpg!100x100.jpg'), 1000);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 可选项,自定义图片上传逻辑,使用此选项时,会禁用原生图片选择
|
||||||
|
customUpload: () => {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
resolve('https://img01.yzcdn.cn/vant/leaf.jpg');
|
||||||
|
}, 1000);
|
||||||
|
});
|
||||||
|
},
|
||||||
// 最大上传体积 (MB)
|
// 最大上传体积 (MB)
|
||||||
uploadMaxSize: 3,
|
uploadMaxSize: 3,
|
||||||
// placeholder 配置
|
// placeholder 配置
|
||||||
|
|||||||
@ -12,6 +12,7 @@ export default createComponent({
|
|||||||
props: {
|
props: {
|
||||||
value: String,
|
value: String,
|
||||||
uploadImg: Function,
|
uploadImg: Function,
|
||||||
|
customUpload: Function,
|
||||||
maxSize: {
|
maxSize: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 6,
|
default: 6,
|
||||||
@ -56,6 +57,15 @@ export default createComponent({
|
|||||||
onDelete() {
|
onDelete() {
|
||||||
this.$emit('input', '');
|
this.$emit('input', '');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onClickUpload() {
|
||||||
|
if (this.customUpload) {
|
||||||
|
this.customUpload().then((url) => {
|
||||||
|
this.fileList.push({ url });
|
||||||
|
this.$emit('input', url);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@ -63,10 +73,12 @@ export default createComponent({
|
|||||||
<Uploader
|
<Uploader
|
||||||
vModel={this.fileList}
|
vModel={this.fileList}
|
||||||
maxCount={1}
|
maxCount={1}
|
||||||
afterRead={this.afterReadFile}
|
readonly={!!this.customUpload}
|
||||||
maxSize={this.maxSize * 1024 * 1024}
|
maxSize={this.maxSize * 1024 * 1024}
|
||||||
|
afterRead={this.afterReadFile}
|
||||||
onOversize={this.onOversize}
|
onOversize={this.onOversize}
|
||||||
onDelete={this.onDelete}
|
onDelete={this.onDelete}
|
||||||
|
onClick-upload={this.onClickUpload}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -141,6 +141,7 @@ export default createComponent({
|
|||||||
vModel={this.messageValues[index].value}
|
vModel={this.messageValues[index].value}
|
||||||
maxSize={this.messageConfig.uploadMaxSize}
|
maxSize={this.messageConfig.uploadMaxSize}
|
||||||
uploadImg={this.messageConfig.uploadImg}
|
uploadImg={this.messageConfig.uploadImg}
|
||||||
|
customUpload={this.messageConfig.customUpload}
|
||||||
/>
|
/>
|
||||||
<div class={bem('image-cell-label')}>{t('imageLabel')}</div>
|
<div class={bem('image-cell-label')}>{t('imageLabel')}</div>
|
||||||
</Cell>
|
</Cell>
|
||||||
|
|||||||
@ -397,7 +397,7 @@
|
|||||||
@field-clear-icon-color: @gray-5;
|
@field-clear-icon-color: @gray-5;
|
||||||
@field-right-icon-color: @gray-6;
|
@field-right-icon-color: @gray-6;
|
||||||
@field-error-message-color: @red;
|
@field-error-message-color: @red;
|
||||||
@field-error-message-text-color: 12px;
|
@field-error-message-font-size: 12px;
|
||||||
@field-text-area-min-height: 60px;
|
@field-text-area-min-height: 60px;
|
||||||
@field-word-limit-color: @gray-7;
|
@field-word-limit-color: @gray-7;
|
||||||
@field-word-limit-font-size: @font-size-sm;
|
@field-word-limit-font-size: @font-size-sm;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user