0

I am using a fairly recent babel setup with most plugins activated but it still cannot parse this syntax nor I am sure what does this syntax translates too.

Vue.use(ClientTable, [options = {}], [useVuex = false], [theme = 'bootstrap3'], [swappables = {}]);

What does the sequence of assignments inside square brackets - [options = {}], [useVuex = false], [theme = 'bootstrap3'], [swappables = {}] mean?

Source: https://matanya.gitbook.io/vue-tables-2/installation

Cope
  • 1
  • The square brackets mean an optional parameter, while the equals is the default value if it's not passed in. So `[options = {}]` means that you're not required to pass the second parameter `options` also, if you don't pass it, it will default to an empty object `{}`. – VLAZ Jul 20 '20 at 06:56
  • @VLAZ Ah! It is the documentation style but I wonder why the author has included the same in the code sample? It belongs to function signature documentation. It translates to `Vue.use(ClientTable, {}, false, 'bootstrap3', {}); If you post this as an answer, I will accept the same. Thanks! :) – Cope Jul 20 '20 at 07:02

0 Answers0