| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <template>
- <view class="box">
- <view class="input-box">
- <view class="input-box-left">
- {{ label }}
- </view>
- <input
- :name="name"
- :type="type"
- :placeholder="placeholder ? placeholder : ''"
- :disabled="!!disabled"
- v-model="inputValue"
- />
- </view>
- <view class="box-solid"></view>
- </view>
- </template>
- <script>
- export default {
- name: 'en-input',
- props: {
- type: {
- type: String,
- default: 'text'
- },
- label: {
- type: String,
- default: '标题'
- },
- placeholder: {
- type: String,
- default: '请输入'
- },
- disabled: {
- default: false
- },
- name: {
- type: String,
- default: 'text'
- },
- value: {
- default: ''
- }
- },
- data() {
- return {
- inputValue: ''
- }
- },
- components: {},
- mounted() {
- this.inputValue = this.value
- },
- watch: {
- 'value': function () {
- if (this.inputValue !== this.value) {
- this.inputValue = this.value
- }
- },
- 'inputValue': function () {
- this.$emit('input', this.inputValue)
- }
- },
- methods: {}
- }
- </script>
- <style lang="scss" scoped>
- .box{
- height: 114rpx;
- background-color: #ffffff;
- .input-box {
- height: 98rpx;
- display: flex;
- align-items: center;
- .input-box-left {
- width: 210rpx;
- font-size: 32rpx;
- color: #333333;
- }
- }
- .box-solid{
- border-bottom: 1px solid #F0F0F0;
- margin-bottom:26rpx;
- }
- }
- </style>
|