mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-11-04 04:57:51 +00:00 
			
		
		
		
	These fixes are all auto generated and can be merged directly Fixes the following issues 1. Event used on components should be hypenated 2. Attribute orders in components 3. Use `unmounted` instead of `destroyed` 4. Add explicit `emits` declarations for components, autofixed [using this script](https://gist.github.com/scmmishra/6f549109b96400006bb69bbde392eddf) We ignore the top level v-if for now, we will fix it later
		
			
				
	
	
		
			68 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			68 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
<script>
 | 
						|
export default {
 | 
						|
  props: {
 | 
						|
    label: {
 | 
						|
      type: String,
 | 
						|
      default: '',
 | 
						|
    },
 | 
						|
    placeholder: {
 | 
						|
      type: String,
 | 
						|
      default: '',
 | 
						|
    },
 | 
						|
    modelValue: {
 | 
						|
      type: [String, Number],
 | 
						|
      required: true,
 | 
						|
    },
 | 
						|
    error: {
 | 
						|
      type: String,
 | 
						|
      default: '',
 | 
						|
    },
 | 
						|
  },
 | 
						|
  emits: ['update:modelValue'],
 | 
						|
  computed: {
 | 
						|
    computedModel: {
 | 
						|
      get() {
 | 
						|
        return this.modelValue;
 | 
						|
      },
 | 
						|
      set(value) {
 | 
						|
        this.$emit('update:modelValue', value);
 | 
						|
      },
 | 
						|
    },
 | 
						|
  },
 | 
						|
};
 | 
						|
</script>
 | 
						|
 | 
						|
<template>
 | 
						|
  <label class="block">
 | 
						|
    <div
 | 
						|
      v-if="label"
 | 
						|
      class="mb-2 text-xs font-medium"
 | 
						|
      :class="{
 | 
						|
        'text-black-800': !error,
 | 
						|
        'text-red-400': error,
 | 
						|
      }"
 | 
						|
    >
 | 
						|
      {{ label }}
 | 
						|
    </div>
 | 
						|
    <textarea
 | 
						|
      v-model="computedModel"
 | 
						|
      class="w-full px-3 py-2 leading-tight border rounded outline-none resize-none text-slate-700"
 | 
						|
      :class="{
 | 
						|
        'border-black-200 hover:border-black-300 focus:border-black-300':
 | 
						|
          !error,
 | 
						|
        'border-red-200 hover:border-red-300 focus:border-red-300': error,
 | 
						|
      }"
 | 
						|
      :placeholder="placeholder"
 | 
						|
    />
 | 
						|
    <div v-if="error" class="mt-2 text-xs font-medium text-red-400">
 | 
						|
      {{ error }}
 | 
						|
    </div>
 | 
						|
  </label>
 | 
						|
</template>
 | 
						|
 | 
						|
<style lang="scss" scoped>
 | 
						|
textarea {
 | 
						|
  min-height: 8rem;
 | 
						|
}
 | 
						|
</style>
 |