nickmessing / babel-plugin-jsx-v-model

JSX Syntactic Sugar Plugin for v-model
MIT License
155 stars 12 forks source link

maybe do not use $set to set property #14

Open Kingwl opened 6 years ago

Kingwl commented 6 years ago

https://github.com/nickmessing/babel-plugin-jsx-v-model/blob/master/index.js#L29

it will broken if the render function is not included in Vue Declaration (common render)
consider to use element access expression

givingwu commented 5 years ago

@Kingwl , Did you mean this error? I met it too.

image

@nickmessing Those are my code:

.babelrc:

module.exports = {
  // presets: ["@vue/app"], // i use vue-cli3, it does not need this preset

  // https://github.com/nickmessing/babel-plugin-jsx-v-model
  plugins: ["jsx-v-model"]
};

jsx:

<div class="table-edit-cell__input">
    <input v-model={row[column.prop]} /* {...{ directives }} */ />
</div>