-1👍
The methods that the template is looking for aren’t in the component definition for the template. They’re in the new Vue()
instance you’re making inside of it:
<script>
import Slick from 'vue-slick';
export default {
mounted() {
this.News_list = JSON.parse(this.news)
new Vue({
// handleX methods are inside of here
});
},
methods: {
// they should be here
}
}
</script>
This is something proper formatting and indentation would have made more obvious. I’d suggest looking into a formatter like prettier.
Also, making a new Vue instance inside of a Vue component can lead to some really nasty side-effects and non-descript code. Your app should consist of only one new Vue
at the top level, which uses all the rest of your components.
- [Vuejs]-Packing all dynamic data into a single Vuex store
- [Vuejs]-How to compile/build other JS files into main.js on Electron/Vue
Source:stackexchange.com