Jump to content
RAGE Multiplayer Community

Can i use vue.js with rageMP


Justiofed
 Share

Recommended Posts

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 by Justiofed
Link to comment
Share on other sites

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 by MrPancakers
Link to comment
Share on other sites

spacer.pngNo, 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 comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...