Developing.md

November 22, 2017 · View on GitHub

Neutronium.SPA.Demo

Developing

Neutronium.SPA.Demo is based on neutronium-vue vue-cli.

So you need to run npm install first time and npm run dev to open the view in the browser,

# install dependencies
npm install

# serve with hot reload at localhost:9000
npm run dev


To open the page at a specific route, use the -- --open-page=#\my-page option:

# serve with hot reload at localhost:9000 starting with page about
npm run dev -- --open-page=#/about


ViewModels:
During development vm.cjson files are loaded as substitute viewModels.
By convention the viewModel corresponding to a page will be loaded from a folder with the same route name under the data folder.
As such the folder structure is the following:

├── data
   ├── about
   └── vm.cjson
   └── main
       └── vm.cjson

Regular JSON files are compatible with .cjson format, but the best way to generate .cjson files is to can use the save Vm button of Neutronium debug toolbar to save copy of "real" ViewModel:


To build the files for usage in Neutronium application, just run:

# build files for usage in the C# application
npm run build