diff --git a/package.json b/package.json index 84bc63c4..3669a297 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "echarts": "4.1.0", "element-ui": "2.4.10", "file-saver": "1.3.8", + "fuse.js": "3.4.2", "js-cookie": "2.2.0", "jsonlint": "1.6.3", "jszip": "3.1.5", diff --git a/src/components/HeaderSearch/index.vue b/src/components/HeaderSearch/index.vue new file mode 100644 index 00000000..ab0d556a --- /dev/null +++ b/src/components/HeaderSearch/index.vue @@ -0,0 +1,187 @@ + + + + + diff --git a/src/icons/svg/search.svg b/src/icons/svg/search.svg new file mode 100644 index 00000000..84233dda --- /dev/null +++ b/src/icons/svg/search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue index 4f94b055..65012628 100644 --- a/src/views/layout/components/Navbar.vue +++ b/src/views/layout/components/Navbar.vue @@ -6,24 +6,26 @@
- +
@@ -57,6 +59,7 @@ import Screenfull from '@/components/Screenfull' import SizeSelect from '@/components/SizeSelect' import LangSelect from '@/components/LangSelect' import ThemePicker from '@/components/ThemePicker' +import Search from '@/components/HeaderSearch' export default { components: { @@ -66,7 +69,8 @@ export default { Screenfull, SizeSelect, LangSelect, - ThemePicker + ThemePicker, + Search }, computed: { ...mapGetters([ @@ -100,6 +104,7 @@ export default { float: left; cursor: pointer; transition: background .3s; + &:hover { background: rgba(0, 0, 0, .025) } @@ -124,26 +129,35 @@ export default { } .right-menu-item { - cursor: pointer; display: inline-block; padding: 0 8px; height: 100%; - font-size: 20px; + font-size: 18px; color: #5a5e66; vertical-align: text-bottom; - transition: background .3s; - &:hover { - background: rgba(0, 0, 0, .025) + + &.hover-effect { + cursor: pointer; + transition: background .3s; + + &:hover { + background: rgba(0, 0, 0, .025) + } } } .avatar-container { margin-right: 30px; + .avatar-wrapper { margin-top: 5px; position: relative; +<<<<<<< HEAD line-height: initial; cursor: pointer; +======= + +>>>>>>> c71f311... feature[Navbar]: add header-search component (#1591) .user-avatar { width: 40px; height: 40px;