AddAddress option buttonType: component manage button in edit or create context

This commit is contained in:
2021-08-17 15:41:03 +02:00
parent 43f9e50100
commit cdc6cf211a
9 changed files with 35 additions and 49 deletions

View File

@@ -50,7 +50,6 @@ export default {
create: window.buttonText || null,
edit: window.buttonText || null
},
type: window.buttonType || null,
size: window.buttonSize || null,
displayText: window.buttonDisplayText //boolean, default: true
},

View File

@@ -145,7 +145,7 @@ export default {
default: {
button: {
text: { create: 'add_an_address_title', edit: 'edit_address' },
type: 'btn-create',
type: { create: 'btn-create', edit: 'btn-update'},
displayText: true
},
title: { create: 'add_an_address_title', edit: 'edit_address' },
@@ -223,13 +223,10 @@ export default {
return (this.context.edit) ? this.default.button.text.edit : this.default.button.text.create;
},
getClassButton() {
let type = this.default.button.type,
size = '';
if (typeof this.options.button !== 'undefined') {
type = this.options.button.type !== null ? this.options.button.type : type;
size = this.options.button.size !== null ? this.options.button.size : size;
}
return size ? `${size} ${type}` : type;
let type = (this.context.edit) ? this.default.button.type.edit : this.default.button.type.create;
let size = (typeof this.options.button !== 'undefined' && this.options.button.size !== null) ?
`${this.options.button.size} ` : '';
return `${size}${type}`;
},
displayTextButton() {
return (typeof this.options.button !== 'undefined' && typeof this.options.button.displayText !== 'undefined') ?

View File

@@ -3,8 +3,6 @@ import App from './App.vue';
import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n';
import { addressMessages } from './i18n';
//import { createI18n } from 'vue-i18n';
//const i18n = createI18n();
const i18n = _createI18n( addressMessages );
const app = createApp({