-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbpslashwidget004.js
40 lines (35 loc) · 1.27 KB
/
bpslashwidget004.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const { input, html } = window.CComponents;
export class CustomSlashDivider extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({ mode: 'open' });
shadowRoot.innerHTML = `
<div class="container">
<input type="text">
<span class="slash">/</span>
<input class="right" type="text">
</div>
<style>
.container{
border: 1px solid #999;
display: inline-block;
border-radius: 3px;
background: #fff;
position: relative;
}
.container input{
border: none;
background: none;
}
.right{
margin-left: 6px;
}
.slash{
transform: scale(3);
position: absolute;
}
</style>
`;
}
}
customElements.define('custom-slashdivider', CustomSlashDivider);