UNPKG

evil-ui

Version:

[![npm package](https://img.shields.io/npm/v/mini-ali-ui.svg?style=flat-square)](https://www.npmjs.com/package/mini-ali-ui) [![GitHub stars](https://img.shields.io/github/stars/Alibaba-mp/mini-ali-ui.svg)](https://github.com/Alibaba-mp/mini-ali-ui/stargaz

58 lines (47 loc) 1 kB
import * as React from "react"; import { View } from "remax/ali"; class Router extends React.Component { constructor(props) { super(props); } static defaultProps = { location: null, }; render() { const props = this.props; return <View>{this.props.children}</View>; } } class Route extends React.Component { constructor(props) { super(props); } static defaultProps = { location: null, exact: false, path: "", component: null, className: null, }; render() { const { path, location, children } = this.props; return <View>{location === path && children}</View>; } } class Link extends React.Component { constructor(props) { super(props); } static defaultProps = { location: null, exact: false, path: "", component: null, className: null, }; render() { const props = this.props; return <View class={props.className}>{this.props.children}</View>; } } export { Router, Route, Link };