ianrothmann/laravel-vue-bridge 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ianrothmann/laravel-vue-bridge

最新稳定版本:0.6.1

Composer 安装命令:

composer require ianrothmann/laravel-vue-bridge

包简介

A bridge to expose Laravel variables and routes in Vue and Vuex

README 文档

README

A bridge for exposing Laravel variables and routes inside vue components. It supports Vuex. For use with Multi Page Applications using multiple Vue components. The idea is to get the best of both, between what Laravel and Vue offers.

This package should be used with the VueBridge npm package (https://github.com/ianrothmann/VueBridgeJs).

Installation

composer require ianrothmann/laravel-vue-bridge

In config/app.php

Service provider

IanRothmann\LaravelVueBridge\ServiceProviders\VueBridgeServiceProvider::class

Facade

'VueBridge' =>IanRothmann\LaravelVueBridge\Facades\VueBridge::class

In your main blade file, before

<script src="{{ mix('js/app.js') }}"></script> 

you should add

{!! VueBridge::scripts(get_defined_vars()) !!}

Exposing variables

In your controller:

VueBridge::exposeVariables([array of variable names to expose]);

VueBridge::hideVariables([array of variable names to hide, all others will be exposed]);

VueBridge::exposeAllVariables();

VueBridge::hideAllVariables();

Exposing Routes

In web.php or in middleware. Routes are hidden by default:

VueBridge::exposeAllRoutes(); //exposes all named routes

VueBridge::exposeRoutes(([array of route names]);

VueBridge::hideRoutes([array of route names]);

More documentation to follow later

统计信息

  • 总下载量: 5.91k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2017-04-20