Рубрики
Laravel+Vue3 project Vue.js Vue компоненты

Vue Список записей из БД

Регистрация компонентов Vue

resources\js\app.js
регистрация компонентов Vue в Laravel

require('./bootstrap');
import {createApp} from 'vue';

import App from './components/app.vue';
import RowItem from './components/row/RowItem.vue';
import RowList from './components/row/RowList.vue';

const app=createApp({});
app.component('app',App);

app.component('row-item',RowItem);
app.component('row-list',RowList);

app.mount('#app');

resources\index.blade.php
шаблон главный Laravel

<!DOCTYPE html>
<html lang="eng">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <body>
        <div id="app">
            <app/>
        </div>
        <script src="./js/app.js"></script>
    </body>
</html>

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *