Dmitry Bubnenkov
Dmitry Bubnenkov

Reputation: 9859

Can I use Vue without require?

I am just learning JS and Vue.JS and would not like have any overhead like NodeJS, npm etc at start. I want to some simple code.

The docs says that I need: Add vue and vue-resource to your package.json, then npm install, then add these lines in your code:

But could I simply do:

var Vue = ('vue');
Vue.use('vue-resource');

or like it:

var App = new Vue ({
   el: '#app',
  data:
    {
      currentView: 'guestmenu'
    }
  })


Vue.use('vue-resource');

Am I right understand that it's extend Vue instance with vue-resource ?

Upvotes: 0

Views: 2049

Answers (1)

csukcc
csukcc

Reputation: 772

If you just want to play around with Vue and not have to worry about setting up package.json file, maybe try something like this?

<script type="text/javascript" src="lib/js/vue.min.js"></script>
<script type="text/javascript" src="lib/js/vue-resource.min.js"></script>

Obviously you need to download vue.min.js and vue-resource.min.js and put them in the relative directories to your HTML file.

Upvotes: 2

Related Questions