Closed ascott18 closed 2 years ago
It is a bug. Thanks for feedback.
I may look into it later. Sorry for the inconvenience.
Welcome for pull request!😊
Seems to be related to the core logic:
We need take v-for
into consideration.
Bug is not only with indexer, also getting this problem with function params in nested scoped slots:
<app-table>
<template #cell="{ column, row, cell }">
<span @click="myMethod(row.id)">here is ok</span>
<dropdown-menu>
<template #item="{ item }">
<span>{{ row.id }} - here is ok</span>
<span @click="myMethod(row.id)">here is NOT ok, _vm. prepended</span>
</template>
</dropdown-menu>
</template>
</app-table>
@ascott18 @FedorIF
Sorry to have kept you waiting.
We just publish new version 1.0.5
, it will fix your issue.
You can try it by:
npm install vue-template-babel-compiler@1.0.5 -D
// or yarn
yarn add vue-template-babel-compiler@1.0.5 -D
v-for && <checkbox v-model>
nested scoped slot
When using an element of iteration within the loop as an indexer, the iteration variable gets incorrectly generated as an access off of
_vm
.In the example below, the particular issue is all occurrences of
_vm.actionKey
, which should just beactionKey
.$$i
and$$a
also get incorrectly transformed into accesses off of_vm
.Current behavior
With vue-template-babel-compiler 1.0.4:
Expected behavior
With vue-template-compiler 2.6.11:
Diff between the two:
Usage
Extra