欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

input输入框自适应宽度

程序员文章站 2022-06-07 15:41:51
...

代码如下

<template>
  <div class="rc-text" contenteditable ref="componentRef" :id="domId" :class="getClassName" type="text" v-text="'text'"></div>
</template>

<script lang="ts">
import { defineComponent, PropType } from 'vue'
import Component from '@page/service/components/Component'
import { useComponentMethods } from '@page/views/mixins/usePublicMixin'

export default defineComponent({
    name: 'rc-text',
    props: {
        component: {
            type: Object as PropType<Component>,
            required: true
        }
    },
    setup (props) {
        return {
            ...useComponentMethods(props.component)
        }
    }
})
</script>

<style lang='scss'>
.rc-text {
  display: inline-block;
  background-color: transparent;
}
</style>

input输入框自适应宽度
input输入框自适应宽度