I need help with styling component el-date-picker from element plus, can’t figure it out.
Code for a text input from component:
<label v-if="label" class="form-label" :for="id">{{ label }}:</label>
<input :id="id" ref="input" v-bind="{ ...$attrs, class: null }" class="form-input" :class="{ error: error }" :type="type" :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" />
<div v-if="error" class="form-error">{{ error }}</div>
Text input component call:
<text-input v-model="form.sender.text" :error="form.errors.sender" class="pb-8 pr-6 w-full lg:w-1/3" label="Nadpis" :disabled="true" />
gives this (whitch is correct:
but, code for element-plus datetime picker from component:
<label v-if="label" class="form-label" :for="id">{{ label }}:</label>
<el-date-picker :id="id" ref="input" v-model="selected" v-bind="{ ...$attrs, class: null }" class="form-input" :class="{ error: error }" type="datetime" />
<div v-if="error" class="form-error">{{ error }}</div>
Element-plus component call:
<DatetimeInput v-model="form.stamp" :error="form.errors.stamp" class="pb-8 pr-6 w-full lg:w-1/3" label="Add time" />
makes this:
What i did wrong? How to style this, i read the documentation from element-plus website but i don’t understand it and can’t find styles file from it.
2
Answers
you need import css style
In my main.ts
My el-date-picker