@razors/babel-plugin-vue-next-unwrap-ref

0.0.3 • Public • Published

babel-plugin-vue-next-unwrap-ref

Auto unwrap vue-next's ref variables to ref.value in both SFC and JSX!

Example:

import {ref} from 'vue'
export default () {
  const isShow = ref(false)
  return (
    <div v-show={isShow}></div>
  )
}

You don't need to write isShow.value anymore!

Install

install in npm

npm install @razors/babel-plugin-vue-next-unwrap-ref

or in yarn

yarn add @razors/babel-plugin-vue-next-unwrap-ref

change your babel config

{
    "presets": [
      ["@babel/preset-env"],
    ],
    "plugins": [
      ["@razors/babel-plugin-vue-next-unwrap-ref"]
    ]
}

Tips

  • Ref values which are not in current .vue file will not be transformed.

Readme

Keywords

none

Package Sidebar

Install

npm i @razors/babel-plugin-vue-next-unwrap-ref

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

3.53 kB

Total Files

9

Last publish

Collaborators

  • marsprince