added mounting strategy to readme

This commit is contained in:
Geoff Doty 2022-07-18 00:19:13 -04:00
parent a52159332a
commit 74ba9d1c26
1 changed files with 41 additions and 0 deletions

View File

@ -2,6 +2,7 @@
Use [Vite](https://vitejs.dev/) Starter Template to scaffold a new [Riot](https://riot.js.org/) project.
## Getting Started
Pull the template files with [degit](https://github.com/Rich-Harris/degit) and install dependencies
@ -14,6 +15,41 @@ npm install
npm run dev
```
### Mounting Strategy
This template uses a **pages** static registry based approach that auto-mounts global *page components* that then can dynaimicly mount other *components* needed build your up your content via the `components` export default property.
> SEE: /pages/registry.js for more information
#### Components Example
```
<my-page>
<div>
<example-component></example-component>
</div>
<script>
import Example from './example-component/example-component.riot';
export default {
components: {
Example
}
}
</script>
</my-page>
```
> recommend a dedicated `/components` directory
### Testing
- TODO
> SEE: `pages/hello-riot/hello-riot.spec.js` (unwired)
## NPM Scripts
- npm run dev - Starts the development server at port 3000
@ -34,6 +70,11 @@ When you use this template, you should update the following with your informatio
- [ ] Clean up the README
## TODO
- Add Testing Example w/ Chai & Mocha
## License
- [MIT License](https://github.com/n2geoff/vite-riot-template/blob/main/LICENSE).