LoginSignup
0
0

More than 3 years have passed since last update.

新しいコードの記述で感じたこと

Posted at

Vuejsを初めて、コードの記述が変わり

省略した記述にも慣れてきました。

jqueryにも出てくるthisの使い方


methodsで指定した関数を引数で返す。
基礎さえあれば、慣れそうです。
sampleCode({
    el: '#app',
    data: {
      message:'Hello world'
    },
    methods:{
    sayWords: function(){
        this.message = 'Hi'
        return 'Hey'
       }
     }
  })

タグ内のidに、v-on・v-bindを使う

Html・CSSで、複雑だったコードがすっきりしました。

該当するソースコード

<div id="sampleCode">
    <div v-html="html"></div>
    <a:[attribute]="url">調べる</a>
    <br>
    <a v-bind="snsObject">Twitter</a>
 </div>

JavaScriptの処理方法

url:'https://www.google.co.jp/',
        attribute:'href',
        snsObject:{
            href:'https://twitter.com'

Vuejsのフレームワークを使って、コードを書くのが簡単になりました。

jqueryを使ったコーディング学習はあまりなく、基本的なJavaScriptでした。
より直感的に書けるフレームワークを学習の中心するといいでしょう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0