Merge pull request #690 from ChelesteWang/master

This commit is contained in:
当耐特 2021-08-15 16:01:05 +08:00 committed by GitHub
commit 4a7a674180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 85 additions and 1 deletions

View File

@ -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",

View File

@ -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`, () => {

View File

@ -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`, () => {

View File

@ -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>
)
}
}

View File

@ -12,7 +12,8 @@ const components = [
'card',
'progress',
'time-picker',
'tag'
'tag',
'rate'
]
export function registerRouting(rootEl) {