Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

231
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!