如何解决错误:[Vue警告]:未知的自定义元素:<delete-account-modal>?

时间:2017-01-19 18:34:35

标签: php laravel vue.js laravel-5.3 vuejs2

我的观点是这样的:

noButton.setOnAction(event -> {


    Done=false; //boolean to close and open the frame

    classStage.hide();
    PauseTransition oneHourPause = new PauseTransition(Duration.hours(1));
    oneHourPause.setOnFinished(e -> classStage.show());
    oneHourPause.play();
}); 

执行时,控制台上存在错误,如下所示:

@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>&nbsp;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

我该如何解决错误?

1 个答案:

答案 0 :(得分:1)

答案完全取决于您编写组件的方式。因为Laravel鼓励使用single file components我会假设delete-account-model位于delete-account-model.vue中名为resources/assets/js/components的文件中,我还假设elixir.vue设置为正确编译resources/assets/js/app.js个文件

因此,为了全局注册组件,您只需将以下内容添加到Vue.component('delete-account-modal', require('./components/delete-account-model.vue'));

gulp

然后运行delete-account-modal重新编译所有内容。然后,您应该发现void _init(void) {return;} int main(void) { /* STM32F2xx HAL library initialization: - Configure the Flash prefetch, instruction and Data caches - Configure the Systick to generate an interrupt each 1 msec - Set NVIC Group Priority to 4 - Global MSP (MCU Support Package) initialization */ HAL_Init(); /* Configure the system clock to 64 MHz */ SystemClock_Config(); /* Enable CRC clock */ __CRC_CLK_ENABLE(); Example_Status = 1; Example_Status = 2; Example_Status = 3; ..... 组件可用。