Skip to content

Instantly share code, notes, and snippets.

@alexstone
Last active August 24, 2026 19:50
Show Gist options
  • Select an option

  • Save alexstone/ad5849803aceafff374428d7486f99ee to your computer and use it in GitHub Desktop.

Select an option

Save alexstone/ad5849803aceafff374428d7486f99ee to your computer and use it in GitHub Desktop.
Vue Example

index.html

<html>
  <head>
    <title>Alex's Vue Demo</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js"></script>
    <script src="test_component.js"></script>

    <script>
      document.addEventListener("DOMContentLoaded", function () {
        var app = new Vue({ el: "#vueApp" });
      });
    </script>
  </head>
  <body>
    <div id="vueApp">
      <test-component />
    </div>
  </body>
</html>

test_component.js

Vue.component("TestComponent", {
  data: function () {
    return { count: 0 };
  },
  template: `<div>Hello, world.</div>
`,
});
@alexstone

Copy link
Copy Markdown
Author
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment