A
A
alaskafx2021-04-15 21:57:41
Vue.js
alaskafx, 2021-04-15 21:57:41

Why don't these methods work?

You know... You know... I tried not to write on Habr for 3 hours, 3 hours, Carl, 3 hours, I tried to solve this problem.
I am more than sure that there is a smart person who needs endless "thank you" who will solve this problem.
Means so: there are two methods, one with parameters, another is not present.
I'm trying to start them by clicking on, with the code:

<div @click="whyn; goToInstallation();"> 
        <a
          to="/FirstSteps"
          class="link fir"
          id="mainh"
          v-bind:class="{ txtactiv: isActive }"
          >Перлинг</a
        ></div>


Well, by the methods themselves:
goToInstallation() {
      this.currentLink = "installation";
      console.log('это Go')
    },
 whyn: function (e) {
      console.log("это whyn")
      console.log(e.target.textContent);
      let pd = document.querySelectorAll("#mainh");
      pd.forEach(function (pd) {
        pd.classList.remove("sos");
      });
      e.target.classList.add("sos");
    },


So, I've tried parentheses in @click='whyn (), goToInsta...', and even without.
But with brackets, it gives an error that it cannot read the parameters from whyn, and it covers the entire console with errors for me.

How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri, 2021-04-15
@cheeroque

@click="whyn($event); goToInstallation();"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question