src/Vue.php
protected function initComputed()
    {
        if (empty($this->computed)) {
            return;
        }

        if (!is_array($this->computed)) {
            throw new InvalidConfigException('The "computed" option are not an array');
        }

        foreach ($this->computed as $key => $callback) {
            if (is_array($callback)) {
                if (isset($callback['get'])) {
                    $function = $callback['get'] instanceof JsExpression ? $callback['get'] : new JsExpression($callback['get']);
                    $this->clientOptions['computed'][$key]['get'] = $function;
                }
                if (isset($callback['set'])) {
                    $function = $callback['set'] instanceof JsExpression ? $callback['set'] : new JsExpression($callback['set']);
                    $this->clientOptions['computed'][$key]['set'] = $function;
                }
            } else {
                $function = $callback instanceof JsExpression ? $callback : new JsExpression($callback);
                $this->clientOptions['computed'][$key] = $function;
            }
        }
    }
protected function initComputed()
    {
        if (empty($this->computed)) {
            return;
        }

        if (!is_array($this->computed)) {
            throw new InvalidConfigException('The "computed" option are not an array');
        }

        foreach ($this->computed as $key => $callback) {
            if (is_array($callback)) {
                if (isset($callback['get'])) {
                    $function = $callback['get'] instanceof JsExpression ? $callback['get'] : new JsExpression($callback['get']);
                    $this->clientOptions['computed'][$key]['get'] = $function;
                }
                if (isset($callback['set'])) {
                    $function = $callback['set'] instanceof JsExpression ? $callback['set'] : new JsExpression($callback['set']);
                    $this->clientOptions['computed'][$key]['set'] = $function;
                }
            } else {
                $function = $callback instanceof JsExpression ? $callback : new JsExpression($callback);
                $this->clientOptions['computed'][$key] = $function;
            }
        }
    }
protected function initComputed ( ) { if ( empty ( $ this -> computed ) ) { return ; } if ( ! is_array ( $ this -> computed ) ) { throw new InvalidConfigException ( 'The "computed" option are not an array' ) ; } foreach ( $ this -> computed as $ key => $ callback ) { if ( is_array ( $ callback ) ) { if ( isset ( $ callback [ 'get' ] ) ) { $ function = $ callback [ 'get' ] instanceof JsExpression ? $ callback [ 'get' ] : new JsExpression ( $ callback [ 'get' ] ) ; $ this -> clientOptions [ 'computed' ] [ $ key ] [ 'get' ] = $ function ; } if ( isset ( $ callback [ 'set' ] ) ) { $ function = $ callback [ 'set' ] instanceof JsExpression ? $ callback [ 'set' ] : new JsExpression ( $ callback [ 'set' ] ) ; $ this -> clientOptions [ 'computed' ] [ $ key ] [ 'set' ] = $ function ; } } else { $ function = $ callback instanceof JsExpression ? $ callback : new JsExpression ( $ callback ) ; $ this -> clientOptions [ 'computed' ] [ $ key ] = $ function ; } } }
Initializes computed to be mixed into the Vue instance.

@throws InvalidConfigException
Initializes computed to be mixed into the Vue instance .