C
C
Captain Cocoa2021-03-11 10:45:02
Vue.js
Captain Cocoa, 2021-03-11 10:45:02

How to change the value of a variable in vue js depending on the URL?

Hello everyone, can you please tell me how to change the data in a variable depending on the URL?
That is, if the address is: site.com in the {{ price }} variable, output 100
If the address is site.com?promo=50% , output 50 in the variable

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-03-11
@RadCor

https://codesandbox.io/s/qna-q952763-1d7b6

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question