master
yutent 2023-08-07 18:55:58 +08:00
parent 07d9e1a08e
commit c3cf60e656
5 changed files with 9 additions and 33 deletions

View File

@ -1,6 +1,6 @@
# @bd/ui
百搭 UI 组件库, 基于 `web components` 开发。面向下一代的 UI 组件库
百搭 UI 组件库, 基于 [【wkit】](https://github.com/bytedo/wkit) 开发。面向下一代的 UI`web components` 组件库
![downloads](https://img.shields.io/npm/dt/@bd/ui.svg)
![version](https://img.shields.io/npm/v/@bd/ui.svg)

View File

@ -12,7 +12,6 @@ class Checkbox extends Component {
value: {
type: Array,
default: [],
attribute: false,
observer() {
this.#updateChildrenStat()
}

View File

@ -1,6 +1,5 @@
import './button.js'
import './checkbox.js'
import './dropdown.js'
import './input.js'
import './link.js'
import './number.js'

View File

@ -16,11 +16,6 @@ class Passwd extends Component {
default: '',
attribute: false
},
_type: {
type: String,
default: 'password',
attribute: false
},
autofocus: false,
readonly: false,
disabled: false,
@ -189,6 +184,8 @@ class Passwd extends Component {
`
]
#type = 'password'
mounted() {
if (this.autofocus) {
nextTick(_ => this.$refs.input.focus())
@ -199,7 +196,8 @@ class Passwd extends Component {
if (this.readOnly || this.disabled) {
return
}
this._type = this._type === 'password' ? '' : 'password'
this.#type = this.#type === 'password' ? '' : 'password'
this.$requestUpdate()
}
handleInput(ev) {
@ -221,13 +219,13 @@ class Passwd extends Component {
@change=${this.handleChange}
:readOnly=${this.readOnly}
:disabled=${this.disabled}
:type=${this._type}
:type=${this.#type}
:value=${this.value}
/>
<wc-icon
class="icon"
@click=${this.iconClick}
:name=${this._type === 'password' ? 'eye' : 'eye-off'}
:name=${this.#type === 'password' ? 'eye' : 'eye-off'}
></wc-icon>
</div>
`

View File

@ -8,6 +8,8 @@ import { nextTick, css, html, Component } from 'wkit'
import '../icon/index.js'
import '../form/input.js'
import '../scroll/index.js'
import '../option/index.js'
class Select extends Component {
static props = {
value: {
@ -88,26 +90,4 @@ class Select extends Component {
}
}
class Option extends Component {
static props = {
value: '2'
}
static styles = [css``]
mounted() {
// console.log(this.value)
// console.log(this.$refs)
// console.log(this.root.innerHTML)
console.log('option mounted')
}
onclick() {
console.log(11)
}
render() {
return html` <div ref="li">${this.value}</div> `
}
}
Select.reg('select')
Option.reg('option')