I'm new to angular flex layout, I was reading the documentation and
I wanted to know if nesting container elements inside children element \ nesting container elements inside another container element is allowed, For example:
nesting container elements inside children elements:
<div fxLayout="column">
<div fxFlex="100%"> column item A </div>
<div fxFlex="100%"> column item B
<div fxLayout="row">
<div fxFlex="100%">row item A </div>
<div fxFlex="100%">row item B </div>
</div>
</div>
</div>
nesting container elements inside another container elements:
<div fxLayout="column">
<div fxFlex="100%"> column item A </div>
<div fxFlex="100%"> column item B </div>
<div fxLayout="row">
<div fxFlex="100%">row item A </div>
<div fxFlex="100%">row item B </div>
</div>
</div>
Yes, that's working!.
Here is the Online Demo
<div fxLayout="column" fxLayoutAlign="space-evenly center">
<div>This is Column A</div>
<div>This is Column B</div>
<div>This is Column C</div>
<div fxLayout="row" fxLayoutAlign="space-evenly center">
<div >This is Row item A under Column </div>
<div>This is Row item B under Column</div>
<div fxLayout="column" fxLayoutAlign="space-evenly center">
<div>This is Column A under Row</div>
<div>This is Column B under Row</div>
</div>
</div>
</div>
Here First fxLayout="column" will be treated as root and under this root, if you add Second fxLayout="row" then it will be inherited the root component and follow the rule of First fxLayout="column" with fxLayoutAlign="space-evenly center" and further you go down the logic will be same as above and its continue, how much you deep dig into it.
Related
I created a recipe website, you can find it here https://hungry-vegetarian.com/.
The tab on the index page is a vue instance. I'm trying to create a search bar that is also a vue instance.
The problem occurs when I try to display searched recipes on the index page. It just shows the search result on top of the search bar.
Ideally, only searched recipes should appear on the tab just like they are now but without any indications on top of the tab like Breakfast, Salad, Bakery, etc.
I don't know how to make two objects work together. For now, they work separately without communicating with each other.
SEARCH
<div id="search">
<div class="main-search">
<h1 class="search-question">What are you in the mood for?</h1>
<div class="search-box">
<input type="text" v-model="searchQuery" class="input-search" placeholder="Bread">
<button class="btn-search"><i class="fa fa-search"></i></button>
</div>
</div>
<div class="container">
<div class="recipe" v-for="post in filteredList">
<div v-if="searchQuery">
<a v-bind:href="post.url" class="recipe-card__card-link" target="_blank">
<img v-bind:src="post.image" alt="" class="recipe-card__image"/>
<div class="recipe-card__text-wrapper">
<h2 class="recipe-card__title">{{post.name}}</h2>
<div class="recipe-card__details-wrapper">
<p class="recipe-card__excerpt">{{post.body}}</p>
<a v-bind:href="post.url" class="recipe-card__read-more">Read more <i class="fa fa-arrow-right"></i></a>
</div>
</div>
</a>
</div>
</div>
</div>
</div>
</div>
tab
<main id="tab">
<header>
<nav>
<ul>
<div id="arrow">
<span></span>
<span></span>
<span></span>
</div>
<li v-for="(tab, tabName) in tabs" :key="tabName">
<button class="tab" #click="setTabActive(tabName)" :class="{'active': tabName === activeTab}">
<span class="tab-copy">{{ tabName }}</span>
<span class="tab-background">
</span>
</button>
</li>
</ul>
</nav>
</header>
<article>
<div class="container">
<transition name="fade" mode="out-in" appear :duration="500">
<tab-content v-for="(tabContent, t) in tabs" :data="tabContent" :key="'content'+t" v-if="t === activeTab" inline-template>
<div class="content-wrapper">
<div class="recipes" v-for="(recipe, i) in data.recipes" :key="i">
<a v-bind:href="recipe.url" class="recipe-card__card-link"></a>
<img :src="recipe.image" alt="" class="recipe-card__image">
<div class="recipe-card__text-wrapper">
<h2 class="recipe-card__title">{{recipe.name}}</h2>
<div class="recipe-card__details-wrapper">
<p class="recipe-card__excerpt">{{recipe.body}}</p>
<a v-bind:href="recipe.url" class="recipe-card__read-more">Read more <i class="fa fa-arrow-right"></i></a>
</div>
</div>
</div>
</div>
</tab-content>
</transition>
</div>
</article>
</main>
I tried to combine instances search and tab into just one instance tab, but it always gives me a Vue warning:
[Vue warn]: Property or method "searchQuery" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.
Also, I feel like I can have just the wrong approach to this problem I am trying to solve. Please, any suggestions are welcome. I am stuck.
I display an array posts:[], which contain a JSON object. Everything is fine except that I can't display three columns in a row with Bootstrap. Even though I specified in the class="col-4". Here's my code.
<div class="" v-for="post of posts">
<div class="col-12 col-lg-4">
<router-link :to="'panneau/' + post['id_panneau']">
"...."
</router-link>
</div>
</div>
The v-for="..." property must be in the element you want to loop. In this case you are looping the first div not the one with the col-* class. Try remove the second div and add those classes to the first one.
<div class="col-12 col-lg-4" v-for="post of posts">
<router-link :to="'panneau/' + post['id_panneau']">
"...."
</router-link>
</div>
You can update your code as given below and check:
<div class="row">
<div class="col-12 col-lg-4" v-for="post of posts">
<router-link :to="'panneau/' + post['id_panneau']">
"...."
</router-link>
</div>
</div>
I'm using selenium and I want to click a child element with 2 as value.
This is the full code:
<div class="dialer-keypad">
<div class="dialpad-row">
<div class="key">
<div class="value">1</div>
<div class="letters"></div>
</div>
<div class="key">
<div class="value">2</div>
<div class="letters">ABC</div>
</div>
<div class="key">
<div class="value">3</div>
<div class="letters">DEF</div>
</div>
</div>
<div class="dialpad-row">
<div class="key">
<div class="value">4</div>
<div class="letters">GHI</div>
</div>
<div class="key">
<div class="value">5</div>
<div class="letters">JKL</div>
</div>
<div class="key">
<div class="value">6</div>
<div class="letters">MNO</div>
</div>
</div>
</div>
So my question is How can I click this element?
<div class="value">2</div>
You should be able do this quite succinctly with XPath:
//*[contains(#class, 'value') and text()='2']
Alternatively, assuming that the markup was static you could target the element using specific indices. For example:
.dialpad-row:first-child .key:nth-child(2) .value
Simply use xpath
//div[contains (#class,'value') and contains (text(),'2')]
I have following HTML code snippet:
<div class="pagging-box status-border status-border">
<div class="left-container">
<div>
<div class="clientid-hover">
<h4>AAB52</h4>
<div class="hover-title" style="display: none;">
<p>AAB52</p>
</div>
</div>
<div class="clientid-hover-state pl-info">
<h4>CO</h4>
</div>
<div class="client-name-hover">
<h4>Daniel-old Polar-old</h4>
</div>
<p class="contacting-client">Interview Partially Co..</p>
</div>
</div>
<div class="right-container">
<div class="start-session pull-right">
<a href="javascript:void(0)");" class="login-button">
<i class="fa fa-2x fa-play-circle continue-session"></i>
</a>
</div>
</div>
</div>
I want to locate the Anchor tag on the basis of <h4>AAB52</h4> text. I have tried to locate the same with siblings like following xpath
//div[h4[contains(. , "AAB56")]]/following-sibling::div[1]
(xpath is not correct as it is locating second one div immediate of AAB52 text )
following-sibling operates on the parent of the context node, so you first need walk up to the correct context node:
//h4[. = 'AAB52']/../../../following-sibling::div[1]/div/a
Alternatively you can use:
//div[./div/div/h4 = 'AAB52']/following-sibling::div[1]/div/a
I have created following scaffold:
<div class="row">
<div class="col-md-4">
first column
</div>
<div class="col-md-4">
second column
</div>
<div class="col-md-4">
third column
</div>
</div>
Every column has background with 1px border. I would like to add margin-right: 15px to every column bot if applied, third column goes lower to the second `row`.
How can I set 15px space between columns ?
Short of modifying the bootstrap CSS directly (which may cause you problems later on updating to subsequent versions) I would recommend you place your own custom container within your columns (say with the class .foo) with a css statement specifying how you want it to display. For example
<div class="row">
<div class="col-md-4">
<div class="foo">
first column
</div>
</div>
<div class="col-md-4">
<div class="foo">
second column
</div>
</div>
<div class="col-md-4">
<div class="foo">
third column
</div>
</div>
</div>
with the CSS;
.foo:not(:last-child) {
margin-right:15px;
}
Example : http://cdpn.io/eDBCJ