Tuyen
  • Welcome to my document
  • 💼 My work
    • Updimes
      • Custom Link
      • How to add a table of contents
    • Ryviu Shopify
      • Theme
        • Kalles
      • 1.0
      • 2.0
      • Má»™t số lá»—i theme
        • Lá»—i hình ảnh không hiển thị trên theme Avenue
    • Ryviu Wordpress
      • Shortcode
      • Product hook
      • Collection hook
    • Ryviu Blog
      • Thêm HTML code to blog
      • Add Q&A sections to blog post
      • Add button to CMS blog
  • Ryviu Polaris
    • Skeleton
    • Components
    • Image loading
    • Modal Confirm
    • Table Polaris
Powered by GitBook
On this page

Was this helpful?

  1. Ryviu Polaris

Modal Confirm

PreviousImage loadingNextTable Polaris

Last updated 1 year ago

Was this helpful?

modalConfirmStore: state => state.modalConfirmStore

this.resetModalConfirm()

this.modalAction('')

critical

watch: {
  modalConfirmStore(newVal, old) {
    if(newVal){
      if(newVal.confirmStatus){
        switch (newVal.typeModal) {
          case 'Delete_Questions':
            this.removeAllQuestion();
            break;

          default:
        }
      }
    }
  }
}

modalAction(type) {
  let modalConfig = {
    dialogVisible: true,
    typeButton: 'primary',
    typeModal: '',
    titleModal: '',
    subModal: '',
    titleButton: ''
  };

  switch (type) {
    case 'delete':
      modalConfig.typeButton = 'critical';
      modalConfig.typeModal = 'Delete_Questions';
      modalConfig.titleModal = 'Remove all questions selected.';
      modalConfig.subModal = 'This can’t be undone.';
      modalConfig.titleButton = 'Delete';
      break;

    default:
  }

  this.$store.commit('setModalConfirmStore', { ...this.modalConfirmStore, ...modalConfig });
},