webpack vue
Loaders
cnpm install vue-loader@14 vue-template-compiler --save-dev
webpack.config.js
module: {
rules: [{
test: /\.vue$/,
use: ['vue-loader']
}],
},
App.vue
<template>
<div id="">
<p>{{message}}</p>
<p>Hello furong!</p>
</div>
</template>
<script>
export default {
name: 'App',
data() {
return {
message: 'Hello Vue.js!',
}
},
methods: {
}
}
</script>
<style>
</style>
vue.js
import Vue from "vue";
import App from './App.vue';
new Vue({
el: '#app',
template: '<App/>',
components: {
App
},
methods: {
}
})