src/View.php
public function vue($component, $initData = [], $componentDefinition = null, $selector = null)
    {
        if (!$selector) {
            $selector = '#'.$this->name;
        }

        if ($componentDefinition) {
            $chain = (new jsVueService())->createVue($selector, $component, $componentDefinition, $initData);
        } else {
            $chain = (new jsVueService())->createAtkVue($selector, $component, $initData);
        }

        $this->_js_actions[true][] = $chain;

        return $this;
    }
public function vue($component, $initData = [], $componentDefinition = null, $selector = null)
    {
        if (!$selector) {
            $selector = '#'.$this->name;
        }

        if ($componentDefinition) {
            $chain = (new jsVueService())->createVue($selector, $component, $componentDefinition, $initData);
        } else {
            $chain = (new jsVueService())->createAtkVue($selector, $component, $initData);
        }

        $this->_js_actions[true][] = $chain;

        return $this;
    }
public function vue ( $ component , $ initData = [ ] , $ componentDefinition = null , $ selector = null ) { if ( ! $ selector ) { $ selector = '#' . $ this -> name ; } if ( $ componentDefinition ) { $ chain = ( new jsVueService ( ) ) -> createVue ( $ selector , $ component , $ componentDefinition , $ initData ) ; } else { $ chain = ( new jsVueService ( ) ) -> createAtkVue ( $ selector , $ component , $ initData ) ; } $ this -> _js_actions [ true ] [ ] = $ chain ; return $ this ; }
Create Vue.js instance.
Vue.js instance can be create from atk4\ui\View.

Component managed and defined by atk does not need componentDefinition variable name
because these are already loaded within the atk js namespace.
When creating your own component externally, you must supply the variable name holding
your Vue component definition. This definition must be also accessible within the window javascript
object. This way, you do not need to load Vue js file since it has already being include within
atkjs-ui.js build.

If the external component use other components, it is possible to register them using
vueService getVue() method. This method return the current Vue object.
ex: atk.vueService.getVue().component('external_component', externalComponent). This is the same
as Vue.component() method.


@param string      $component           The component name;
@param array       $initData            The component properties passed as the initData prop.
This is the initial data pass to your main component via the initData bind property
of the vue component instance created via the vueService.
@param null|string $componentDefinition The name of the js var holding a component definition object.
This var must be defined and accessible in window object. window['var_name']
@param null        $selector            The selector for creating the base root object in Vue.

@return $this
Create Vue . js instance . Vue . js instance can be create from atk4 \ ui \ View .