[bugfix] AddressEdit: show delete (#1648)

This commit is contained in:
neverland 2018-08-18 10:11:33 +08:00 committed by GitHub
parent 05c4804958
commit ec0adaedea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View File

@ -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

View File

@ -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'
}
} }
}); });