Help us understand the problem. What is going on with this article?

jQueryとVueでの書き方

Jqueryの場合だとHTMLを書き換える部分は
何行も記載しなければならないので結構大変
vueの方が直感的でわかりやすい

<!DOCTYPE html>
<html lang="en">
<head>

    <script src="main.js"></script>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>VUETtest</title>


</head>

<body>
    <div id="container">
    <h1>TEST</h1>


    //vue.での記載方法
    <ul>
      <li v-for="qq in w">{{ qq }}</li>
    </ul>
    </div>


    <script src="jquery-3.5.0.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

    <script>

      //Vue.jsでの記載方法
      var app = new Vue({
        el: '#container',
        data: {
          w: ['月','火','水','木','金','日']
        }
      })      

      //jqでの記載方法
      // var w=['月','火','水','木','金','日'];
      // $('#container').append('<ul>');
      //   for(var i=0;i<w.length;i++)
      //   {
      //     $('#container ul').append('<li>'+w[i]+'</li>');
      //   }


      // var img=$('<img>');
      // img.attr('src','https://blog-imgs-114.fc2.com/r/e/l/religionofrabia/gollira.jpg')
      //     .attr('alt','写真')
      //     .appendTo("#container");

      //   $('#container').append(img)
    </script>

</body>
</html>
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした