Answered
0
0

Hello,

I want to use vue.js in my project but I found a problem. This is my code in the app.js file, In fact, no alert shows me everything I do?

I’ve got npm and vue.js installed too.

Vue.component(‘example-component’, require(‘./components/ExampleComponent.vue’));

const app = new Vue({
el: ‘#app’,
data:{
name:””,
selectgroup:[],
namegroup:[]
},
created:funcation(){

},
methods:{
addgroup:funcatio(){
alert(this.namegroup);
},
}
});
var Vue = require(‘vue’);

new Vue({
el: ‘#app’,
});

 

How can I fix it?
please guide me

 

  • You must to post comments
Best Answer
2
0

Hello,

To use vue js you need to create a component like this:

//app.js
Vue.component(‘exmaple’,required(‘components/Exmaple.vue’));
//Code

//Example.vue

<template>
//Code
</template>

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

 

Use of this Site is subject to express terms of use. By using this site, you signify that you agree to be bound by these