Commit 72a5f0d8 authored by Le Dinh Trung's avatar Le Dinh Trung

add change

parents b57d5131 ace6e2bc
...@@ -70,7 +70,6 @@ ...@@ -70,7 +70,6 @@
</v-icon> </v-icon>
</v-col> </v-col>
</v-dialog> </v-dialog>
</v-row>
</template> </template>
<script> <script>
......
...@@ -3,7 +3,11 @@ ...@@ -3,7 +3,11 @@
<path d="M24.7203 29.704H41.1008C41.6211 29.7041 42.1322 29.5669 42.5828 29.3061C43.0334 29.0454 43.4075 28.6704 43.6675 28.2188C43.9275 27.7672 44.0643 27.2549 44.0641 26.7335C44.0639 26.2121 43.9266 25.6999 43.6662 25.2485L32.6655 6.15312C32.4055 5.70162 32.0315 5.32667 31.581 5.06598C31.1305 4.8053 30.6195 4.66805 30.0994 4.66805C29.5792 4.66805 29.0682 4.8053 28.6177 5.06598C28.1672 5.32667 27.7932 5.70162 27.5332 6.15312L24.7203 11.039L19.2208 1.48485C18.9606 1.03338 18.5864 0.658493 18.1358 0.397853C17.6852 0.137213 17.1741 0 16.6538 0C16.1336 0 15.6225 0.137213 15.1719 0.397853C14.7213 0.658493 14.3471 1.03338 14.0868 1.48485L0.397874 25.2485C0.137452 25.6999 0.000226653 26.2121 2.8053e-07 26.7335C-0.000226092 27.2549 0.136554 27.7672 0.396584 28.2188C0.656614 28.6704 1.03072 29.0454 1.48129 29.3061C1.93185 29.5669 2.44298 29.7041 2.96326 29.704H13.2456C17.3195 29.704 20.3239 27.9106 22.3912 24.4118L27.4102 15.7008L30.0986 11.039L38.1667 25.0422H27.4102L24.7203 29.704ZM13.0779 25.0374L5.9022 25.0358L16.6586 6.36589L22.0257 15.7008L18.4322 21.9401C17.0593 24.2103 15.4996 25.0374 13.0779 25.0374Z" fill="#00DC82" /> <path d="M24.7203 29.704H41.1008C41.6211 29.7041 42.1322 29.5669 42.5828 29.3061C43.0334 29.0454 43.4075 28.6704 43.6675 28.2188C43.9275 27.7672 44.0643 27.2549 44.0641 26.7335C44.0639 26.2121 43.9266 25.6999 43.6662 25.2485L32.6655 6.15312C32.4055 5.70162 32.0315 5.32667 31.581 5.06598C31.1305 4.8053 30.6195 4.66805 30.0994 4.66805C29.5792 4.66805 29.0682 4.8053 28.6177 5.06598C28.1672 5.32667 27.7932 5.70162 27.5332 6.15312L24.7203 11.039L19.2208 1.48485C18.9606 1.03338 18.5864 0.658493 18.1358 0.397853C17.6852 0.137213 17.1741 0 16.6538 0C16.1336 0 15.6225 0.137213 15.1719 0.397853C14.7213 0.658493 14.3471 1.03338 14.0868 1.48485L0.397874 25.2485C0.137452 25.6999 0.000226653 26.2121 2.8053e-07 26.7335C-0.000226092 27.2549 0.136554 27.7672 0.396584 28.2188C0.656614 28.6704 1.03072 29.0454 1.48129 29.3061C1.93185 29.5669 2.44298 29.7041 2.96326 29.704H13.2456C17.3195 29.704 20.3239 27.9106 22.3912 24.4118L27.4102 15.7008L30.0986 11.039L38.1667 25.0422H27.4102L24.7203 29.704ZM13.0779 25.0374L5.9022 25.0358L16.6586 6.36589L22.0257 15.7008L18.4322 21.9401C17.0593 24.2103 15.4996 25.0374 13.0779 25.0374Z" fill="#00DC82" />
</svg> </svg>
</template> </template>
<script>
export default {
name: 'NuxtLogo'
}
</script>
<style> <style>
.nuxt-logo { .nuxt-logo {
height: 180px; height: 180px;
......
<template> <template>
<v-row justify="center">
<v-dialog <v-dialog
v-model="dialog" v-model="dialog"
width="450px" width="450px"
...@@ -90,7 +89,6 @@ ...@@ -90,7 +89,6 @@
</v-icon> </v-icon>
</v-col> </v-col>
</v-dialog> </v-dialog>
</v-row>
</template> </template>
<script> <script>
......
<template>
<ul class="dropdown-item">
<TreeNode v-for="(item, i) in categories" :key="i" :node="item" />
</ul>
</template>
<script>
import TreeNode from '~/components/user/TreeNode.vue'
export default {
name: 'CategoryTree',
components: {
TreeNode
},
props: {
categories: Object
},
data: () => ({
selectedItem: 1
})
}
</script>
<style>
.dropdown-item {
box-shadow: 0 2px 35px rgba(0,0,0,0.1);
}
li {
list-style: none;
line-height: 2rem;
padding: 0 1.5rem;
}
li span {
font-size: 15px;
}
li > ul {
position: absolute;
left: 100%;
box-shadow: 0 2px 35px rgba(0,0,0,0.1);
transition: transform 0.2s ease-out;
}
li:hover > ul {
transform: translate3d(0,0,0);
}
ul.dropdown-item {
padding: 10px 0;
}
</style>
<template> <template>
<v-container> <v-container class="navbar-container">
<div class="navbar d-flex justify-space-between "> <div class="navbar">
<div class="d-flex justify-space-between col-md-7"> <div class="navbar-left">
<div> <div class="navbar-item">
<span> <span>
Home Home
</span> </span>
</div> </div>
<div class="dropdown"> <div class="navbar-item dropdown">
<span> <span>
Products Products
</span> </span>
<v-icon>mdi-chevron-down</v-icon> <v-icon>mdi-chevron-down</v-icon>
<div class="dropdown-content elevation-10" :elevation="2"> <div class="dropdown-content" :elevation="2">
<v-treeview <CategoryTree :categories="categories" />
:active.sync="active"
rounded
dense
hoverable
activatable
:items="categories"
@update:active="setCategory(item)"
>
<template #label="{ item }">
<nuxt-link :to="`/home-page/categories/${item.id}`" tag="div">
{{ item.name }}
</nuxt-link>
</template>
</v-treeview>
</div> </div>
</div> </div>
<div> <div class="navbar-item">
<span> <span>
Pages Pages
</span> </span>
</div> </div>
<div> <div class="navbar-item">
<span> <span>
Blogs Blogs
</span> </span>
</div> </div>
<div> <div class="navbar-item">
<span> <span>
About About
</span> </span>
</div> </div>
</div> </div>
<div class="none-tag align-center "> <div class="d-flex align-center none-tag">
<v-icon>mdi-tag</v-icon> <v-icon>mdi-tag</v-icon>
<span class="mx-2"> <span class="mx-2">
Special offer! Special offer!
...@@ -62,8 +48,13 @@ ...@@ -62,8 +48,13 @@
<script> <script>
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import CategoryTree from '~/components/user/CategoryTree.vue'
export default { export default {
name: 'NavBar', name: 'NavBar',
components: {
CategoryTree
},
data: () => ({ data: () => ({
active: [], active: [],
open: [], open: [],
...@@ -111,6 +102,14 @@ export default { ...@@ -111,6 +102,14 @@ export default {
</script> </script>
<style scoped> <style scoped>
.navbar-container {
padding-left: 0;
padding-right: 0;
}
.navbar {
display: flex;
justify-content: space-between;
}
.navbar span { .navbar span {
font-weight: bold; font-weight: bold;
cursor: pointer; cursor: pointer;
...@@ -119,10 +118,21 @@ export default { ...@@ -119,10 +118,21 @@ export default {
.navbar span:hover { .navbar span:hover {
color: #26c; color: #26c;
} }
.navbar-left {
width: 50%;
display: flex;
justify-content: space-between;
padding-left: 0;
padding-right: 0;
}
.dropdown { .dropdown {
position: relative; position: relative;
} }
.dropdown span {
font-size: 15px;
}
.dropdown:hover .dropdown-content { .dropdown:hover .dropdown-content {
transition: 0.3s;
display: block; display: block;
} }
.dropdown-content { .dropdown-content {
...@@ -130,8 +140,7 @@ export default { ...@@ -130,8 +140,7 @@ export default {
position: absolute; position: absolute;
z-index: 1; z-index: 1;
background-color: #ffffff; background-color: #ffffff;
min-width: 350px; min-width: 250px;
/* margin-top: 20px; */
} }
.none-tag { .none-tag {
display: flex; display: flex;
......
<template>
<li class="dropdown">
<nuxt-link class="label" :to="`/home-page/categories/${node.id}`" tag="span">
{{ node.name }}
</nuxt-link>
<ul v-if="node.children && node.children.length" class="dropdown-item">
<TreeNode v-for="child in node.children" :key="child.id" :node="child" />
</ul>
</li>
</template>
<script>
export default {
name: 'TreeNode',
props: {
node: Object
}
}
</script>
<style scoped>
.dropdown {
position: relative;
cursor: pointer;
}
.dropdown-item {
display: none;
}
.dropdown:hover > .dropdown-item {
display: block;
}
.dropdown-item {
display: none;
position: absolute;
z-index: 1;
background-color: #ffffff;
min-width: 250px;
top: -10px;
}
li:hover > span {
color: #2266cc;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment