I need to change the content of element plus components.
I tried using <template> and <slot>, but without success.
<ElInput v-model="form.name" placeholder="Nome">
<template>
<input class="intro-x login__input form-control py-3 px-4 block"
type="text"
autocomplete="off"
tabindex="0"
placeholder="Nome"
>
</template>
</ElInput>
If you want to pass some specific style to your component, you will need to use input-style as shown here. There is nothing similar to input-class so far, so you're stuck with something like this
<template>
<el-input
v-model="form.name"
:input-style="{ backgroundColor: 'red', height: '4rem' }"
type="text"
autocomplete="off"
tabindex="0"
placeholder="Nome"
>
<template>
<input />
</template>
</el-input>
</template>
There are no other slots related.
Meanwhile you can always hack the whole thing and style it with your own CSS as like this
<style scoped>
:deep(.el-input__inner) {
background-color: teal;
border: 2px solid coral;
}
</style>
Related
I have a sidebar menu where I am trying to put my social media section at the bottom of the sidebar but I am struggling to get flex to work and do so. I tried item-stretch on the second row but the issue is the row does not expand the entire scroll area. The closest example which is not quasar per say can be found here https://preview.colorlib.com/#elen
Sidebar Component:
<template>
<div class="navigation-links q-pa-lg">
<q-list padding>
<q-item clickable v-ripple class="q-pa-md q-ma-md menu-item">
<q-item-section avatar>
<q-icon name="fa-solid fa-house" style="font-size:1.25rem"/>
</q-item-section>
<q-item-section>
HOME
</q-item-section>
</q-item>
<q-item active clickable v-ripple class="q-pa-md q-ma-md menu-item active-menu-item">
<q-item-section avatar>
<q-icon name="fa-solid fa-shirt" style="font-size:1.25rem"/>
</q-item-section>
<q-item-section>
SERVICES
</q-item-section>
</q-item>
<q-item clickable v-ripple class="q-pa-md q-ma-md menu-item">
<q-item-section avatar>
<q-icon name="fa-solid fa-envelope" style="font-size:1.25rem"/>
</q-item-section>
<q-item-section>
CONTACT US
</q-item-section>
</q-item>
</q-list>
</div>
<div class="socialmedia-links q-pa-lg text-center column no-wrap flex-center self" style="">
<div class="row">
<q-btn flat size="sm" color="primary" round icon="fa-brands fa-google" aria-label="google" class="float-right q-ma-sm no-shadow"/>
<q-btn flat size="sm" color="primary" round icon="fa-brands fa-facebook-f" aria-label="facebook" class="float-right q-ma-sm no-shadow"/>
<q-btn flat size="sm" color="primary" round icon="fa-brands fa-instagram" aria-label="instagram" class="float-right q-ma-sm no-shadow"/>
</div>
<h2 class="text-h5 text-weight-bolder q-mb-xs">CONNECT WITH US</h2>
<h6 class="text-subtitle1 text-accent text-weight-normal q-my-none">If you like what you have seen so far we can guarentee you will appreciate our print quality.</h6>
</div>
<script setup>
import { ref } from 'vue'
const searchText = ref('')
</script>
<style lang="scss" scoped>
.block-wrapper{
max-width: 1024px;
margin-left: auto;
margin-right: auto;
}
.active-menu-item{
background-color: $background-accent;
}
.menu-item{
letter-spacing: .15rem;
font-weight:500;
border-radius: 7px;
}
</style>
Layout Component
<q-drawer
v-model="navigationDrawer"
bordered
side="left"
behavior="mobile"
:width="$q.screen.width >= 400 ? 400 : $q.screen.width"
>
<q-scroll-area class="fit q-pa-lg">
<div class="row justify-end">
<q-btn flat round icon="fa-solid fa-xmark" aria-label="Menu" #click="toggleNavigationDrawer"/>
</div>
<div class="row" style="min-height: 100%;">
<div class="col-12">
<HomeSidebar/>
</div>
</div>
</q-scroll-area>
</q-drawer>
Turn q-scroll-area's content container into a flex column. You can apply CSS classes directly to the container with :content-style prop
<q-scroll-area
class="fit q-pa-lg"
:content-style="{ display: 'flex', 'flex-direction': 'column' }"
>
Also make the div surrounding the sidebar a flex column with justify-content: space-between. The row surrounding it should also have flex-grow: 1
<div class="row" style="min-height: 100%; flex-grow: 1">
<div class="col-12 flex column justify-between">
<HomeSidebar/>
</div>
Here's a sandbox that shows the result
I'm trying to create a table with header like this
I try with this code, but no luck
<q-table binary-state-sort
table-header-class="text-white bg-44b2b8 rounded"
:data="this.$store.state.apiKeyList"
:columns="columns"
:filter="filter"
row-key="name"
flat
>
<template v-slot:top>
<q-input debounce="300" color="primary" v-model="filter">
<template v-slot:prepend>
<q-icon name="search" />
</template>
</q-input>
</template>
</q-table>
in css file:
.rounded {
border-radius: 10px 10px 0px 0px;
}
any clue to achieve the rounded header?
Change table-header-class to just class for rounded class and it works
codepen - https://codepen.io/Pratik__007/pen/QWNEwmp
I'm trying to build an application on VueJs 2.0 where I'm having following codes
<div class="col-sm-6">
<label class="col-sm-6 control-label">With client*:</label>
<div class="radio col-sm-3">
<input type="radio" name="with_client" v-model="withClient" value="1" checked="">
<label>
Yes
</label>
</div>
<div class="radio col-sm-3">
<input type="radio" name="with_client" v-model="withClient" value="0">
<label>
No
</label>
</div>
</div>
I want to disable v-select i.e. http://sagalbot.github.io/vue-select/ element if v-model withClient = 0 and enable withClient= 1
<v-select multiple :options="contacts" :on-search="getOptions" placeholder="Contact name" v-model="contactParticipants"></v-select>
Vue-select allows this now with the prop :selectable
<v-select
v-model="selectedCar"
:options="cars"
:selectable="car => car.disabled"
/>
If "disabled" is not yet supported, it's pretty easy to add your own:
<style>
.disabled {
pointer-events:none;
color: #bfcbd9;
cursor: not-allowed;
background-image: none;
background-color: #eef1f6;
border-color: #d1dbe5;
}
</style>
<v-select :options="['foo','bar','baz', 'hello']" v-bind:class="{ disabled: true }"></v-select>
Simply bind "disabled" HTML property to a boolean.
Here an exemple with Vuex (select have to be disabled from outside component).
<v-select
label="label"
:options="criterias"
#input="SELECTED_CRITERIAS_ACTION"
#keyup.enter.stop="SELECTED_CRITERIAS_ACTION"
:placeholder="pageDescription"
multiple
:disabled="this.$store.state.ModuleSearchCriterias.isSearching"
>
<span slot="no-options">Pas de résulats</span>
</v-select>
I'm trying to create an input that has a button to the right that contains an icon and can be clicked a bit like this
Here is my code so far
http://www.bootply.com/udRtNLsCgV
<div class="input-group">
<input class="form-control" placeholder="Select area...">
<span class="input-group-addon glyphicon glyphicon-edit" onclick="openDialog()">Area</span>
</div>
My problem is that the font in the button doesn't seem to be the default font and the input is far too wide
Include your icon separately (inside div with input-group-addon class).
You can control width of input group in CSS.
HTML:
<div class="input-group">
<input class="form-control" placeholder="Select area...">
<span class="input-group-addon" onclick="openDialog()"><i class="glyphicon glyphicon-edit"></i> Area</span>
</div>
CSS:
.input-group {
width: 200px;
}
.input-group-addon > a {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
BOOTPLY
Bootstrap includes a rectangle around the check box in this jsFiddle Example. Have I used markup incorrectly or is there a work around?
<form class="form-horizontal" role="form">
<div class="form-group form-group-lg">
<label for="cbLabel" class="col-sm-3 control-label">Label:</label>
<div class="col-sm-3">
<input type="checkbox" id="cbLabel" class="form-control" />
</div>
</div>
</form>
Add a custom class to the form-control element (.fix in my example) and some custom styling to override Bootstrap's styling.
.fix {
-webkit-box-shadow: none;
box-shadow: none;
}
.fix:focus {
-webkit-box-shadow: none;
box-shadow: none;
}
HTML
<input type="checkbox" id="cbLabel" class="form-control fix">
Sample: http://www.bootply.com/61qJqP5whr