T
T
tyoma_koder2021-05-01 12:41:19
Java
tyoma_koder, 2021-05-01 12:41:19

Why is vue.js not working?

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="https://unpkg.com/[email protected]/dist/vue.global.js"></script>
</head>
<body>
  <div id="vif">
    <button v-on:click="toggleShow">показать h1</button>
    <h1 v-if="show">{{show}}</h1>
  </div>
</body>

const vif = Vue.createApp({
  data() {
    return {
      show: false
    }
  },
  methods:{
    toggleShow(){
      this.show = this.show ? false : true;
    }
  }
})
vif.mount("#vif");

in h1 {{show}} is displayed instead of the value of the variable and the code on the button no event is hung

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Iloveski, 2018-09-22
@DreAdeR

You start with SE. This is essentially what all development in java is based on. EE is a set of specifications for developing server applications. It is used far from everywhere, there are many where there are se + frameworks. ME is now essentially dead. You can take any version of the language starting from 8 or higher. Suitable for learning the basics, but the difference will not become clear immediately. Of course, you need to read books, but the emphasis is still on practice-practice-practice.

S
Sergey Gornostaev, 2018-09-22
@sergey-gornostaev

If you were to search on Toaster by typing your question title into it, you would see several hundred results. Most of them recommend the same textbooks . The tutorial will give you the right knowledge in the right order.
These are not specifications, but versions. The difference between versions usually fits in one page of text. Knowledge of Java 1.2 is still applicable.

V
Vladislav, 2018-09-22
@Div100

It's easier to learn by doing. And faster too. Doing a project, asking questions, finding answers - studied. You go further, and so slowly the project is being done and something is being studied.
And if you study each technology, function, library, etc., in isolation from each other. Then there will be a problem to learn how to use it and so on.
If you have any questions - write!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question