Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

227
Visualizações
How can I add success icons to my web page using vue.js?

Greetings all and pardon my novice for I am just a mere beginner.

I am attempting to add success icons to my webpage by using bootstrap or something similar but I am unsure on how to include the if statement that will be shown below.

If any advice could be spared it would be greatly appreciated.

Here is my "AddEntry.vue" template.

<template>
  <div class="container">
    <RmaForm v-model="rmaEntry" />

    <ActionButton @click="submitItem()" position="1" classes="fas fa-paper-plane" />
  </div>
  
  {{#if alert}}
<div class="alert alert-success alert-dismissible fade show" role="alert">
  <strong>Success!</strong> Data Added to RMA Log. 
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{{/if}}

</template>

Here is my index.js create entry line

// eslint-disable-next-line
    async createRmaEntry({ state }, payload) {
      return new Promise((resolve, reject) => {
        axios({
          method: "post",
          url: prefix + "/api/rma",
          data: {
            rmaEntry: payload,
          },
          headers: { "Content-Type": "application/json" },
        })
    
          .then(function (response) {
            //handle success
            console.log(response);
            resolve(response.data);
          })
          .catch(function (response) {
            //handle error
            console.log(response);
            reject();
          });
      });
    },
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can use conditional rendering v-if or v-show

new Vue({
  el: "#demo",
  data() {
    return {
      alert: false
    }
  },
  methods: {
    load() {
      // your async call
      setTimeout( ()=> {
        this.alert = true
     }, 1500)
    }
  }
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous">
<div id="demo">
  <div class="container">
   <!-- <RmaForm v-model="rmaEntry" />

    <ActionButton @click="submitItem()" position="1" classes="fas fa-paper-plane" />-->
  </div>
<button @click="load">load data</button>
<div v-if="alert" class="alert alert-success alert-dismissible fade show" role="alert">
  <strong>Success!</strong> Data Added to RMA Log. 
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>

</div>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda