npm i tweakpane v-tweakpane @tweakpane/plugin-essentials
# install dependencies
$ npm install
# package lib
$ npm run build
Global component:
// main.ts
import { VTweakpane } from 'v-tweakpane';
import { createApp } from 'vue';
const app = createApp({});
app.component('VTweakpane', VTweakpane);
Or use locally
// component.vue
<script lang="ts">
import { defineComponent } from 'vue';
import { VTweakpane } from 'v-tweakpane';
export default defineComponent({
components: {
VTweakpane,
},
});
</script>
For Nuxt 3, create a file in plugins/v-tweakpane.ts
import { VTweakpane } from 'v-tweakpane';
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.component('VTweakpane', VTweakpane);
});
then import the file in nuxt.config.{j|t}s
:
export default {
// ...
plugins: [
// ...
{ src: '~/plugins/v-tweakpane', mode: 'client' },
// ...
],
// ...
};
<template>
<v-tweakpane :pane="state.pane" />
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue';
import { VTweakpane } from 'v-tweakpane';
export default defineComponent({
name: 'App',
components: { VTweakpane },
setup() {
const state = ref({
pane: {
title: 'My Awesome Pane',
inputs: [
{
factor: 123,
title: 'hello',
color: '#0f0',
},
],
},
});
return { state };
},
});
</script>
<style>
@import 'v-tweakpane/dist/v-tweakpane.css';
</style>
git checkout -b feat/new-feature
)git commit -Sam 'feat: add feature'
)git push origin feat/new-feature
)Note:
v-image © Vinayak, Released under the MIT License.
Authored and maintained by Vinayak Kulkarni with help from contributors (list).
vinayakkulkarni.dev · GitHub @vinayakkulkarni · Twitter @_vinayak_k