@b10cks/vue
v1.0.0
Published
SDK to integrate b10cks into your vue applications
Readme
@b10cks/vue
Vue 3 SDK for integrating b10cks into Vue applications.
Installation
npm install @b10cks/vue @b10cks/clientUsage
Plugin Setup
import { createApp } from 'vue'
import { B10cksVue } from '@b10cks/vue'
import App from './App.vue'
const app = createApp(App)
app.use(B10cksVue, {
apiClientOptions: {
token: 'your-access-token',
baseUrl: 'https://api.b10cks.com/api',
},
})
app.mount('#app')Data Composables
import { useB10cksApi } from '@b10cks/vue'
const { useContent, useBlocks } = useB10cksApi()
const content = useContent('home', {}, { immediate: true })
const blocks = useBlocks({}, { immediate: true })Directives
v-editablemarks a block as selectable inside the b10cks preview editor.v-editable-fieldmarks a field as inline-editable in preview mode.
Components
Use B10cksComponent to render block-specific Vue components dynamically:
<B10cksComponent :block="block" v-editable="block" />License
MIT
