Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lc-soft/lcui-router
The official router for LCUI.
https://github.com/lc-soft/lcui-router
c lcui router
Last synced: 1 day ago
JSON representation
The official router for LCUI.
- Host: GitHub
- URL: https://github.com/lc-soft/lcui-router
- Owner: lc-soft
- License: mit
- Created: 2019-08-11T11:12:44.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-12T02:07:23.000Z (about 3 years ago)
- Last Synced: 2024-08-02T07:13:48.119Z (3 months ago)
- Topics: c, lcui, router
- Language: C
- Homepage:
- Size: 131 KB
- Stars: 9
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-xmake - lcui-router
README
# lcui-router
(**English**/[中文](README.zh-cn.md))
[![GitHub Actions](https://github.com/lc-soft/lcui-router/workflows/C%2FC%2B%2B%20CI/badge.svg)](https://github.com/lc-soft/lcui-router/actions)
[![Build Status](https://travis-ci.org/lc-soft/lcui-router.svg?branch=master)](https://travis-ci.org/lc-soft/lcui-router)
[![Coverage Status](https://coveralls.io/repos/github/lc-soft/lcui-router/badge.svg?branch=master)](https://coveralls.io/github/lc-soft/lcui-router?branch=master)## Introduction
LCUI Router is the official router for [LCUI](https://github.com/lc-soft/LCUI). It provides a similar development experience to the [Vue Router](https://github.com/vuejs/vue-router) and make building multiple views applications with LCUI a breeze. Features include:
- Nested route/view mapping
- Modular, component-based router configuration
- Route params, query, wildcards
- Fine-grained navigation control
- Links with automatic active CSS classes## Installation
**Windows:**
Install with [LCPkg](https://github.com/lc-soft/lcpkg):
```bash
lcpkg install github.com/lc-soft/lcui-router
```**Linux:**
Download source code and copy it to your project directory.
## Getting Started
> **Note:** We will using [lcui-cli](https://github.com/lc-ui/lcui-cli) tool to manage the configuration and source code for the router.
Create an LCUI application project:
``` bash
lcui create myapp
cd myapp
```Overwrite the following code to the file `app/assets/views/app.xml`:
```xml
Hello App!
Go to Foo
Go to Bar
```
Generate two widgets:
```bash
lcui generate widget foo
lcui generate widget bar
```Save following code as file `config/router.js`:
```js
module.exports = [
{ path: '/foo', component: 'foo' },
{ path: '/bar', component: 'bar' }
]
```Compile config file for router:
```bash
lcui compile router
```Run app:
``` bash
lcpkg run start
```For more examples, please see the [lcui-router-app](https://github.com/lc-ui/lcui-router-app) project.
## Documentation
LCUI Router is referenced from Vue Router, so you can read the [Vue Router documentation](https://router.vuejs.org/) to learn about the basic usage of LCUI Router.
## License
[MIT licensed](LICENSE).