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 {
2727 } ,
2828 codeFiles : [ 'clearable.vue' ]
2929 } ,
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+ } ,
3043 {
3144 demoId : 'show-password' ,
3245 name : {
Original file line number Diff line number Diff line change 3030
3131 & :before {
3232 content : ' ' ;
33- width : calc (100% - 16 px );
33+ width : calc (100% - 20 px );
3434 height : 8px ;
3535 position : absolute ;
3636 left : 2px ;
4242
4343 & :after {
4444 content : ' ' ;
45- width : calc (100% - 19 px );
45+ width : calc (100% - 20 px );
4646 height : 16px ;
4747 position : absolute ;
4848 left : 2px ;
6363 & .is-disabled {
6464 background-color : var (--ti-textarea-disabled-bg-color );
6565
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+
6674 & :hover {
6775 border-color : var (--ti-textarea-border-color );
6876 }
175183
176184 & .is-display-only {
177185 .@{textarea-prefix-cls} -display-only.@{textarea-prefix-cls} __inner-con
178- .@{textarea-prefix-cls} -display-only__content ,
186+ .@{textarea-prefix-cls} -display-only__content ,
179187 .@{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 {
181189 position : relative ;
182190 left : 0 ;
183191 max-width : 100% ;
You can’t perform that action at this time.
0 commit comments