【发布时间】:2017-01-19 18:34:34
【问题描述】:
我的看法是这样的:
@extends('layouts.main')
@section('title', 'Bank | Myapp')
@section('content')
@if (Auth::user())
...
<li>
<a href="javascript:;" @click="modalShow('modal-delete-account',{{ $account['id'] }})">
<span class="glyphicon glyphicon-trash"></span> Hapus
</a>
</li>
...
@endif
@endsection
@section('modal')
@include('components.modal.profile.setting.account')
<delete-account-modal id="modal-delete-account" :id-account="idModal"></delete-account-modal>
@endsection
执行时,控制台出现如下错误:
[Vue warn]: Unknown custom element: <delete-account-modal> - did you register the component correctly? For recursive components, make sure to provide the "name" option. (found in root instance)
我该如何解决这个错误?
【问题讨论】:
-
Vue 正在寻找一个名为
delete-account-modal的组件,那么你注册了delete-account-modal组件了吗? -
@craig_h, 如何注册?这是我第一次使用 vue.js
-
这取决于,您是否使用
elixir编译所有内容并创建.vue文件? -
@craig_h,是的,我在 resources\assets\js\app.js 上注册了。我在 resources\assets\js\components\bootstrap 和 resources\assets\js\api 上添加了模式。但它不起作用
-
您可能需要向我们展示您的 app.js
标签: php laravel vue.js laravel-5.3 vuejs2