Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

243
Vistas
Having problem in Selecting the url from the database

I am building a generator website in vuejs. I want to make a link generator for the hotel. By selecting language and hotel I need to output the right hotel url based on the language and hotel I choose choose. How can I select the specific url if I have many hotels on that language. My database look like this:

export default {

  data(){
  return{
     Hotel : "",
     Language: "",
     
     
  computed: {
  BadDateToGoodLanguage () {
          var ack =  {
                      "Dansk": {
                            "AHHG":"www.hansen.dk",
                            "PHO": "www.phocopenhagen.dk",
                            "NYH": "www.havnhotel.dk",

                      },
                      "English": {
                            "AHHG" : "www.hansen.com",
                            "PHO": "www.phocopenhagen.com",
                            "NYH": "www.havnhotel.com",

                        },
                 
                    }
          let result = []; 
          var i = 0;

                   for (var a in ack) {
            result[i] = { value : a , Text : a }
            i++;
          }
            
     return result;
},    
BadDateToGoodHotel () {

    if(this.LanguageSet === "")
      return [];


          var ack =  {
                    
                      "Dansk": {
                            "AHHG":"www.hansen.dk",
                            "PHO": "www.phocopenhagen.dk",
                            "NYH": "www.havnhotel.dk",
                          
                      },
                      "English": {
                            "AHHG" : "www.hansen.com",
                            "PHO": "www.phocopenhagen.com",
                            "NYH": "www.havnhotel.com",

                        },
                      
                    }
          let result = []; 
          var i = 0;

          var data =  ack[this.Language];
          for (var a in data) {
            result[i] = { value : data[a] , Text : a }
            i++;
          }
            
     return result;
}
},
  methods: {


    onHotelChange(e){
           this.Hotel = e;
           
      
    },
    onLanguageChange(e){
           this.Language = e;
            },
  
  CreateLink() {
  var baseUrl = "https://"+this.language + "?hotel=" + this.Hotel
  
  this.Link = baseUrl
  
  
  };
},
<base-select :options="BadDateToGoodLanguage" @on-select="onLanguageChange"> </base-select>

 <base-select :options="BadDateToGoodHotel" @on-select="onHotelChange"> </base-select>
 </div>

<base-select :options="BadDateToGoodLanguage" @on-select="onLanguageChange">

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda