Sales1 min read159 words

ما هو Axios وكيف يتم استخدامه في Vue.Js

Emir Eskici

PlusClouds Author

Cloud & SaaS

استخدام Axios مع Vue.js
Size

ما هو أكسيوس؟
هو مكتبة جافا سكريبت تسهل علينا إجراء عمليات HTTP في تطبيقات الواجهة الأمامية بشكل بسيط.
تثبيت أكسيوس
يمكننا تثبيته باستخدام npm أو yarn أو CDN.
تثبيت باستخدام npm

$ npm install axios

تثبيت باستخدام yarn

$ yarn add axios

تثبيت باستخدام CDN

مثال صغير باستخدام دالة Axios.get()
دعنا نقوم بعمل مثال صغير على API باستخدام دالة get() الخاصة بأكسيوس


import axios from 'axios' // نقوم باستيراد axios لاستخدامها بعد تحميلها
export default {
data(){
    return{
        users:null, // أنشأت متغير فارغ باسم users 
    }},
  methods:{
    function (){
    axios.get('https://jsonplaceholder.typicode.com/users').then((response) => { 
    // قمنا بسحب API واستخدمنا دالة then() للعمليات اللاحقة
     this.users = response.data; // وصلنا إلى كائن البيانات داخل الاستجابة التي تم إرجاعها وعيناه في المتغير المسمى users
     console.log(this.users); // والآن قمنا بكتابة النتائج المReturned في وحدة التحكم
     })
  }
}
}

مخرجات وحدة التحكم
drawing

دعنا نرى نتيجة المثال بشكل مرئي
دعنا نستخدم Bootstrap لإنشاء جدول صغير ونضع البيانات القادمة من API في هذا الجدول

وها هي النتيجة…

result

LeadOcean

Sales team chasing the wrong leads?

1.8B+ companies — search always free

Find My Leads →

No credit card · Cancel anytime

Frequently Asked Questions

ما هو أكسيوس ولماذا يُستخدم في تطبيقات الواجهة الأمامية؟

أكسيوس هي مكتبة جافا سكريبت تسهل علينا إجراء عمليات HTTP في تطبيقات الواجهة الأمامية بشكل بسيط. تُستخدم لإرسال طلبات مثل GET و POST وتلقي الاستجابات من الخادم بطريقة مبسطة.

كيف يمكن تثبيت axios باستخدام npm أو yarn أو CDN؟

يمكن تثبيت axios باستخدام npm أو yarn أو CDN كما ورد. مثال التثبيت باستخدام npm هو npm install axios، وباستخدام yarn هو yarn add axios، كما يمكن تثبيته عبر CDN.

كيف أستخدم axios.get لجلب بيانات من API كما في المثال مع jsonplaceholder؟

يمكن استخدامها لعمل طلب GET إلى API كما في المثال: axios.get('https://jsonplaceholder.typicode.com/users').then((response)=>{ this.users = response.data; console.log(this.users); }). داخل مكون Vue حيث تكون بيانات المستخدمين متوفرة في خاصية data.

ماذا يعني response.data في استجابة axios وكيف أستخدمه؟

response.data تحتوي على البيانات العائدة من الـ API. في المثال، يتم تعيينها إلى المتغير المستخدم في البيانات هذا.users، ثم طباعتها في وحدة التحكم.

كيف أرى النتائج بشكل مرئي باستخدام Bootstrap كما في المثال؟

يمكنك استخدام Bootstrap لإنشاء جدول بسيط وعرض البيانات المستلمة من API فيه. هذا يتيح رؤية النتائج بشكل مرئي كما ورد في الأمثلة.

هل يجب علي استيراد axios في ملف Vue قبل استخدامه؟

نعم، يجب استيراد axios قبل استخدامها في الملف. يمكنك فعل ذلك باستخدام import axios from 'axios' كما ورد في المثال.

هل سأرى مخرجات الاستدعاء في وحدة التحكم عند تشغيل المثال؟

نعم، يتم استخدام console.log(this.users) لعرض البيانات المسترجعة في وحدة التحكم كما يظهر في أمثلة الكود.

Related Reading

Posts tagged with:

The 48-Hour Activation Window: How to Turn a Buying Signal into a Booked Meeting Before Your Competitor Even Sees It
Sales

The 48-Hour Activation Window: How to Turn a Buying Signal into a Booked Meeting Before Your Competitor Even Sees It

B2B buying signals decay fast, and most sales teams lose the advantage by waiting days to act. This guide breaks down how to build a 48-hour activation workflow using LeadOcean and Eaglet to turn raw intent signals into personalised, booked meetings before competitors even open their CRM.

How to Build a First-Party Intent Stack That Feeds LeadOcean: From Website Visitor to Verified Decision-Maker in One Workflow
Sales

How to Build a First-Party Intent Stack That Feeds LeadOcean: From Website Visitor to Verified Decision-Maker in One Workflow

Most B2B demand-generation teams ignore the buying signals already embedded in their own website, content, and product analytics. This guide explains how to build a first-party intent stack that resolves anonymous visitor traffic into verified decision-maker contacts, applies composite intent scoring, and routes high-intent accounts into HubSpot or Salesforce automatically using LeadOcean and Eaglet by PlusClouds.

Signal-First Outbound: How to Build a Personalized-at-Scale Prospecting System That Gets 18 % Reply Rates
Sales

Signal-First Outbound: How to Build a Personalized-at-Scale Prospecting System That Gets 18 % Reply Rates

B2B inboxes in 2026 are overwhelmed with generic cold email, pushing market-wide reply rates below 2%. This guide explains how to build a signal-first, personalized-at-scale outbound system that consistently achieves 18% reply rates by triggering outreach on real buying events and using AI-powered enrichment tools like LeadOcean and Eaglet.

Dark Funnel Prospecting: How to Detect and Reach B2B Buyers Before They Ever Fill Out a Form
Sales

Dark Funnel Prospecting: How to Detect and Reach B2B Buyers Before They Ever Fill Out a Form

The dark funnel accounts for roughly 70% of the B2B buyer journey before any prospect fills out a form, meaning most pipeline opportunities are invisible to standard marketing automation. This guide explains how to detect reliable buying signals, avoid false-positive intent data, and build a workflow that gets your outreach in front of the right buyer at the right moment.