new programmer
new programmer

Reputation: 55

Can I use vue in a single Page without vue-cli and nodejs?

If there is a hello.vue and I want to use it in index.html but there is not vue-cli and nodejs.

I do know how to use vue.js but do not know how to use the vue'scomponent if I have a hello.vue.

Do not I say it clearly? please do not tell me how to thank you.

how to use it?

Upvotes: 1

Views: 71

Answers (1)

tamrat
tamrat

Reputation: 1915

Yes. You just need to import Vue from CDN.

For production:

<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

For development: (gives you full warnings and debug mode)

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

Then you can just add a script tag and create a Vue instance.

window.app = new Vue({
  el: "#app"
})

For more information visit the official documentation.

Upvotes: 2

Related Questions