加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

php – Vue组件在laravel 5.3中没有显示护照

发布时间:2020-12-14 19:37:35 所属栏目:大数据 来源:网络整理
导读:您好我正在使用以下链接在laravel 5.3中尝试护照 https://laravel.com/docs/5.3/passport 在app.js /** * First we will load all of this project's JavaScript dependencies which * include Vue and Vue Resource. This gives a great starting point for
您好我正在使用以下链接在laravel 5.3中尝试护照
https://laravel.com/docs/5.3/passport

在app.js

/**
 * First we will load all of this project's JavaScript dependencies which
 * include Vue and Vue Resource. This gives a great starting point for
 * building robust,powerful web applications using Vue and Laravel.
 */

require('./bootstrap');

/**
 * Next,we will create a fresh Vue application instance and attach it to
 * the body of the page. From here,you may begin adding components to
 * the application,or feel free to tweak this setup for your needs.
 */

Vue.component('example',require('./components/Example.vue'));

Vue.component(
    'passport-clients',require('./components/passport/Clients.vue')
);

Vue.component(
    'passport-authorized-clients',require('./components/passport/AuthorizedClients.vue')
);

Vue.component(
    'passport-personal-access-tokens',require('./components/passport/PersonalAccessTokens.vue')
);


const app = new Vue({
    el: 'body'
});

在我的视图文件中

@extends('layouts.app')

@section('content')

<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <passport-clients></passport-clients>
            <passport-authorized-clients></passport-authorized-clients>
            <passport-personal-access-tokens></passport-personal-access-tokens>
        </div>
    </div>
</div>
@endsection

我已经厌倦了将节点更新到6.4.0也在6.7.0,但注意到我工作
也改变了gulp文件

const elixir = require('laravel-elixir');

require('laravel-elixir-vue');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean,fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default,we are compiling the Sass
 | file for our application,as well as publishing vendor resources.
 |
 */
elixir(function (mix){
    mix.sass('app.scss')
       .webpack('app.js');
});

但是我的视图中的模板没有显示,即使在源代码中也注明了包含的内容

解决方法

确保在layouts.app中包含js文件

@yield('content')
</div>

<!-- Scripts -->
**<script src="/js/app.js"></script>**
</body>
</html>

并在您的app.js中将body更改为#app

const app = new Vue({
  el: '#app'
});

我遇到了同样的问题,这对我有用.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读