Skip to content

Commit

Permalink
feat: select组件初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
unfound committed Aug 6, 2021
1 parent 01157f8 commit f01d68f
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 14 deletions.
15 changes: 15 additions & 0 deletions devui/select/demo/demo-basic.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineComponent } from 'vue'
import DSelect from '../select'

export default defineComponent({
name: 'DSelectDemo',
setup() {
return () => {
return (
<>
<DSelect />
</>
)
}
}
})
24 changes: 15 additions & 9 deletions devui/select/demo/select-demo.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { defineComponent } from 'vue'
import { defineComponent } from 'vue';
import { useDemo } from 'hooks/use-demo';
import DemoBasic from './demo-basic';
import DemoBasicCode from './demo-basic?raw';

export default defineComponent({
name: 'd-select-demo',
props: {
},
setup(props, ctx) {
return () => {
return <div>devui-select-demo</div>
}
name: 'DTextInputDemo',
render () {
return useDemo([
{
id: 'demo-basic',
title: '基本用法',
code: DemoBasicCode,
content: <DemoBasic></DemoBasic>
}
]);
}
})
});
20 changes: 20 additions & 0 deletions devui/select/select.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@import '../style/mixins/index';
@import '../style/theme/color';
@import '../style/theme/corner';

.devui-select {
position: relative;
width: 100%;
}

.devui-select-dropdown {
position: absolute;
max-height: 200px;
overflow: auto;
top: 100%;
left: 0;
margin: 5px 0;
border-radius: 2px;
background: #ffffff;
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
}
25 changes: 20 additions & 5 deletions devui/select/select.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@

import './select.scss'
import { defineComponent } from 'vue'

export default defineComponent({
name: 'd-select',
props: {
},
setup(props, ctx) {
name: 'DSelect',
setup() {
return () => {
return <div>devui-select</div>
return (
<div class="devui-select">
<div class="devui-select-selection">
<input
{...{dtextinput: true}}
type="text"
class="devui-select-input"
/>
</div>
<div class="devui-select-dropdown">
<ul class="devui-select-dropdown-list">
<li class="devui-select-item">试试</li>
<li class="devui-select-item">试试</li>
</ul>
</div>
</div>
)
}
}
})

0 comments on commit f01d68f

Please sign in to comment.