Browse Source

文本域副本

lifanagju_citu 1 year ago
parent
commit
b27cb60970

+ 1 - 0
components.d.ts

@@ -33,6 +33,7 @@ declare module 'vue' {
     RouterView: typeof import('vue-router')['RouterView']
     SimilarPositions: typeof import('./src/components/Position/similarPositions.vue')['default']
     Textarea: typeof import('./src/components/FormUI/textarea/index.vue')['default']
+    'Textarea copy': typeof import('./src/components/FormUI/textarea copy/index.vue')['default']
     TextInput: typeof import('./src/components/FormUI/TextInput/index.vue')['default']
     VerificationCode: typeof import('./src/components/VerificationCode/index.vue')['default']
   }

+ 42 - 0
src/components/FormUI/textarea copy/index.vue

@@ -0,0 +1,42 @@
+<template>
+  <div :style="{ width: item.width ? item.width + 'px' : '100%' }">
+    <v-textarea
+      v-model="value"
+      :rules="item.rules"
+      variant="outlined"
+      :label="item.label"
+      :counter="item.counter"
+      :bg-color="item.bgColor"
+      :color="item.color || 'primary'"
+      :validate-on="item.validateOn"
+      :rows="item.rows || 3"
+      :disabled="item.disabled"
+      :density="item.dense || 'compact'"
+      :placeholder="item.placeholder || item.label"
+      :no-resize="!item.resize"
+      @update:modelValue="modelValueUpDate"
+    ></v-textarea>
+  </div>
+</template>
+<script setup>
+import { defineEmits, ref, watch } from 'vue';
+defineOptions({ name:'FormUI-v-textarea'})
+
+const props = defineProps({item: Object, modelValue: [String, Number]})
+const emit = defineEmits(['update:modelValue', 'change'])
+const item = props.item
+const value = ref(props.modelValue)
+
+watch(() => props.modelValue, (newVal) => {
+  value.value = newVal
+})
+const modelValueUpDate = (val) => {
+  value.value = val
+  emit('update:modelValue', value.value)
+  emit('change', value.value)
+}
+
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 4 - 0
src/views/resume/components/educationExp.vue

@@ -13,6 +13,10 @@
       <div v-if="item.isEdit" class="educExpItem-edit">
         <h4 class="color6 my-3 mx-2"> {{ status ? $t('common.edit') : $t('common.add') }}{{ $t('resume.educationExp') }}</h4>
         <CtForm :items="formItems" style="width: 100%;"></CtForm>
+        <div class="text-end">
+          <v-btn class="half-button mr-3" variant="tonal" @click="isEdit = false">{{ $t('common.cancel') }}</v-btn>
+          <v-btn color="primary" class="half-button" @click="handleSave">{{ $t('common.save') }}</v-btn>
+        </div>
       </div>
       <!-- 展示 -->
       <div v-else class="educExpItem">