evil-ui
Version:
[](https://www.npmjs.com/package/mini-ali-ui) [](https://github.com/Alibaba-mp/mini-ali-ui/stargaz
65 lines (54 loc) • 1.1 kB
JavaScript
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 {
exact,
path,
component,
className,
location,
children,
} = this.props;
return <View style={"width: 100%;"}>{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 };