ui/src/form/dropdown.js

31 lines
611 B
JavaScript
Raw Normal View History

2023-03-24 17:04:18 +08:00
import { nextTick, css, html, Component, bind } from '@bd/core'
2023-03-23 16:14:38 +08:00
class Dropdown extends Component {
2023-03-24 17:04:18 +08:00
bar = 'balbal'
2023-03-23 16:14:38 +08:00
mounted() {
console.log('Dropdown: ', this.$refs)
2023-03-24 17:04:18 +08:00
bind(this.$refs.balbal, 'mousedown', ev => {
console.log('aa : mousedown')
})
2023-03-23 16:14:38 +08:00
}
2023-03-24 17:04:18 +08:00
foo() {
console.log('foo: click')
}
2023-03-23 16:14:38 +08:00
render() {
return html`
2023-03-24 17:04:18 +08:00
<div class="aa" ref=${this.bar} @click=${this.foo}>
2023-03-23 16:14:38 +08:00
<div class="bb" ref="bb">
<slot ref="dd"></slot>
</div>
2023-03-24 17:04:18 +08:00
<foo>dsdsd</foo>
2023-03-23 16:14:38 +08:00
</div>
2023-03-24 17:04:18 +08:00
<div class="cc" ref="cc">${this.bar}</div>
2023-03-23 16:14:38 +08:00
`
}
}
Dropdown.reg('dropdown')