master
parent
07d9e1a08e
commit
c3cf60e656
|
@ -1,6 +1,6 @@
|
||||||
# @bd/ui
|
# @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)
|
![downloads](https://img.shields.io/npm/dt/@bd/ui.svg)
|
||||||
![version](https://img.shields.io/npm/v/@bd/ui.svg)
|
![version](https://img.shields.io/npm/v/@bd/ui.svg)
|
||||||
|
|
|
@ -12,7 +12,6 @@ class Checkbox extends Component {
|
||||||
value: {
|
value: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: [],
|
||||||
attribute: false,
|
|
||||||
observer() {
|
observer() {
|
||||||
this.#updateChildrenStat()
|
this.#updateChildrenStat()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import './button.js'
|
import './button.js'
|
||||||
import './checkbox.js'
|
import './checkbox.js'
|
||||||
import './dropdown.js'
|
|
||||||
import './input.js'
|
import './input.js'
|
||||||
import './link.js'
|
import './link.js'
|
||||||
import './number.js'
|
import './number.js'
|
||||||
|
|
|
@ -16,11 +16,6 @@ class Passwd extends Component {
|
||||||
default: '',
|
default: '',
|
||||||
attribute: false
|
attribute: false
|
||||||
},
|
},
|
||||||
_type: {
|
|
||||||
type: String,
|
|
||||||
default: 'password',
|
|
||||||
attribute: false
|
|
||||||
},
|
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
readonly: false,
|
readonly: false,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
|
@ -189,6 +184,8 @@ class Passwd extends Component {
|
||||||
`
|
`
|
||||||
]
|
]
|
||||||
|
|
||||||
|
#type = 'password'
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.autofocus) {
|
if (this.autofocus) {
|
||||||
nextTick(_ => this.$refs.input.focus())
|
nextTick(_ => this.$refs.input.focus())
|
||||||
|
@ -199,7 +196,8 @@ class Passwd extends Component {
|
||||||
if (this.readOnly || this.disabled) {
|
if (this.readOnly || this.disabled) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this._type = this._type === 'password' ? '' : 'password'
|
this.#type = this.#type === 'password' ? '' : 'password'
|
||||||
|
this.$requestUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
handleInput(ev) {
|
handleInput(ev) {
|
||||||
|
@ -221,13 +219,13 @@ class Passwd extends Component {
|
||||||
@change=${this.handleChange}
|
@change=${this.handleChange}
|
||||||
:readOnly=${this.readOnly}
|
:readOnly=${this.readOnly}
|
||||||
:disabled=${this.disabled}
|
:disabled=${this.disabled}
|
||||||
:type=${this._type}
|
:type=${this.#type}
|
||||||
:value=${this.value}
|
:value=${this.value}
|
||||||
/>
|
/>
|
||||||
<wc-icon
|
<wc-icon
|
||||||
class="icon"
|
class="icon"
|
||||||
@click=${this.iconClick}
|
@click=${this.iconClick}
|
||||||
:name=${this._type === 'password' ? 'eye' : 'eye-off'}
|
:name=${this.#type === 'password' ? 'eye' : 'eye-off'}
|
||||||
></wc-icon>
|
></wc-icon>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
|
|
@ -8,6 +8,8 @@ import { nextTick, css, html, Component } from 'wkit'
|
||||||
import '../icon/index.js'
|
import '../icon/index.js'
|
||||||
import '../form/input.js'
|
import '../form/input.js'
|
||||||
import '../scroll/index.js'
|
import '../scroll/index.js'
|
||||||
|
import '../option/index.js'
|
||||||
|
|
||||||
class Select extends Component {
|
class Select extends Component {
|
||||||
static props = {
|
static props = {
|
||||||
value: {
|
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')
|
Select.reg('select')
|
||||||
Option.reg('option')
|
|
||||||
|
|
Loading…
Reference in New Issue