Size: a a a

Vue.js Russian Developers Community

2020 June 09

BS

Bogdan Saliuk in Vue.js Russian Developers Community
Victor Tyunyakov
Там же и так всë в цсс
не припомню, чтобы был вариант делать колласп видимым в зависимости от ширины через классы, пропсы
источник

VT

Victor Tyunyakov in Vue.js Russian Developers Community
Рома
не, ширина так просто обновляться не захотела, и visible не обновлялся
А media-query?
источник

Р

Рома in Vue.js Russian Developers Community
matchMedia? его и пробовал
источник

SM

Saufullah Mojadadi in Vue.js Russian Developers Community
Hello members,
I am sending post request to localhost/wampserver with axios  but when I print $_POST variable in api page it returns an empty array. My vue project  and localhost server are in different domains although I enabled the CORS but still I have the problem. Any body knows where is the problem? I am sharing the screenshots with you.
источник

SM

Saufullah Mojadadi in Vue.js Russian Developers Community
источник

SM

Saufullah Mojadadi in Vue.js Russian Developers Community
источник

SM

Saufullah Mojadadi in Vue.js Russian Developers Community
источник

А

Алексей in Vue.js Russian Developers Community
Saufullah Mojadadi
Hello members,
I am sending post request to localhost/wampserver with axios  but when I print $_POST variable in api page it returns an empty array. My vue project  and localhost server are in different domains although I enabled the CORS but still I have the problem. Any body knows where is the problem? I am sharing the screenshots with you.
Hello.
From what url of front you sent request?
источник

А

Алексей in Vue.js Russian Developers Community
Sorry, i see thar different)
источник

SM

Saufullah Mojadadi in Vue.js Russian Developers Community
Алексей
Hello.
From what url of front you sent request?
there is  contact form in my vue project which is not  located in wampserver  I am using vue/cli
источник

А

Алексей in Vue.js Russian Developers Community
crossDomain: true
In axios config
источник

S

Sergey in Vue.js Russian Developers Community
look at the Network tab (chrome dev tools), what is sent to the server and what the server responds
источник

SM

Saufullah Mojadadi in Vue.js Russian Developers Community
Sergey
look at the Network tab (chrome dev tools), what is sent to the server and what the server responds
источник

SM

Saufullah Mojadadi in Vue.js Russian Developers Community
Request is successfully sent if I print_($_SERVER['REQUEST_METHOD'])   it prints POST
источник

SM

Saufullah Mojadadi in Vue.js Russian Developers Community
but variable $_POST  is not created
источник

SM

Saufullah Mojadadi in Vue.js Russian Developers Community
no data is sent
источник

S

Sergey in Vue.js Russian Developers Community
Saufullah Mojadadi
no data is sent
axios sends json. you need to add this header to axios request:
{headers: {'Content-Type': 'application/x-www-form-urlencoded'}}
источник

SM

Saufullah Mojadadi in Vue.js Russian Developers Community
Алексей
crossDomain: true
In axios config
cross domain is enabled in chrome as well as in my appache server
источник

S

Sergey in Vue.js Russian Developers Community
Sergey
axios sends json. you need to add this header to axios request:
{headers: {'Content-Type': 'application/x-www-form-urlencoded'}}
or decode json in backend: $_POST = json_decode(file_get_contents('php://input'), true);
источник

А

Алексей in Vue.js Russian Developers Community
Set headers. You sent json as plaintext
источник