Justiofed 0 Posted February 26 Share Posted February 26 (edited) Hello, can u tell me plz, how to use vue.js with rage, I wanna display players online count in the <div>CurentOnline: {{playersOnline}}</div> And this works, however, with each update in the rage-called function "function rageUpdateValue (value) {vue .value = value}", the data overlaids instead of being updated, how can I fix it , in google chrome there ain't any problems with this ... Edited February 26 by Justiofed Link to post Share on other sites
brosiden 7 Posted February 26 Share Posted February 26 Check this gamemode, it has the UI written in vue. Link to post Share on other sites
MrPancakers 153 Posted February 26 Share Posted February 26 (edited) 11 hours ago, Justiofed said: Hello, can u tell me plz, how to use vue.js with rage, I wanna display players online count in the <div>CurentOnline: {{playersOnline}}</div> And this works, however, with each update in the rage-called function "function rageUpdateValue (value) {vue .value = value}", the data overlaids instead of being updated, how can I fix it , in google chrome there ain't any problems with this ... When you say "data overlaids instead of being updated" do you mean your number changes from "1" to "12" and then "123" ? That means you're adding strings together and not updating numbers, you should parseInt(value) to turn a string into a number. This is normal JavaScript stuff and nothing to do with how RAGE:MP/CEF handle data. Edited February 26 by MrPancakers Link to post Share on other sites
Justiofed 0 Posted February 27 Author Share Posted February 27 No, I mean that the line "Online: 0" in <div> Online: {{count}} </ div> just doubles after changing the value That is, if you declare data: {count: 0}, then using the "function updateCount (count) {vue.count = count;}" where updateCount called by` Player.TriggerEvent("updateCount", (NAPI.Pools.GetAllPlayers().Count).ToString());` function to update the value, then Online: 0 will be displayed simultaneously (as like at the back) and, for example, Online: 1 in front. And idk why but if I call a function like setTimeout(function () { vue.count = 123321 }, 10000); then the data is simply updated without any problems and the adjustment will not come. So if the root of the function call is Player.TriggerEvent, then vue.js creates adjustments... no problem without it... Link to post Share on other sites
Justiofed 0 Posted February 28 Author Share Posted February 28 This helped me a lot, it turned out that I had two open menus at the same time. https://rage-script.ru/threads/cef-otladka-koda-v-dev-tools.108/ Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now