unplugin-v-bind
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

unplugin-v-bind

It is more convenient to use v-bind in vue

e.g.

// use can direct use v-bind(move) with calculate
// you don't need to wrapper with calc()
// because the plugin will auto wrapper it with calc()
<style scoped>
.move{
  transform:translateX(v-bind(move)px);
  width: v-bind(move) * 10px;
}
</style>

<style scoped>
.move{
  transform:translateX(calc(v-bind(move) * 1px));
  width: calc(v-bind(move) * 10px);
}
</style>

🌈 Usage

Vite
// vite.config.ts
import { vitePlugin } from 'unplugin-v-bind'
export default defineConfig({
  plugins: [vitePlugin(/* options */)],
})

Rollup
// rollup.config.js
import { resolve } from 'path'
import { rollupPlugin } from 'unplugin-v-bind'
export default {
  plugins: [rollupPlugin(/* options */)],
}

Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-v-bind').webpackPlugin({
      /* options */
    }),
  ],
}

Vue CLI
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-v-bind').webpackPlugin({
        /* options */
      }),
    ],
  },
}

Esbuild
// esbuild.config.js
import { build } from 'esbuild'
import { esbuildPlugin } from 'unplugin-v-bind'

build({
  plugins: [esbuildPlugin(/* options */)],
})

License

MIT License © 2022 Simon He

Buy Me A Coffee

sponsors

Package Sidebar

Install

npm i unplugin-v-bind

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

381 kB

Total Files

6

Last publish

Collaborators

  • simon_he