In vuetify, <v-alert /> component has a text variant.
I'd like to apply it to my v-expansion-panel component, how can I do that?
<v-alert type="warning" text>
My alert info
</v-alert>
<v-expansion-panels >
<v-expansion-panel>
<v-expansion-panel-header color="warning" text>
<v-icon>mdi-alert</v-icon>
My expansion panel info
</v-expansion-panel-header>
<v-expansion-panel-content color="warning" text>
Content
</v-expansion-panel-content>
</v-expansion-panel>
</v-expansion-panels>
You can use background and text variant for styling within your application through a class, e.g. <div class="red"> or <span class="red--text">
refrence: Vuetify classes
new Vue({
el: '#app',
vuetify: new Vuetify(),
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.24.0/axios.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/#mdi/font#4.x/css/materialdesignicons.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/vuetify#2.x/dist/vuetify.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/vue#2.x/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify#2.x/dist/vuetify.js"></script>
<div id="app">
<v-app id="inspire">
<v-app>
<v-container>
<v-card elevation="1">
<v-expansion-panels >
<v-expansion-panel>
<v-expansion-panel-header class="orange lighten-5 orange--text" text>
<v-icon class="orange lighten-5 orange--text">mdi-alert</v-icon>
My expansion panel info
</v-expansion-panel-header>
<v-expansion-panel-content class="orange lighten-5 orange--text" text>
Content
</v-expansion-panel-content>
</v-expansion-panel>
</v-expansion-panels>
</v-card>
</v-container>
</v-app>
</div>
</div>
Related
I need some help in debugging a problem that is driving me nuts.
I have a laravel project with Vue3 as the frontend, using InertiaJS for connecting to the backend.
The folder structure is as follows
|_resources
|__js
|___Pages
|____AddContent
|_____Index.vue
|____Home
|_____Index.vue
|___Shared
|____Footer.vue
My Footer.vue (below) is working fine when called at Home/Index.vue
<div class="m-6 text-ternary-dark dark:text-ternary-light text-lg">
<div class="flex justify-between">
<Link href="/">
<i data-feather="home" class="ml-0 sm:ml-1 mr-2 sm:mr-3 w-5 sm:w-6"></i>
</Link>
<Link href="/market"><i data-feather="package" class="ml-0 sm:ml-1 mr-2 sm:mr-3 w-5 sm:w-6"></i></Link>
<Link href="/add"><i data-feather="plus-square" class="ml-0 sm:ml-1 mr-2 sm:mr-3 w-5 sm:w-6"></i></Link>
<Link href="/message"><i data-feather="send" class="ml-0 sm:ml-1 mr-2 sm:mr-3 w-5 sm:w-6"></i></Link>
<Link href="/profile"><i data-feather="user" class="ml-0 sm:ml-1 mr-2 sm:mr-3 w-5 sm:w-6"></i></Link>
</div>
</div>
</template>
<script>
import { Link } from "#inertiajs/inertia-vue3";
import feather from 'feather-icons';
export default {
components: {
Link,
},
};
</script>
Home.vue
<template>
<Header />
<div class="mb-4 text-ternary-dark dark:text-ternary-light text-lg">
<!-- The top section of homepage, reserved for hastags, news, and other features -->
<div>
<p>Top Component</p>
</div>
<!-- The rest of the homepage contents -->
<div>
<p>The Rest</p>
<div class="wrapper" v-if="blogs.length">
<div class="blog" v-for="blog in blogs" :key="blog">
<Link href="blogs/{id}/show" method="get" :data="{id: blog.id}">
<!-- <img v-bind:src="blog.image"/> -->
<small>posted by: {{ blog.id }}</small>
{{ blog.title }}
</Link>
</div>
</div>
</div>
</div>
<Footer />
</template>
<script>
import { Link } from '#inertiajs/inertia-vue3'
import Header from "../../Shared/Header.vue";
import Footer from "../../Shared/Footer.vue";
export default {
components: {
Header,
Footer,
Link
},
props: {
blogs: Object,
},
};
</script>
Here's the look of Home/Index.vue:
Then, the problem is, at the AddContent/Index.vue (below), I have the same code as the Home/Index.vue to import the footer.
<template>
<div class="mb-4 text-ternary-dark dark:text-ternary-light text-lg">
<form #submit.prevent="submit">
<label for="title">Title: </label>
<input type="text" id="title" v-model="form.title" placeholder="type something" class="rounded-full py-1 px-4"/>
<label for="body">Body: </label>
<input type="text" id="body" v-model="form.body" placeholder="type something" class="rounded-full py-1 px-4"/>
<button type="submit">Submit</button>
</form>
</div>
<Footer />
</template>
<script>
import { reactive } from "vue";
import { Inertia } from "#inertiajs/inertia";
import Footer from "../../Shared/Footer.vue";
export default {
components: {
Footer,
},
setup() {
const form = reactive({
title: null,
body: null,
});
function submit() {
Inertia.post("/", form);
}
return { form, submit };
},
};
</script>
<style scoped>
* {
outline: 1px solid red;
}
</style>
However, in my AddContent/index.vue, the footer bar just does not show up.
I have no idea what the heck is going on... as the red outline was wrapping the footer just fine but nothing from the footer passed to the AddContent page. Any hints on this would be greatly appreciated!
#ShayaUlman suggestion resolved the issue by changing the component into a layout https://inertiajs.com/pages.
For future reference, if your layout does not appear, try to remove or comment out the contents, re-start npm and re-add the contents. This appears to resolve the issue afterwards.
I want to add datetimepicker into my in my laravel 8 app with jquery 3.4/bootstrap 4.6 , but adding m
#section('headerscripts')
<link rel="stylesheet" href="{{admin_assets}}/css/jquery.fancybox.min.css"/>
<link rel="stylesheet" href="{{admin_assets}}/css/selectize.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" integrity="sha256-yMjaV542P+q1RnH6XByCPDfUFhmOafWbeLPmqKh11zo=" crossorigin="anonymous" />
{{-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">--}}
#stop
...
#section('footerscripts')
<script src="{{admin_assets}}/js/jquery.fancybox.min.js"></script>
<script src="{!!admin_assets!!}/js/pages/crud/forms/widgets/select2.js"></script>
<script src="{!!admin_assets!!}/js/pages/crud/forms/editors/summernote.js"></script>
<script src="{!!admin_assets!!}/js/pages/crud/forms/editors/AutoNumeric/AutoNumeric.js"></script>
<script src="{{admin_assets}}/js/jquery.caret.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js" integrity="sha256-5YmaxAwMjIpMrVlK84Y/+NjCpKnFYa8bWWBbUHSBGfU=" crossorigin="anonymous"></script>
...
$(document).ready(function () {
$('#dob').datetimepicker();
...
<div class="form-group">
<label for="user_id">
User <span class="text-danger">*</span>
</label>
<div class="input-group" id="dob">
<input type="text" class="form-control" placeholder="Date Of Birth">
<div class="input-group-addon">
<span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
</div>
</div>
But having datetimepicker on form(without any errors in browser's console)
it looks like icons are not supported : https://prnt.sc/1r10yxn
If to uncomment line in
#section('headerscripts')
section
{{-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">--}}
all icons of datetimepicker are shown ok, but I have some design breaks on my page.
I think that is a not goodidea to add 3.3.7/css/bootstrap.min.css into my bootstrap 4.6 for icons support.
If there is a way to fix it correctly?
Maybe are some some bettre datetimepicker libraries for my app?
Thanks!
It's not wise to use both version of Bootstrap. Some css elements may be changed or deprecated that cause your design broken.
I suggest using daterangepicker at here
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
<input id="my-calendar" type="text" name="date">
<i class="fa fa-calendar" aria-hidden="true"></i> <!-- Using Font Awesome -->
<script src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<script>
$('#my-calendar').daterangepicker({
"singleDatePicker": true,
"showDropdowns": true,
locale: { format: 'DD/MM/YYYY' },
});
</script>
I'm using vuetify and have this:
<v-container
class="d-flex justify-center mb-6"
:color="$vuetify.theme.dark ? 'grey darken-3' : 'grey lighten-4'"
flat
tile
>
<v-row justify="center">
<v-col>
<h1>This is an about page</h1>
</v-col>
</v-row>
<v-row justify="center">
<v-col>
<p>
The logo is licensed with the
<a href="https://creativecommons.org/licenses/by-nc/3.0/" target="_blank">
Creative Commons License</a
>
and is provided by
<a href="https://www.iconfinder.com/laurareen/" target="_blank">
iconfinder</a
>
</p>
</v-col>
</v-row>
</v-container>
It renders like this:
How can I make this render 2 rows instead???
I tried adding sm="12" to each column but same thing.
to have a better understanding about vuetify's grid system you can read the doc here.
but in short according to the doc:
v-container provides the ability to center and horizontally pad your site’s contents.
you don't need to set class="d-flex justify-center" on this element.
also according to v-container API page, this component does not accept flat and tile as prop.
remove these props and classes and you should be good.
check the demo below:
Vue.config.productionTip = false;
new Vue({
el: '#app',
vuetify: new Vuetify(),
})
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/vuetify#2.x/dist/vuetify.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/vue#2.x/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify#2.x/dist/vuetify.js"></script>
<div id="app">
<v-app>
<v-main>
<v-container>
<v-row justify="center">
<v-col>
<h1>This is an about page</h1>
</v-col>
</v-row>
<v-row justify="center">
<v-col>
<p>
The logo is licensed with the
<a href="https://creativecommons.org/licenses/by-nc/3.0/" target="_blank">
Creative Commons License</a>
and is provided by
<a href="https://www.iconfinder.com/laurareen/" target="_blank">
iconfinder</a>
</p>
</v-col>
</v-row>
</v-container>
</v-main>
</v-app>
</div>
I need help with creating a text-field, which has an icon inside with a tooltip attached to the icon.
My code:
<v-text-field
v-model="url">
<span slot="label">Url
<v-tooltip bottom>
<v-icon
slot="activator"
color="primary"
dark
>home</v-icon>
<span>Tooltip</span>
</v-tooltip>
</span>
</v-text-field>
Any ideas?
Thanks.
Since v1.1 we can use append (and prepend) slots for this:
<v-text-field v-model="url" label="URL">
<v-tooltip slot="append" bottom>
<v-icon slot="activator" color="primary" dark>home</v-icon>
<span>Tooltip</span>
</v-tooltip>
</v-text-field>
Codepen
In vuetify version 2.0.7 I am using below code. It works perfectly.
<v-tooltip bottom>
<template #activator="{ on }">
<v-icon color="red" class="mr-1" v-on="on">fab fa-youtube</v-icon>
</template>
<span>Tooltip</span>
</v-tooltip>
displaying tooltip when hovering over the icon inside v-text-field
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/#mdi/font#4.x/css/materialdesignicons.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/vuetify#2.x/dist/vuetify.min.css" rel="stylesheet">
<div id="app">
<v-app>
<v-content>
<v-container>
<v-text-field v-model="url" label="URL">
<v-tooltip slot="append">
<template v-slot:activator="{ on }">
<v-icon v-on="on" color="primary" dark>
mdi-home
</v-icon>
</template>
<span>Tooltip</span>
</v-tooltip>
</v-text-field>
</v-container>
</v-content>
</v-app>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue#2.x/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify#2.x/dist/vuetify.js"></script>
<script>
new Vue({
el: '#app',
vuetify: new Vuetify(),
data: {
url: 'https://stackoverflow.com/'
}
})
</script>
I have downloaded a JQuery-plugin for a searchable drop down list. Here is the source
I fill the list using D3.js. It works well for few elements, but when I want to load all elements (around 1200) the design is crashed and the list is displayed in the top so that I can't see the items and there is no scroll-bar.
Here how it looks like when I load the whole elements:
Here we can see from the developer tool in the browser that the data is loaded correctly:
The console shows these violations:
Here is my D3.js code:
d3.csv("Data/Symbols.csv").get(function (error, Symbolsdata) {
if (error) throw error;
d3.select("#my-select").selectAll(".option")
.data(d3.map(Symbolsdata, function (d) { return d.CurrSymbol; }).keys())
.enter().append("option")
.text(function (d) { return d; })
.attr("value", function (d) { return d; });
});
Html script:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> Crypto Trading Project</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/sol.css">
</head>
<body>
<header>
<div class="collapse bg-light" id="navbarHeader">
<div class="container">
<div class="row">
<div class="col-sm-6 py-4">
<select id="my-select" name="Cryptos" multiple="multiple"></select>
</div>
<div class="col-sm-6 py-4">
From <input type="text" class="mt10px input" id="J-demo-04" value=""> To <input type="text" class="mt10px input" id="J-demo-05" value="">
<button type="button" id="applyFilterButton" class="btn btn-dark">Apply</button>
</div>
<div class="col-sm-3 py-4">
</div>
</div>
</div>
</div>
<div class="navbar navbar-dark bg-dark box-shadow">
<div class="container d-flex justify-content-between">
Cryptos VA
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarHeader" aria-controls="navbarHeader" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</div>
</header>
<main role="main">
</main>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/date-time-picker.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/sol.js"></script>
<script type="text/javascript" src="js/d3.js"></script>
<script type="text/javascript" src="js/loadsol.js"></script>
<script type="text/javascript">
$(function() {
// initialize sol
$('#my-select').searchableOptionList({
showSelectAll: true
});
//dateTimePicker
$('#J-demo-04').dateTimePicker({
limitMax: $('#J-demo-05')
});
$('#J-demo-05').dateTimePicker({
limitMin: $('#J-demo-04')
});
});
</script>
</body>
</html>
How can I have it work?
I could finally figure it out. The idea is simply to fix the height of the active container and add a scroll bar. So I add in the sol.css file to the .sol-container.sol-active .sol-selection-container class these two css attributes:
height: 300px;
overflow-y: auto;