@razors/babel-plugin-vue-next-unwrap-ref
v0.0.3
Published
Auto unwrap vue-next's ref variables to ref.value in both SFC and JSX!
Downloads
1
Readme
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.