Vuejs.org: Why official doc doesn't use method shorthands?

Created on 12 Mar 2020  路  1Comment  路  Source: vuejs/vuejs.org

The doc says:

computed: {
    // a computed getter
    reversedMessage: function () {
      // `this` points to the vm instance
      return this.message.split('').reverse().join('')
    }
  }

not

computed: {
    // a computed getter
    reversedMessage() {
      // `this` points to the vm instance
      return this.message.split('').reverse().join('')
    }
  }

I'm just curious and totally okay not using it but Isn't it just the same? And it's 2020 and pretty safe using ES2015. What's the reason behind this?

Most helpful comment

That's because Vue 2.x supports IE 11 and we want our examples in the doc to be working as-is everywhere.

>All comments

That's because Vue 2.x supports IE 11 and we want our examples in the doc to be working as-is everywhere.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dwiyatci picture dwiyatci  路  5Comments

alexsasharegan picture alexsasharegan  路  3Comments

kciter picture kciter  路  5Comments

ankitsinghaniyaz picture ankitsinghaniyaz  路  4Comments

sherzinger picture sherzinger  路  3Comments