Skip to content

Commit 4388f96

Browse files
committed
feat(example): 支持omi组件格式
2 parents 3fd5429 + b6f367c commit 4388f96

File tree

4 files changed

+68
-40
lines changed

4 files changed

+68
-40
lines changed

.github/workflows/pull-request.yml

+38-33
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,44 @@
11
name: MAIN_PULL_REQUEST
22

33
on:
4-
push:
5-
branches: [main]
6-
pull_request_target:
7-
types: [closed]
4+
# push:
5+
# branches: [main]
6+
# pull_request_target:
7+
# types: [closed]
8+
pull_request:
9+
branches: [develop, main, compositionAPI]
10+
types: [opened, synchronize, reopened]
811

912
jobs:
10-
modify-services:
11-
runs-on: ubuntu-latest
12-
outputs:
13-
services-changed: ${{ steps.services-changed.outputs.changed }}
14-
steps:
15-
- uses: actions/checkout@v2
16-
with:
17-
fetch-depth: 100
18-
- uses: marceloprado/has-changed-path@v1
19-
id: services-changed
20-
with:
21-
paths: services
22-
- run: echo services changed=${{ steps.services-changed.outputs.changed }}
13+
call-test-build:
14+
uses: .github/workflows/test-build.yml
15+
# modify-services:
16+
# runs-on: ubuntu-latest
17+
# outputs:
18+
# services-changed: ${{ steps.services-changed.outputs.changed }}
19+
# steps:
20+
# - uses: actions/checkout@v2
21+
# with:
22+
# fetch-depth: 100
23+
# - uses: marceloprado/has-changed-path@v1
24+
# id: services-changed
25+
# with:
26+
# paths: services
27+
# - run: echo services changed=${{ steps.services-changed.outputs.changed }}
2328

24-
upload-services:
25-
runs-on: ubuntu-latest
26-
needs: modify-services
27-
if: needs.modify-services.outputs.services-changed == 'true'
28-
steps:
29-
- uses: actions/checkout@v2
30-
- uses: actions/setup-node@v2
31-
with:
32-
node-version: 18
33-
- run: node ./services/update-components-notice.js
34-
- run: sleep 3s
35-
- run: |
36-
export DEPLOY_DOMAIN=https://tdesign-site-services.surge.sh
37-
npx surge --project ./services --domain $DEPLOY_DOMAIN --token ${{ secrets.TDESIGN_SURGE_TOKEN }}
38-
echo the preview URL is $DEPLOY_DOMAIN
39-
echo "::set-output name=url::$DEPLOY_DOMAIN"
29+
# upload-services:
30+
# runs-on: ubuntu-latest
31+
# needs: modify-services
32+
# if: needs.modify-services.outputs.services-changed == 'true'
33+
# steps:
34+
# - uses: actions/checkout@v2
35+
# - uses: actions/setup-node@v2
36+
# with:
37+
# node-version: 18
38+
# - run: node ./services/update-components-notice.js
39+
# - run: sleep 3s
40+
# - run: |
41+
# export DEPLOY_DOMAIN=https://tdesign-site-services.surge.sh
42+
# npx surge --project ./services --domain $DEPLOY_DOMAIN --token ${{ secrets.TDESIGN_SURGE_TOKEN }}
43+
# echo the preview URL is $DEPLOY_DOMAIN
44+
# echo "::set-output name=url::$DEPLOY_DOMAIN"

.github/workflows/test-build.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ jobs:
3939
${{ runner.os }}-build-
4040
${{ runner.os }}-
4141
- run: npm install
42-
4342
- run: npm run lint
44-
- run: npm run test
43+
- run: npm run build
44+
# - run: npm run test
4545
# upload report to codecov
46-
- uses: codecov/codecov-action@v2
47-
with:
48-
token: ${{ secrets.CODECOV_TOKEN }}
46+
# - uses: codecov/codecov-action@v2
47+
# with:
48+
# token: ${{ secrets.CODECOV_TOKEN }}
4949

5050
site:
5151
runs-on: ubuntu-latest
@@ -68,7 +68,6 @@ jobs:
6868
${{ runner.os }}-build-
6969
${{ runner.os }}-
7070
- run: npm install
71-
7271
- name: Build site
7372
run: npm run site:preview
7473

src/button/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spline: base
88

99
### 基础使用
1010

11-
{{ base }}
11+
{{ base-omi }}
1212

1313
### 图标按钮
1414

src/button/_example/base-omi.tsx

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import 'tdesign-web-components/button';
2+
3+
import { Component } from 'omi';
4+
5+
export default class Button extends Component {
6+
render() {
7+
return (
8+
<div style={{ gap: 16, display: 'inline-flex' }}>
9+
<t-button theme="default" variant="base">
10+
填充按钮
11+
</t-button>
12+
<t-button theme="default" variant="outline">
13+
描边按钮
14+
</t-button>
15+
<t-button theme="default" variant="dashed">
16+
虚框按钮
17+
</t-button>
18+
<t-button theme="default" variant="text">
19+
文字按钮
20+
</t-button>
21+
</div>
22+
);
23+
}
24+
}

0 commit comments

Comments
 (0)