79481481

Date: 2025-03-03 16:10:18
Score: 1
Natty:
Report link

if in my html i have something like this (a blade.php in my case):

<body>
    <div id="app" data-example="{{ $data }}"></div>
</body>

I can access those data like this in my vue components:

const appElement = document.getElementById('app');
const example = JSON.parse(appElement.dataset.example);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Raffaele Bertani