增加上传组件

master
yutent 2023-11-24 14:26:56 +08:00
parent f93560eacc
commit cc3c8b166d
6 changed files with 81 additions and 5 deletions

View File

@ -10,3 +10,4 @@ import './star.js'
import './switch.js'
import './textarea.js'
import './slider.js'
import './uploader.js'

View File

@ -1,6 +1,6 @@
/**
* {进度条}
* @author chensbox<chensbox@foxmail.com>
* {滑块组件}
* @author yutent<yutent.io@gmail.com>
* @date 2023/04/28 16:14:10
*/

76
src/form/uploader.js Normal file
View File

@ -0,0 +1,76 @@
/**
* {上传组件}
* @author yutent<yutent.io@gmail.com>
* @date 2023/04/28 16:14:10
*/
import { css, html, Component, bind, unbind } from 'wkit'
import './button.js'
class Uploader extends Component {
static props = {
value: [],
tips: 'str!',
allow: '*/*',
maxSize: 0,
limit: 0,
drag: false,
multiple: false,
disabled: false
}
static styles = [
css`
:host {
display: flex;
width: 100%;
}
.container {
position: relative;
-webkit-user-select: none;
user-select: none;
}
`,
// grid
css`
:host([grid]) {
}
`,
// drag
css`
:host([drag]) {
}
`,
// thumb
css``,
// disabled
css`
:host([disabled]) {
cursor: not-allowed;
opacity: 0.6;
.thumb::before {
cursor: not-allowed;
transform: unset;
}
}
`
]
render() {
return html`
<main class="container">
<header>
<div class="action-area">
<wc-button icon="upload"></wc-button>
</div>
<cite class="tips">${this.tips}</cite>
</header>
</main>
`
}
}
Uploader.reg('uploader')

View File

@ -15,7 +15,6 @@ import './notify/index.js'
import './pager/index.js'
import './sandbox/index.js'
import './scroll/index.js'
import './slider/index.js'
import './space/index.js'
import './steps/index.js'
import './swipe/index.js'

View File

@ -1,6 +1,6 @@
/**
* {进度条}
* @author chensbox<chensbox@foxmail.com>
* @author yutent<yutent.io@gmail.com>
* @date 2023/04/28 16:14:10
*/

View File

@ -1,6 +1,6 @@
/**
* {结果}
* @author chensbox<chensbox@foxmail.com>
* @author yutent<yutent.io@gmail.com>
* @date 2023/04/28 16:14:10
*/