mirror of
https://gitee.com/vant-contrib/vant.git
synced 2026-06-04 01:28:19 +08:00
Compare commits
4 Commits
3a53fa3aed
...
1fd630a9d2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1fd630a9d2 | ||
|
|
76e8e62efd | ||
|
|
1167293d12 | ||
|
|
a69385d867 |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vant",
|
||||
"version": "2.12.26",
|
||||
"version": "2.12.27-beta.0",
|
||||
"description": "Mobile UI Components built on Vue",
|
||||
"main": "lib/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-right-icon-color | `@gray-6` | - |
|
||||
| @field-error-message-color | `@red` | - |
|
||||
| @field-error-message-text-color | `12px` | - |
|
||||
| @field-error-message-font-size | `12px` | - |
|
||||
| @field-text-area-min-height | `60px` | - |
|
||||
| @field-word-limit-color | `@gray-7` | - |
|
||||
| @field-word-limit-font-size | `@font-size-sm` | - |
|
||||
|
||||
@ -332,7 +332,7 @@ export default {
|
||||
| @field-clear-icon-color | `@gray-5` | - |
|
||||
| @field-right-icon-color | `@gray-6` | - |
|
||||
| @field-error-message-color | `@red` | - |
|
||||
| @field-error-message-text-color | `12px` | - |
|
||||
| @field-error-message-font-size | `12px` | - |
|
||||
| @field-text-area-min-height | `60px` | - |
|
||||
| @field-word-limit-color | `@gray-7` | - |
|
||||
| @field-word-limit-font-size | `@font-size-sm` | - |
|
||||
|
||||
@ -134,7 +134,7 @@
|
||||
|
||||
&__error-message {
|
||||
color: @field-error-message-color;
|
||||
font-size: @field-error-message-text-color;
|
||||
font-size: @field-error-message-font-size;
|
||||
text-align: left;
|
||||
|
||||
&--center {
|
||||
|
||||
@ -340,6 +340,14 @@ messageConfig: {
|
||||
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)
|
||||
uploadMaxSize: 3,
|
||||
// placeholder 配置
|
||||
|
||||
@ -12,6 +12,7 @@ export default createComponent({
|
||||
props: {
|
||||
value: String,
|
||||
uploadImg: Function,
|
||||
customUpload: Function,
|
||||
maxSize: {
|
||||
type: Number,
|
||||
default: 6,
|
||||
@ -56,6 +57,15 @@ export default createComponent({
|
||||
onDelete() {
|
||||
this.$emit('input', '');
|
||||
},
|
||||
|
||||
onClickUpload() {
|
||||
if (this.customUpload) {
|
||||
this.customUpload().then((url) => {
|
||||
this.fileList.push({ url });
|
||||
this.$emit('input', url);
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
render() {
|
||||
@ -63,10 +73,12 @@ export default createComponent({
|
||||
<Uploader
|
||||
vModel={this.fileList}
|
||||
maxCount={1}
|
||||
afterRead={this.afterReadFile}
|
||||
readonly={!!this.customUpload}
|
||||
maxSize={this.maxSize * 1024 * 1024}
|
||||
afterRead={this.afterReadFile}
|
||||
onOversize={this.onOversize}
|
||||
onDelete={this.onDelete}
|
||||
onClick-upload={this.onClickUpload}
|
||||
/>
|
||||
);
|
||||
},
|
||||
|
||||
@ -141,6 +141,7 @@ export default createComponent({
|
||||
vModel={this.messageValues[index].value}
|
||||
maxSize={this.messageConfig.uploadMaxSize}
|
||||
uploadImg={this.messageConfig.uploadImg}
|
||||
customUpload={this.messageConfig.customUpload}
|
||||
/>
|
||||
<div class={bem('image-cell-label')}>{t('imageLabel')}</div>
|
||||
</Cell>
|
||||
|
||||
@ -397,7 +397,7 @@
|
||||
@field-clear-icon-color: @gray-5;
|
||||
@field-right-icon-color: @gray-6;
|
||||
@field-error-message-color: @red;
|
||||
@field-error-message-text-color: 12px;
|
||||
@field-error-message-font-size: 12px;
|
||||
@field-text-area-min-height: 60px;
|
||||
@field-word-limit-color: @gray-7;
|
||||
@field-word-limit-font-size: @font-size-sm;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user