Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/simon-he95/unplugin-v-bind

convenient to use v-bind in vue
https://github.com/simon-he95/unplugin-v-bind

css vue3

Last synced: 4 months ago
JSON representation

convenient to use v-bind in vue

Awesome Lists containing this project

README

        





It is more convenient to use v-bind in vue

## e.g.
```vue
// 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()

.move{
transform:translateX(v-bind(move)px);
width: v-bind(move) * 10px;
}

.move{
transform:translateX(calc(v-bind(move) * 1px));
width: calc(v-bind(move) * 10px);
}

```

## 🌈 Usage

Vite

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


Rollup

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


Webpack

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


Vue CLI

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


Esbuild

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

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

## License
[MIT](./LICENSE) License © 2022 [Simon He](https://github.com/Simon-He95)

Buy Me A Coffee

![sponsors](https://www.hejian.club/images/sponsors.jpg)