| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <template>
- <div class="k-textarea">
- <el-input
- type="textarea"
- :rows="row"
- v-model="pv"
- :maxlength="length"
- :disabled="disabled"
- :placeholder="placeholder"
- ></el-input>
- <div class="k-textarea__length">{{ pv ? pv.length : 0 }} / {{ length }}</div>
- </div>
- </template>
- <script>
- import sync from "../utils/computed.sync";
- export default {
- data() {
- return {};
- },
- computed: {
- pv: sync("value")
- },
- watch: {},
- props: {
- value: {},
- disabled: {
- type: Boolean,
- default: false,
- },
- row: {
- type: Number,
- default: 5,
- },
- length: {},
- placeholder: {}
- },
- methods: {},
- mounted() {
- }
- };
- </script>
- <style lang="scss">
- .k-textarea {
- position: relative;
- &__length {
- position: absolute;
- bottom: -25px;
- right: 12px;
- font-size: 12px;
- }
- }
- </style>
|