Vue Directive
The WireBootstrap Vue Directive allows any WireBootstrap component to be used inside the Vue.js framework.
Registering the Directive
To start using the directive, import WireConfigDirective
from WireConfigDirective.js
and register the directive with the Vue.js application.
Using the Directive
Outside of the Vue.js framework, WireBootstrap components are bound to HTML elements using the render
method on a new instance of the component class. The example below renders a Bootstrap Table component using the table1
HTML element.
In Vue.js, the same component can be registered using the WireBootstrap Vue Directive.
The directive properties are detailed below.
wire-component
The wire-component
HTML element attribute is used to tell the WireBootstrap Vue Directive which WireBootstrap component to render. Set this attribute to the fully qualified object name of the WireBootstrap component.
In the example below, the Bootstrap Table component is located off the global wire
object in a class called bsTable
. See the documentation for details.
v-wire-config
The v-wire-config
attribute references the custom Vue.js directive registered above. This attribute should be set to the name of the data()
object property containing the WireBootstrap component's configuration object in the <scripts>
section of the .vue file for the parent component.
For additional examples, visit the Sample Project.
Last updated