Initialize an mpvue project
1. Create a new folder and execute the following with node.js
npm install --global [email protected]
vue init mpvue/mpvue-quickstart my-test
(my-test) is the name to be given- Installation dependencies
cd my-test
npm install
·npm run dev
After the successful operation is echoed, you can see that there is an additional dist directory in the local, and this directory is the generated applet related code.
2. Import the WeChat developer tool as an example:
(just find a wx file in the dist file and import it)
3. Open the code in the src directory in my-test with your own handy editor, as an example:
create a new html
, create a new folder in pages, and fill in the main.js file in the demo folder
import Vue from 'vue'
import App from './index'
// add this to handle exception
Vue.config.errorHandler = function (err) {
if (console && console.error) {
console.error(err)
}
}
const app = new Vue(App)
app.$mount()
Open the app.json and modify the order to the first place to display first, and
finally restart npm run dev