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>