DEV Community

Discussion on: Why you should be using Vue's new Composition API

Collapse
 
artydev profile image
artydev

Hy,
For simple apps why bother with frameworks ?
Loot at this simple counter

<html lang="de">
  <head>
  <meta charset="utf-8">
    <title>title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://efpage.de/DML/DML_homepage/lib/DML-min.js"></script>
    <style>
      button {
        background: lightgreen;
        padding: 10px;
        margin: 5px;

      }
    </style>
  </head>
  <body> 
  <script> 

    function Counter () {
        button("inc").onclick = () =>value.innerText = Number(value.innerText)+1
        let value = idiv("0", "font-weight:bold");
        button("dec").onclick = () => value.innerText = Number(value.innerText)-1
    }

    Counter();
    br()
    Counter();

  </script>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

You can test it here :

Counter

Collapse
 
arashm profile image
Arash Mousavi

Dude, the point of this post is about VueJS framework, not writing a counter.

Collapse
 
artydev profile image
artydev

I agree with you :-)