Page content is duplicated when opened
Swimer-MC opened this issue · comments
Alexander commented
I am using Codeigniter 4 templates and I am confident that they will work correctly.
demo.mp4
Here's my code:
home.php
<?= $this->extend('templates/base') ?>
<?= $this->section('content') ?>
<a href="/search">go to search</a>
<?= $this->endSection() ?>
search.php
<?= $this->extend('templates/base') ?>
<?= $this->section('content') ?>
<a href="/">go to home</a>
<?= $this->endSection() ?>
templates/base.php
<body>
...
<div data-barba="wrapper">
<main data-barba="container">
<?php $this->renderSection('content') ?>
</main>
</div>
...
<script src="/js/barba.min.js"></script>
<script>
barba.init({});
</script>
Alexander commented
The solution was to move barba.js initialization after vue.js initialization