mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-23 15:09:16 +08:00
[bugfix] AddressEdit: show delete (#1648)
This commit is contained in:
parent
05c4804958
commit
ec0adaedea
@ -60,7 +60,7 @@
|
|||||||
<van-button block :loading="isSaving" @click="onSave" type="primary">
|
<van-button block :loading="isSaving" @click="onSave" type="primary">
|
||||||
{{ saveButtonText || $t('save') }}
|
{{ saveButtonText || $t('save') }}
|
||||||
</van-button>
|
</van-button>
|
||||||
<van-button block :loading="isDeleting" @click="onDelete" v-if="isEdit">
|
<van-button block :loading="isDeleting" @click="onDelete" v-if="showDelete">
|
||||||
{{ deleteButtonText || $t('delete') }}
|
{{ deleteButtonText || $t('delete') }}
|
||||||
</van-button>
|
</van-button>
|
||||||
</div>
|
</div>
|
||||||
@ -164,10 +164,6 @@ export default create({
|
|||||||
return isObj(this.areaList) && Object.keys(this.areaList).length;
|
return isObj(this.areaList) && Object.keys(this.areaList).length;
|
||||||
},
|
},
|
||||||
|
|
||||||
isEdit() {
|
|
||||||
return this.showDelete || !!this.data.id;
|
|
||||||
},
|
|
||||||
|
|
||||||
areaText() {
|
areaText() {
|
||||||
const { province, city, county, areaCode } = this.data;
|
const { province, city, county, areaCode } = this.data;
|
||||||
return province && city && county && areaCode
|
return province && city && county && areaCode
|
||||||
|
@ -231,9 +231,7 @@ test('delete address', async() => {
|
|||||||
const wrapper = mount(AddressEdit, {
|
const wrapper = mount(AddressEdit, {
|
||||||
attachToDocument: true,
|
attachToDocument: true,
|
||||||
propsData: {
|
propsData: {
|
||||||
addressInfo: {
|
showDelete: true
|
||||||
id: '123'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user