imagine we have two components, Modal.vue which is lets say a component that is used to display modal content (uses slots to take in JSX), and Component.vue which is the one with content we wish to test with vitest/jest:
//Modal.vue
<template>
<div>
<slot name="header" />
<slot />
<slot name="footer" />
</div>
</template>
//component.vue
<template>
<Modal>
<template #header>
<h1>Hello world</h1>
</template>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<template #footer>
<button>Great</button>
</template>
</Modal>
</template>
The problem is that I cannot reach the wrapper HTML within my test, as it will console log something similar to this:
// snipet from the test file
...
it('should mount Component.vue', () => {
console.log(wrapper.html())
expect(wrapper).toBeTruthy()
})
...
The console.log in the test will result to this:
<div>
<!---->
<!--teleport start-->
<!--teleport end-->
<!---->
</div>
Question is: How can I access the wrapper HTML that is define in 'Component.vue'??
I'm using v-dialog from vuetify. When I set it to persistent, there is a bounce effect when the user clicks outside the dialog. I would like to manually create that effect when some random button is clicked. How is that possible?
Dialog has a method called animateClick, you can call the same.
CODEPEN
<v-dialog ref="dialog" v-model="dialog" width="400px">
<v-card >
<v-card-title
class="headline grey lighten-2"
primary-title
>
Privacy Policy
</v-card-title>
<v-card-text>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
</v-card-text>
<v-divider></v-divider>
<v-card-action>
<v-btn #click="doAnimation">Animate Me</v-btn>
</v-card-action>
</v-card>
</v-dialog>
....
....
<script>
export default{
...
methods: {
methods:{
doAnimation(){
this.$refs.dialog.animateClick()
}
}
}
}
</script>
I'm trying to use vuetify expansion-panels in Vue.js.
But you can see that arrow image doesn't show in this picture.
Even I tried to delete :expand-icon="images.arrow" it apears string "keyboard-arrow-down"
Here's my code.
Any ideas? thanks.
images: {
check: require('../assets/check.png'),
uncheck: require('../assets/uncheck.png'),
memo: require('../assets/memo.png'),
thumbsUp: require('../assets/thumbs-up.svg'),
chrome: require('../assets/chrome.svg'),
arrow: require('../assets/arrow.svg'),
},
...
<v-expansion-panel>
<v-expansion-panel-content :expand-icon="images.arrow" v-for="(item,i) in 5" :key="i">
<div slot="header">Item</div>
<v-card>
<v-card-text>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat.</v-card-text>
</v-card>
</v-expansion-panel-content>
</v-expansion-panel>
Using Lucee, how can I add dynamic page numbers into a pdf file using the cfdocument scope variables?
cfdocument.totalsectionpagecount
cfdocument.currentsectionpagenumber
cfdocument.currentpagenumber
cfdocument.totalpagecount
I tried the code below. It generates the pdf, but the headers and footers are empty, instead of displaying page numbers, ie. "X of Y".
<cfdocument format="pdf">
<cfdocumentitem type="header" evalatprint="true">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<strong><tr><td align="right"><cfoutput>#cfdocument.currentsectionpagenumber# of</strong>
<strong>#cfdocument.totalsectionpagecount#</cfoutput></td></tr></strong>
</table>
</cfdocumentitem>
<cfdocumentitem type="footer" evalatprint="true">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<strong><tr><td align="center"><cfoutput>#cfdocument.currentpagenumber# of</strong>
<strong>#cfdocument.totalpagecount#</cfoutput></td></tr></strong>
</table>
</cfdocumentitem>
<cfdocumentsection>
<h1>Section 1</h1>
<cfloop from=1 to=50 index="i">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<p>
</cfloop>
</cfdocumentsection>
</cfdocument>
I've used the previous version of Bootstrap and had no problem with this, but I'm trying with 3.0 and my classes just lie on top of each other rather than floating from keft to right, what am I doing wrong?
I followed this tutorial http://www.w3resource.com/twitter-bootstrap/grid-system-tutorial.php and even copied it across as it was driving me insane, but it didn't even work.
This is my current HTML
<!DOCTYPE html>
<html>
<head>
<title>Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="./css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="./css/global.css" rel="stylesheet" media="screen">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="row">
<nav class="navbar" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#emproium-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Branding</a>
</div>
<div class="collapse navbar-collapse" id="emproium-navbar-collapse">
<ul class="nav navbar-nav">
<li>Core Collection</li>
<li>Antiques</li>
<li>Art</li>
<li>Furniture</li>
<li class="dropdown">
Home Decor <b class="caret"></b>
<ul class="dropdown-menu">
<li>Rugs</li>
<li>Throws</li>
<li>Quilts</li>
<li>Accent Pillows</li>
<li class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li>Separated link</li>
<li>One more separated link</li>
</ul>
</li>
<li>Cart</li>
<li>Contact</li>
</ul>
</div><!-- /.navbar-collapse -->
</nav>
<div class="banner span12">
</div>
<div class="tile span4"><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam cursus. Morbi ut mi. Nullam enim leo, egestas id, condimentum at, laoreet mattis, massa. Sed eleifend nonummy diam. Praesent mauris ante, elementum et, bibendum at, posuere sit amet, nibh. Duis tincidunt lectus quis dui viverra vestibulum. Suspendisse vulputate aliquam dui. Nulla elementum dui ut augue. Aliquam vehicula mi at mauris. Maecenas placerat, nisl at consequat rhoncus, sem nunc gravida justo, quis eleifend arcu velit quis lacus. Morbi magna magna, tincidunt a, mattis non, imperdiet vitae, tellus. Sed odio est, auctor ac, sollicitudin in, consequat vitae, orci. Fusce id felis. Vivamus sollicitudin metus eget eros.</p></div>
<div class="tile span4"><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam cursus. Morbi ut mi. Nullam enim leo, egestas id, condimentum at, laoreet mattis, massa. Sed eleifend nonummy diam. Praesent mauris ante, elementum et, bibendum at, posuere sit amet, nibh. Duis tincidunt lectus quis dui viverra vestibulum. Suspendisse vulputate aliquam dui. Nulla elementum dui ut augue. Aliquam vehicula mi at mauris. Maecenas placerat, nisl at consequat rhoncus, sem nunc gravida justo, quis eleifend arcu velit quis lacus. Morbi magna magna, tincidunt a, mattis non, imperdiet vitae, tellus. Sed odio est, auctor ac, sollicitudin in, consequat vitae, orci. Fusce id felis. Vivamus sollicitudin metus eget eros.</p></div>
<div class="tile span4"><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam cursus. Morbi ut mi. Nullam enim leo, egestas id, condimentum at, laoreet mattis, massa. Sed eleifend nonummy diam. Praesent mauris ante, elementum et, bibendum at, posuere sit amet, nibh. Duis tincidunt lectus quis dui viverra vestibulum. Suspendisse vulputate aliquam dui. Nulla elementum dui ut augue. Aliquam vehicula mi at mauris. Maecenas placerat, nisl at consequat rhoncus, sem nunc gravida justo, quis eleifend arcu velit quis lacus. Morbi magna magna, tincidunt a, mattis non, imperdiet vitae, tellus. Sed odio est, auctor ac, sollicitudin in, consequat vitae, orci. Fusce id felis. Vivamus sollicitudin metus eget eros.</p></div>
</div><!-- end of row-->
</div><!-- container -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://code.jquery.com/jquery.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="./js/bootstrap.min.js"></script>
That's my full code, if anyone could point out what is wrong here i'd be grateful. I'm sure it's pretty simple.
Jonny
span* have been replaced by the col-xs|sm|md|lg-* naming convention. Just looking at your code, that is probably your main issue in migrating to BS3. See http://getbootstrap.com/getting-started/#migration for a full list of what has changed.