For the analysis and construction of imitated minprogram structure.
Install using npm.
npm i -s miniprogram-analyze-cli
First, the project structure requirements are as follows:
|-- myapp
|-- -- pages
|-- -- -- home
|-- -- -- -- index.html
|-- -- -- -- index.css
|-- -- -- -- index.js
|-- -- app.js
|-- -- app.json
|-- -- app.css
You can write normal templates in html file:
<p>HelloWord</p>
And imitate the mini program syntax in js file:
const app = getApp()
Page({
name: "Home",
data() {
return {};
},
created () {
app.globalData.name = 'Jenny'
console.log(app);
},
methods: {}
});
Ok, you just need to execute the following commands in the required project structure directory:
miniprogram-analyze-cli build
Then you will get the same structure as vue-cli packaged.
The ISC License (ISC). Please see License File.