mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(AddressEdit): remove unused finish button (#9364)
This commit is contained in:
parent
bcd4ddfbe4
commit
f37fb01c4d
@ -1,7 +1,7 @@
|
||||
import { PropType, ref, defineComponent } from 'vue';
|
||||
|
||||
// Utils
|
||||
import { isAndroid, createNamespace } from '../utils';
|
||||
import { createNamespace } from '../utils';
|
||||
|
||||
// Components
|
||||
import { Cell } from '../cell';
|
||||
@ -12,7 +12,6 @@ import type { AddressEditSearchItem } from './types';
|
||||
import type { FieldInstance } from '../field/types';
|
||||
|
||||
const [name, bem, t] = createNamespace('address-edit-detail');
|
||||
const android = isAndroid();
|
||||
|
||||
export default defineComponent({
|
||||
name,
|
||||
@ -41,18 +40,6 @@ export default defineComponent({
|
||||
emit('input', `${express.address || ''} ${express.name || ''}`.trim());
|
||||
};
|
||||
|
||||
const onFinish = () => field.value?.blur();
|
||||
|
||||
const renderFinish = () => {
|
||||
if (props.value && props.focused && android) {
|
||||
return (
|
||||
<div class={bem('finish')} onClick={onFinish}>
|
||||
{t('complete')}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const renderSearchTitle = (express: AddressEditSearchItem) => {
|
||||
if (express.name) {
|
||||
const text = express.name.replace(
|
||||
@ -95,15 +82,14 @@ export default defineComponent({
|
||||
return (
|
||||
<>
|
||||
<Field
|
||||
v-slots={{ icon: renderFinish }}
|
||||
autosize
|
||||
clearable
|
||||
ref={field}
|
||||
class={bem()}
|
||||
rows={props.detailRows}
|
||||
type="textarea"
|
||||
label={t('label')}
|
||||
border={!showSearchResult()}
|
||||
clearable={!android}
|
||||
maxlength={props.detailMaxlength}
|
||||
modelValue={props.value}
|
||||
placeholder={t('placeholder')}
|
||||
|
@ -186,5 +186,3 @@ The component provides the following CSS variables, which can be used to customi
|
||||
| --van-address-edit-buttons-padding | _var(--van-padding-xl) var(--van-padding-base)_ | - |
|
||||
| --van-address-edit-button-margin-bottom | _var(--van-padding-sm)_ | - |
|
||||
| --van-address-edit-button-font-size | _var(--van-font-size-lg)_ | - |
|
||||
| --van-address-edit-detail-finish-color | _var(--van-primary-color)_ | - |
|
||||
| --van-address-edit-detail-finish-font-size | _var(--van-font-size-sm)_ | - |
|
||||
|
@ -188,5 +188,3 @@ addressEditRef.value?.setAddressDetail('');
|
||||
| --van-address-edit-buttons-padding | _var(--van-padding-xl) var(--van-padding-base)_ | - |
|
||||
| --van-address-edit-button-margin-bottom | _var(--van-padding-sm)_ | - |
|
||||
| --van-address-edit-button-font-size | _var(--van-font-size-lg)_ | - |
|
||||
| --van-address-edit-detail-finish-color | _var(--van-primary-color)_ | - |
|
||||
| --van-address-edit-detail-finish-font-size | _var(--van-font-size-sm)_ | - |
|
||||
|
@ -5,8 +5,6 @@
|
||||
--van-address-edit-buttons-padding: @address-edit-buttons-padding;
|
||||
--van-address-edit-button-margin-bottom: @address-edit-button-margin-bottom;
|
||||
--van-contact-edit-button-font-size: @address-edit-button-font-size;
|
||||
--van-address-edit-detail-finish-color: @address-edit-detail-finish-color;
|
||||
--van-address-edit-detail-finish-font-size: @address-edit-detail-finish-font-size;
|
||||
}
|
||||
|
||||
.van-address-edit {
|
||||
@ -44,10 +42,5 @@
|
||||
&__keyword {
|
||||
color: var(--van-danger-color);
|
||||
}
|
||||
|
||||
&__finish {
|
||||
color: var(--van-address-edit-detail-finish-color);
|
||||
font-size: var(--van-address-edit-detail-finish-font-size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,5 +4,3 @@
|
||||
@address-edit-buttons-padding: var(--van-padding-xl) var(--van-padding-base);
|
||||
@address-edit-button-margin-bottom: var(--van-padding-sm);
|
||||
@address-edit-button-font-size: var(--van-font-size-lg);
|
||||
@address-edit-detail-finish-color: var(--van-primary-color);
|
||||
@address-edit-detail-finish-font-size: var(--van-font-size-sm);
|
||||
|
@ -5,7 +5,6 @@ export default {
|
||||
confirm: 'Bestätigen',
|
||||
cancel: 'Abbrechen',
|
||||
delete: 'Löschen',
|
||||
complete: 'Complete',
|
||||
loading: 'Laden...',
|
||||
nameEmpty: 'Bitte geben Sie den Name an',
|
||||
confirmDelete: 'Sind Sie sicher, dass Sie löschen möchten?',
|
||||
|
@ -5,7 +5,6 @@ export default {
|
||||
confirm: 'Bestätigen',
|
||||
cancel: 'Abbrechen',
|
||||
delete: 'Löschen',
|
||||
complete: 'Complete',
|
||||
loading: 'Laden...',
|
||||
nameEmpty: 'Bitte den Name angeben',
|
||||
confirmDelete: 'Bist du sicher, dass du löschen möchtest?',
|
||||
|
@ -5,7 +5,6 @@ export default {
|
||||
confirm: 'Confirm',
|
||||
cancel: 'Cancel',
|
||||
delete: 'Delete',
|
||||
complete: 'Complete',
|
||||
loading: 'Loading...',
|
||||
nameEmpty: 'Please fill in the name',
|
||||
confirmDelete: 'Are you sure you want to delete?',
|
||||
|
@ -5,7 +5,6 @@ export default {
|
||||
confirm: 'Confirmar',
|
||||
cancel: 'Cancelar',
|
||||
delete: 'Eliminar',
|
||||
complete: 'Completado',
|
||||
loading: 'Cargando...',
|
||||
nameEmpty: 'Por favor rellena el nombre',
|
||||
confirmDelete: 'Estás seguro de eliminarlo?',
|
||||
|
@ -5,7 +5,6 @@ export default {
|
||||
confirm: 'Confirmer',
|
||||
cancel: 'Annuler',
|
||||
delete: 'Suprimer',
|
||||
complete: 'Terminé',
|
||||
loading: 'Chargement...',
|
||||
nameEmpty: 'Veuillez remplir le nom',
|
||||
confirmDelete: 'Êtes-vous sûr de vouloir supprimer?',
|
||||
|
@ -5,7 +5,6 @@ export default {
|
||||
confirm: '確認',
|
||||
cancel: 'キャンセル',
|
||||
delete: '削除',
|
||||
complete: '完了',
|
||||
loading: '読み込み中...',
|
||||
nameEmpty: '名前を入力してください',
|
||||
confirmDelete: '本当に削除しますか',
|
||||
|
@ -5,7 +5,6 @@ export default {
|
||||
confirm: 'Bekreft',
|
||||
cancel: 'Avbryt',
|
||||
delete: 'Slett',
|
||||
complete: 'Fullfør',
|
||||
loading: 'Laster...',
|
||||
nameEmpty: 'Vennligst fyll inn navn',
|
||||
confirmDelete: 'Er du sikker på at du vil slette?',
|
||||
|
@ -5,7 +5,6 @@ export default {
|
||||
confirm: 'Confirmă',
|
||||
cancel: 'Anulează',
|
||||
delete: 'Șterge',
|
||||
complete: 'Finalizează',
|
||||
loading: 'Încărcare...',
|
||||
nameEmpty: 'Te rugăm să completezi numele',
|
||||
confirmDelete: 'Ești sigur ca vrei sa stergi?',
|
||||
|
@ -5,7 +5,6 @@ export default {
|
||||
confirm: 'Подтвердить',
|
||||
cancel: 'Отмена',
|
||||
delete: 'Удалить',
|
||||
complete: 'Завершить',
|
||||
loading: 'Загрузка...',
|
||||
nameEmpty: 'Пожалуйста укажите имя',
|
||||
confirmDelete: 'Вы уверены, что хотите удалить?',
|
||||
|
@ -5,7 +5,6 @@ export default {
|
||||
confirm: 'ยืนยัน',
|
||||
cancel: 'ยกเลิก',
|
||||
delete: 'ลบ',
|
||||
complete: 'ดำเนินการ',
|
||||
loading: 'กำลังโหลด...',
|
||||
nameEmpty: 'กรุณากรอกชื่อของคุณ',
|
||||
confirmDelete: 'คุณแน่ใจว่าต้องการลบ',
|
||||
|
@ -5,7 +5,6 @@ export default {
|
||||
confirm: 'Onayla',
|
||||
cancel: 'İptal',
|
||||
delete: 'Sil',
|
||||
complete: 'Tamamla',
|
||||
loading: 'Yükleniyor...',
|
||||
nameEmpty: 'Lütfen isim giriniz',
|
||||
confirmDelete: 'Silmek istediğinize emin misiniz?',
|
||||
|
@ -5,7 +5,6 @@ export default {
|
||||
confirm: '确认',
|
||||
cancel: '取消',
|
||||
delete: '删除',
|
||||
complete: '完成',
|
||||
loading: '加载中...',
|
||||
nameEmpty: '请填写姓名',
|
||||
confirmDelete: '确定要删除吗',
|
||||
|
@ -5,7 +5,6 @@ export default {
|
||||
confirm: '確認',
|
||||
cancel: '取消',
|
||||
delete: '刪除',
|
||||
complete: '完成',
|
||||
loading: '加載中...',
|
||||
nameEmpty: '請填寫姓名',
|
||||
confirmDelete: '確定要刪除嗎',
|
||||
|
@ -5,7 +5,6 @@ export default {
|
||||
confirm: '確認',
|
||||
cancel: '取消',
|
||||
delete: '刪除',
|
||||
complete: '完成',
|
||||
loading: '載入中...',
|
||||
nameEmpty: '請填寫姓名',
|
||||
confirmDelete: '確定要刪除嗎',
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { deepClone } from '../deep-clone';
|
||||
import { deepAssign } from '../deep-assign';
|
||||
import { get, noop } from '..';
|
||||
import { isDef, isMobile, isNumeric, isAndroid } from '../validate';
|
||||
import { isDef, isMobile, isNumeric } from '../validate';
|
||||
import { camelize } from '../format/string';
|
||||
import { formatNumber } from '../format/number';
|
||||
import { addUnit, unitToPx } from '../format/unit';
|
||||
@ -57,10 +57,6 @@ test('get', () => {
|
||||
expect(get({ a: { b: 2 } }, 'a.b.c')).toEqual('');
|
||||
});
|
||||
|
||||
test('isAndroid', () => {
|
||||
expect(isAndroid()).toBeFalsy();
|
||||
});
|
||||
|
||||
test('isMobile', () => {
|
||||
expect(isMobile('13000000000')).toBeTruthy();
|
||||
expect(isMobile('+8613000000000')).toBeTruthy();
|
||||
|
@ -35,10 +35,6 @@ export function isNumeric(val: string | number): val is string {
|
||||
return typeof val === 'number' || /^\d+(\.\d+)?$/.test(val);
|
||||
}
|
||||
|
||||
export function isAndroid(): boolean {
|
||||
return inBrowser ? /android/.test(navigator.userAgent.toLowerCase()) : false;
|
||||
}
|
||||
|
||||
export function isIOS(): boolean {
|
||||
return inBrowser
|
||||
? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase())
|
||||
|
Loading…
x
Reference in New Issue
Block a user