false-transform
v1.0.0
Published
## Install ```bash npm install false-transform --save-dev ``` ## Usage ```js import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import falseTransform from 'false-transform' export default defineConfig({ plugins: [ vue({ t
Downloads
5
Readme
false-transform
Install
npm install false-transform --save-devUsage
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import falseTransform from 'false-transform'
export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
nodeTransforms: [falseTransform]
}
}
})
]
})Use attributes without bound values to represent truthy values, like:
<CustomComp visible />The component receives the visible value as true. However, when you need to pass false, you have to explicitly bind it:
<CustomComp :visible="false" />This transformer allows you to use an attribute starting with ! to represent false, like this:
<CustomComp !visible />