Vue Compiler

Vue App (JS)
CSS
Output

What Is the Vue 3 Online Compiler?

The Vue 3 Online Compiler lets you write and run Vue 3 components directly in your browser with instant live preview. It loads Vue 3 via CDN and gives you a split-pane editor with a JavaScript panel for your component logic and template, a CSS panel for styling, and a live output iframe. Both the Composition API (setup, ref, reactive, computed, watch) and the Options API are fully supported, so you can experiment with Vue 3 features without any local tooling.

How It Works

  1. Write your Vue 3 component code in the left-hand JavaScript editor panel using createApp and either the Composition API or the Options API.
  2. Add any CSS styles in the CSS editor below the JavaScript panel.
  3. Click the Run button in the header toolbar.
  4. The compiler builds an HTML document that loads Vue 3 from a CDN, injects your JavaScript and CSS, and creates a mount point.
  5. Your component renders inside a sandboxed iframe in the output panel on the right.

Step-by-Step Example

Follow these steps to create a reactive counter with a task list:

  1. In the JavaScript editor, destructure createApp and ref from Vue.
  2. Call createApp() with a setup() function that creates a ref(0) for the count and a ref([]) for the task list.
  3. Define a template string with a heading that displays the count, a button with @click="count++", and a v-for loop to render the task list.
  4. Chain .mount("#app") to mount the component to the app container.
  5. In the CSS editor, style the card container, buttons, and list items.
  6. Click Run to see the interactive counter and task list in the output panel.

Use Cases

Limitations & Notes

Frequently Asked Questions

What version of Vue does this compiler use?

Vue 3, loaded via CDN.

Can I use the Composition API?

Yes, the Composition API with setup(), ref, reactive, computed, and watch is fully supported.

Can I use the Options API?

Yes, both the Options API and the Composition API work in this compiler.

Is Vuex or Pinia supported?

No, external state management libraries like Vuex and Pinia are not available.

Can I use Vue Router?

No, Vue Router is not included. This is a single-component playground.

Does this support single file components?

This is a template playground. You write your component logic and template in the JS editor and styles in the CSS editor.

Can I import npm packages?

No, only Vue 3 is loaded via CDN. External npm packages cannot be imported.

Can I save my code?

No, code is not saved between sessions. Copy your code before leaving the page.

Sources & References

Related Compilers