0.1.4 • Published 2 years ago

@ilikerobots/vue-plugin-django-utils v0.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Welcome to @ilikerobots/vue-plugin-django-utils šŸ‘‹

Version License: MIT

Vue plugin and helpers useful for integrating with Django, based on the techbniques described at Django Vue Cookiecutter

šŸ  Homepage

Install

Add as a dependency to your Vue project, e.g.

npm install @ilikerobots/vue-plugin-django-utils

Usage

In your Vue entrypoint(s),

import DjangoUtilsPlugin from '@ilikerobots/vue-plugin-django-utils'
import {convertDatasetToProps} from '@ilikerobots/vue-plugin-django-utils'

const rootEl = document.getElementById('my-root')
if (rootEl) {
    // Create app, passing the root element dataset as rootProp values
    const app = createApp(MyRootComponent, convertDatasetToProps({
        dataset: {...rootEl.dataset},
        component: MyRootComponent
    }))
  
    // Use additional plugin capabilities, including
    // 1) Django CSRF token provided as as 'csrfToken'
    // 2) Provide any key-value pairs in window.vueProvided
    // 3) Attached outerHTML of child elements w/ attribute data-django-slot=slotName in globalProperties.$djangoSlots
    app.use(DjangoUtilsPlugin, {rootElement: rootEl})
    app.mount(statusEl)
}

Author

šŸ‘¤ Mike Hoolehan

Show your support

Give a ā­ļø if this project helped you!


This README was generated with ā¤ļø by readme-md-generator

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago