You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
547 B
27 lines
547 B
import React, { Component } from "react"
|
|
|
|
export const pageList: any[] = []
|
|
|
|
export default function (options: any) {
|
|
return (WrappedComponent: any) => {
|
|
const {
|
|
path, // 页面路径
|
|
} = options
|
|
|
|
class HOC extends React.Component {
|
|
constructor(props: any) {
|
|
super(props)
|
|
}
|
|
componentDidMount() {}
|
|
|
|
componentWillUnmount() {}
|
|
|
|
render() {
|
|
return <WrappedComponent {...options} {...this.props} />
|
|
}
|
|
}
|
|
|
|
pageList.push([{ ...options, Component: HOC }])
|
|
return HOC
|
|
}
|
|
}
|
|
|