Skip to content

Commit 63ab83d

Browse files
committed
feat(button): add demo
1 parent 077cb87 commit 63ab83d

File tree

9 files changed

+44
-40
lines changed

9 files changed

+44
-40
lines changed

devui/button/button.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export type IButtonSize = 'lg' | 'md' | 'sm' | 'xs';
88
import './button.scss';
99

1010
export default defineComponent({
11+
name: 'd-button',
1112
props: {
1213
id: {
1314
type: [String, Number]
@@ -29,8 +30,8 @@ export default defineComponent({
2930
default: 'default'
3031
},
3132
bordered: {
32-
type: String as () => IButtonPosition,
33-
default: 'default'
33+
type: Boolean,
34+
default: false
3435
},
3536
icon: {
3637
type: String,

devui/button/demo/button-demo.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,23 @@
2020
<script>
2121
import { defineComponent } from 'vue'
2222
import DevUICodeBox from '../../shared/devui-codebox/devui-codebox.vue'
23-
import DevUIButtonPrimary from './primary/primary.vue'
24-
import DevUIButtonCommon from './common/common.vue'
23+
import DevUIButtonPrimary from './primary/primary'
24+
import DevUIButtonCommon from './common/common'
2525
2626
export default defineComponent({
2727
name: 'd-button-demo',
2828
components: {
2929
'd-codebox': DevUICodeBox,
3030
'd-button-primary': DevUIButtonPrimary,
3131
'd-button-common': DevUIButtonCommon,
32+
},
33+
setup() {
34+
const primarySource = {};
35+
const commonSource = {};
36+
return {
37+
primarySource,
38+
commonSource
39+
}
3240
}
3341
})
3442
</script>

devui/button/demo/common/common.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { defineComponent } from 'vue';
2+
import Button from '../../button';
3+
4+
export default defineComponent({
5+
name: 'd-button-common',
6+
setup() {
7+
return () => {
8+
return (
9+
<div>
10+
<Button bsStyle="common">Common</Button>
11+
</div>
12+
);
13+
}
14+
}
15+
});

devui/button/demo/common/common.vue

Lines changed: 0 additions & 13 deletions
This file was deleted.

devui/button/demo/primary/primary.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { defineComponent } from 'vue';
2+
import Button from '../../button';
3+
4+
export default defineComponent({
5+
name: 'd-button-primary',
6+
setup() {
7+
return () => {
8+
return (
9+
<div>
10+
<Button bsStyle="primary">primary</Button>
11+
</div>
12+
);
13+
}
14+
}
15+
});

devui/button/demo/primary/primary.vue

Lines changed: 0 additions & 13 deletions
This file was deleted.

devui/button/index.ts

Whitespace-only changes.

devui/shared/devui-codebox/devui-codebox.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<div>
33
devui codebox
4+
<slot></slot>
45
</div>
56
</template>
67

src/app.vue

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,29 +94,19 @@
9494
</div>
9595
<!-- <app-content></app-content> -->
9696
<router-view></router-view>
97-
<d-button @click="confirm">Confirm</d-button>
98-
<d-button @click="cancel">Cancel</d-button>
9997
</div>
10098
</template>
10199

102100
<script lang="ts">
103101
import { defineComponent } from 'vue'
104102
import AppContent from './components/app-content.vue'
105-
import DevUIButton from '../devui/button/button'
106103
107104
export default defineComponent({
108105
name: 'App',
109106
components: {
110107
AppContent,
111-
'd-button': DevUIButton,
112108
},
113109
methods: {
114-
confirm() {
115-
console.log('confirm')
116-
},
117-
cancel() {
118-
console.log('cancel')
119-
}
120110
}
121111
})
122112
</script>

0 commit comments

Comments
 (0)