File tree Expand file tree Collapse file tree 5 files changed +90
-4
lines changed
examples/sites/demos/pc/app/input
packages/theme/src/textarea Expand file tree Collapse file tree 5 files changed +90
-4
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" demo-input" >
3
+ <tiny-input v-model =" input" disabled placeholder =" input" ></tiny-input >
4
+ <tiny-input type =" textarea" disabled v-model =" input" placeholder =" textarea" ></tiny-input >
5
+ </div >
6
+ </template >
7
+
8
+ <script setup>
9
+ import { ref } from ' vue'
10
+ import { Input as TinyInput } from ' @opentiny/vue'
11
+
12
+ const input = ref (' ' )
13
+ </script >
14
+
15
+ <style scoped>
16
+ .demo-input {
17
+ width : 300px ;
18
+ }
19
+
20
+ .demo-input > div {
21
+ margin-top : 10px ;
22
+ }
23
+ </style >
Original file line number Diff line number Diff line change
1
+ import { test , expect } from '@playwright/test'
2
+
3
+ test ( 'disabled' , async ( { page } ) => {
4
+ page . on ( 'pageerror' , ( exception ) => expect ( exception ) . toBeNull ( ) )
5
+ await page . goto ( 'input#disabled' )
6
+ const demo = page . locator ( '#disabled' )
7
+ const input = demo . getByRole ( 'textbox' , { name : 'input' } )
8
+ const textarea = page . getByRole ( 'textbox' , { name : 'textarea' } )
9
+ await expect ( input ) . toHaveAttribute ( 'disabled' , '' )
10
+ await expect ( textarea ) . toHaveAttribute ( 'disabled' , '' )
11
+ } )
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" demo-input" >
3
+ <tiny-input v-model =" input" disabled placeholder =" input" ></tiny-input >
4
+ <tiny-input type =" textarea" disabled v-model =" input" placeholder =" textarea" ></tiny-input >
5
+ </div >
6
+ </template >
7
+
8
+ <script >
9
+ import { Input } from ' @opentiny/vue'
10
+
11
+ export default {
12
+ components: {
13
+ TinyInput: Input
14
+ },
15
+ data () {
16
+ return {
17
+ input: ' '
18
+ }
19
+ }
20
+ }
21
+ </script >
22
+
23
+ <style scoped>
24
+ .demo-input {
25
+ width : 300px ;
26
+ }
27
+
28
+ .demo-input > div {
29
+ margin-top : 10px ;
30
+ }
31
+ </style >
Original file line number Diff line number Diff line change @@ -27,6 +27,19 @@ export default {
27
27
} ,
28
28
codeFiles : [ 'clearable.vue' ]
29
29
} ,
30
+ {
31
+ demoId : 'disabled' ,
32
+ name : {
33
+ 'zh-CN' : '禁用' ,
34
+ 'en-US' : 'Disabled'
35
+ } ,
36
+ desc : {
37
+ 'zh-CN' : '<p>可通过 <code>disabled</code> 属性设置输入框的禁用状态。</p>' ,
38
+ 'en-US' :
39
+ '<p>You can set the <code>clearable</code> attribute to display the clear icon button in the text box </p>'
40
+ } ,
41
+ codeFiles : [ 'disabled.vue' ]
42
+ } ,
30
43
{
31
44
demoId : 'show-password' ,
32
45
name : {
Original file line number Diff line number Diff line change 30
30
31
31
& :before {
32
32
content : ' ' ;
33
- width : calc (100% - 16 px );
33
+ width : calc (100% - 20 px );
34
34
height : 8px ;
35
35
position : absolute ;
36
36
left : 2px ;
42
42
43
43
& :after {
44
44
content : ' ' ;
45
- width : calc (100% - 19 px );
45
+ width : calc (100% - 20 px );
46
46
height : 16px ;
47
47
position : absolute ;
48
48
left : 2px ;
63
63
& .is-disabled {
64
64
background-color : var (--ti-textarea-disabled-bg-color );
65
65
66
+ & :before {
67
+ background-color : var (--ti-textarea-disabled-bg-color );
68
+ }
69
+
70
+ & :after {
71
+ background-color : var (--ti-textarea-disabled-bg-color );
72
+ }
73
+
66
74
& :hover {
67
75
border-color : var (--ti-textarea-border-color );
68
76
}
175
183
176
184
& .is-display-only {
177
185
.@{textarea-prefix-cls} -display-only.@{textarea-prefix-cls} __inner-con
178
- .@{textarea-prefix-cls} -display-only__content ,
186
+ .@{textarea-prefix-cls} -display-only__content ,
179
187
.@{textarea-prefix-cls} -autosize-display-only.@{textarea-prefix-cls} __inner-con
180
- .@{textarea-prefix-cls} -display-only__content {
188
+ .@{textarea-prefix-cls} -display-only__content {
181
189
position : relative ;
182
190
left : 0 ;
183
191
max-width : 100% ;
You can’t perform that action at this time.
0 commit comments