Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/tdesign/input/_example/status/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
label="标签文字"
value="不可编辑文字"
disabled
@click="onClick"
/>

<t-input
label="标签文字"
value="只读模式"
readonly
@click="onClick"
/>
</view>
</template>
Expand All @@ -34,7 +36,11 @@ export default {
return {};
},
created() {},
methods: {},
methods: {
onClick() {
console.log('click input');
},
},
};
</script>
<style>
Expand Down
16 changes: 14 additions & 2 deletions packages/tdesign/input/input.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<template>
<view
:style="_._style([customStyle])"
:class="_.cls(classPrefix, [['border', !borderless]]) + ' ' + classPrefix + '--layout-' + layout + ' ' + tClass"
:class="_.cls(classPrefix, [['border', !borderless], ['readonly', readonly], ['disabled', disabled]])
+ ' ' + classPrefix + '--layout-' + layout + ' ' + tClass"
aria-describedby
>
<view :class="classPrefix + '__wrap--prefix'">
Expand Down Expand Up @@ -372,5 +373,16 @@ export default uniComponent({
</script>
<style scoped>
@import './input.css';

/* #ifdef H5 */
.t-input--disabled {
:deep(input) {
pointer-events: none;
}
}
.t-input--readonly {
:deep(input) {
pointer-events: none;
}
}
/* #endif */
</style>
Loading