0

I would like to get the GET param's value and trigger an event. How to trigger an event inside the Created method?

I tried this way, but click method is not found:

created(){
    if(this.$route.query.text!=''){
        this.textToTranslate = this.$route.query.text;
        const elem = this.$refs.languageSelect;
        elem.change();
    }
  },
Sarvar Nishonboyev
  • 12,262
  • 10
  • 69
  • 70

1 Answers1

2

Use mounted since you're interacting with DOM elements, those elements won't be available inside the created lifecycle hook. For more information: another question.

enbermudas
  • 1,603
  • 4
  • 20
  • 42