Vector: Vue in Blade, the easy way — DeepSeek Tips &…
    Neura MarketNeura Market/DeepSeek
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityTrending
    DeepSeekBlogVector: Vue in Blade, the easy way
    Back to Blog
    Vector: Vue in Blade, the easy way
    laravel

    Vector: Vue in Blade, the easy way

    Bruno Pinto February 3, 2026
    0 views

    You know that feeling when you're building a Laravel app and you just need a tiny bit of reactivity?...

    You know that feeling when you're building a Laravel app and you just need a tiny bit of reactivity? A counter. A toggle. Something that feels overkill for a full Vue component but too annoying for vanilla JavaScript?

    I kept reaching for Alpine.js, which is great, but I wanted Vue's Composition API. The ref(), the computed(), the familiar syntax I already know. So I bu4ilt Vector.

    What Even Is This?

    Vector is a Laravel package that lets you write Vue directly in your Blade templates with zero ceremony:

    <script setup>
        const i = ref(0);
    </script>
    
    <div>
        <button @click="i++">Click Me</button>
        <div>
            Count: @{{ i }}
        </div>
        <div v-if="i > 5">Success!</div>
    </div>
    

    That's the whole thing. No build step for your components. No separate .vue files. No special directives wrapping your code. Just a <script setup> tag and you're done.

    How It Works

    The <script setup> tag gets transformed at compile time. Vector treats the element immediately after the script tag as your Vue template. Everything inside that element becomes reactive, and anything outside it remains regular Blade.

    1. Blade's precompiler finds your <script setup> blocks
    2. Extracts your variable declarations
    3. Mounts Vue on the next sibling element

    The key part is the variable extraction. It parses const, let, and var declarations and auto-returns them to the template. You write normal code, it figures out the rest.

    Escaping Blade Syntax

    Since Blade also uses {{ }} for output, you need to prefix Vue's mustache syntax with @ to prevent Blade from processing it:

    {{-- This is Blade --}}
    {{ $phpVariable }}
    
    {{-- This is Vue (note the @) --}}
    @{{ vueVariable }}
    

    Alternatively, use Vue directives like v-text which don't conflict with Blade:

    <span v-text="count"></span>
    

    Installation

    composer require brunoabpinto/vector
    

    Add Vector to your Vite entry points in vite.config.js:

    plugins: [
        laravel({
            input: [
                "resources/css/app.css",
                "resources/js/app.js",
                "resources/js/vendor/vector.js",
            ],
            // ...
        }),
    ],
    resolve: {
        alias: {
            'vue': 'vue/dist/vue.esm-bundler.js',
        },
    },
    

    Add @vectorJs before your closing </body> tag in your layout:

    <body>
        {{ $slot }}
    
        @vectorJs
    </body>
    

    That's it. Vector auto-publishes its runtime, and @vectorJs loads it where you need it.

    The Trade-offs

    Let's be real about what this is:

    Good for:

    • Quick interactive elements
    • Prototyping
    • When you want Vue's API without Vue's ceremony
    • Laravel apps that are mostly server-rendered with islands of reactivity

    Not great for:

    • Complex component hierarchies
    • When you need proper SFC features (scoped styles, etc.)
    • Large-scale SPAs (just use Inertia at that point)

    Try It

    The package is available on GitHub. Star it, fork it, tell me it's an abomination. Whatever feels right.

    composer require brunoabpinto/vector
    

    Tags

    laravelvuewebdevjavascript

    Comments

    More Blog

    View all
    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught megemma

    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught me

    I ported the whole Gemma-4 family — E2B, E4B, 12B, 31B, and the 26B-A4B MoE — to run on...

    X
    xbill
    Hey DEV, I'm Tobore. Let's actually connect.community

    Hey DEV, I'm Tobore. Let's actually connect.

    Hey DEV, I'm Tobore. Let's actually connect. I've been on here for a while now, mostly writing and...

    L
    Laurina Ayarah
    I burned through thousands of AI tokens. Then a friend did it for freeai

    I burned through thousands of AI tokens. Then a friend did it for free

    (yep, kinda clickbait, just for the funsies 😊) At the beginning of the year, I relaunched my...

    P
    Paulo Henrique
    Claude might be saturating your machineai

    Claude might be saturating your machine

    My laptop was sitting idle with the fan at full tilt. Nothing was running that I knew of. The culprit...

    S
    Sidhant Panda
    Automated GitHub Code Reviews Using Google Geminigithubactions

    Automated GitHub Code Reviews Using Google Gemini

    I Built a Thing! TL;DR — Google Gemini-based Pull Request reviews and Issue Triaging for...

    D
    Darren "Dazbo" Lester
    What is an "agentic harness," actually?ai

    What is an "agentic harness," actually?

    I've been hearing the word "harness" thrown around a lot lately. I assumed it just meant "the IDE" or...

    T
    Tilde A. Thurium

    Stay up to date

    Get the latest DeepSeek prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for DeepSeek and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions for your business.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this DeepSeek resource

    • Automate Blog Content Creation with Notion MCP, DeepSeek AI, and WordPressn8n · $9.99 · Related topic
    • Generate AI Videos from Scripts with DeepSeek, Synthesia, and Together.ain8n · $24.99 · Related topic
    • Compare Multi-Period Financial Data from Google Sheets with DeepSeek AI Analysisn8n · $14.99 · Related topic
    • Building a RAG Chatbot for Movie Recommendations with Qdrant and OpenAIn8n · $14.99 · Related topic
    Browse all workflows