Is it possible to change data from outside? #1374
-
I am develop a website which is using Laravel blade engine (SSR) and Alpine to update views. below is the sample of my code: <div x-data="alpineObj">
// here will do foreach loop to render some cards
</div>
<div id="map">
// will dynamic add some element into this element (using Leaflet map plugin)
<div id="marker">will created by JavaScript</div>
</div> const alpineObj = alpine();
function alpine() {
arr: [];
updateArr(newArr) {
this.arr = newArr;
}
} The situation is I was trying to update alpine's binding data via is there have other way to do this or keywords? thanks a lot <3 |
Beta Was this translation helpful? Give feedback.
Answered by
MuzafferDede
Jun 10, 2021
Replies: 1 comment 4 replies
-
you have few issues here,
here is a working codepen |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
DahisC
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you have few issues here,
arr: [];
here is a working codepen