Merge pull request #690 from ChelesteWang/master
This commit is contained in:
commit
4a7a674180
|
@ -38,6 +38,7 @@
|
|||
"@omiu/popover": "^0.0.14",
|
||||
"@omiu/progress": "^0.0.3",
|
||||
"@omiu/radio": "^0.0.6",
|
||||
"@omiu/rate": "^0.0.9",
|
||||
"@omiu/select": "^0.0.13",
|
||||
"@omiu/slider": "0.0.11",
|
||||
"@omiu/steps": "^0.0.5",
|
||||
|
|
|
@ -78,6 +78,26 @@ Name:"例子"
|
|||
|
||||
## Add component display page to Admin route (supports automatic join)
|
||||
|
||||
Modify the Components object and add your component name
|
||||
|
||||
```js
|
||||
const components = [
|
||||
'button',
|
||||
'tabs',
|
||||
'slider',
|
||||
'loading',
|
||||
'toast',
|
||||
'card',
|
||||
'progress',
|
||||
'time-picker',
|
||||
'tag',
|
||||
'rate',
|
||||
//TODO
|
||||
'name'
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
```js
|
||||
components.map((componentName: string) =>
|
||||
route(`/${componentName}-component`, () => {
|
||||
|
|
|
@ -78,6 +78,25 @@ Name:"例子"
|
|||
|
||||
## 将组件展示页加入 Admin 路由 (支持自动加入了)
|
||||
|
||||
修改 components 对象 , 添加你的组件名
|
||||
|
||||
```js
|
||||
const components = [
|
||||
'button',
|
||||
'tabs',
|
||||
'slider',
|
||||
'loading',
|
||||
'toast',
|
||||
'card',
|
||||
'progress',
|
||||
'time-picker',
|
||||
'tag',
|
||||
'rate',
|
||||
//TODO
|
||||
'name'
|
||||
]
|
||||
```
|
||||
|
||||
```js
|
||||
components.map((componentName: string) =>
|
||||
route(`/${componentName}-component`, () => {
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
import { WeElement, h, tag } from 'omi'
|
||||
import { tw, sheet } from 'omi-twind'
|
||||
import '@omiu/rate'
|
||||
import '../docs/admin-docs'
|
||||
import './code-demo'
|
||||
import './code-demo/container'
|
||||
|
||||
interface Props {}
|
||||
|
||||
const tagName = 'rate-component'
|
||||
declare global {
|
||||
namespace JSX {
|
||||
interface IntrinsicElements {
|
||||
[tagName]: Omi.Props & Props
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@tag(tagName)
|
||||
export default class extends WeElement<Props> {
|
||||
static css = [sheet.target]
|
||||
install(){}
|
||||
render() {
|
||||
return (
|
||||
<code-demo-container>
|
||||
<code-demo
|
||||
title="评分"
|
||||
describe={'基础评分使用'}
|
||||
code={`
|
||||
\`\`\`html
|
||||
<o-rate value="4" max="10" color="red"></o-rate>
|
||||
\`\`\`
|
||||
`}
|
||||
>
|
||||
<div slot="demo" class={tw`px-5 py-5`}>
|
||||
<o-rate value="4" max="10" color="red"></o-rate>
|
||||
</div>
|
||||
</code-demo>
|
||||
|
||||
</code-demo-container>
|
||||
)
|
||||
}
|
||||
}
|
|
@ -12,7 +12,8 @@ const components = [
|
|||
'card',
|
||||
'progress',
|
||||
'time-picker',
|
||||
'tag'
|
||||
'tag',
|
||||
'rate'
|
||||
]
|
||||
|
||||
export function registerRouting(rootEl) {
|
||||
|
|
Loading…
Reference in New Issue