vue导航栏项目_适用于Vue项目的简单美观的导航栏

vue导航栏项目

导航栏 (vue-navigation-bar)

A simple, pretty navbar for your Vue projects. (A work in progress for a few more days maybe) .

适用于Vue项目的简单,漂亮的导航栏。 (也许正在进行几天的工作)。

vue-navigation-bar

安装 (Install)

# npm
npm i vue-navigation-bar

#yarn
yarn add vue-navigation-bar

Or you can include it through the browser at the bottom of your page along with the css:

或者,您可以通过页面底部的浏览器将其与CSS一起包括在内:

<!-- Please note if you're using the browser method you're going to want to adjust the version number as needed. The number given there is just the initial version. -->

<script src="https://unpkg.com/[email protected]/dist/vue-navigation-bar.min.js"></script>

<link rel="stylesheet" type="text/css" href="https://unpkg.com/[email protected]/dist/vue-navigation-bar.css">

关于 (About)

Often when starting a new project I like to get together the main foundation pieces first. A main part of that process is working on the main navbar.

通常,在开始一个新项目时,我喜欢先将主要的基础部件放在一起。 该过程的主要部分是在主导航栏上进行工作。

This component is meant to help with that process - it gives you a standard looking navigation bar for for your app that can be easily defined using JSON or a just an array of objects.

该组件旨在帮助您完成该过程-它为您的应用程序提供了标准外观的导航栏,可以使用JSON或仅由对象数组轻松定义。

vue-navigation-bar is meant to be used for the 80% of cases that exist when you need a standard navbar for your app/website. The layout has the brand-image anchored on the left side, and two slots for menu-options that push and pull based on designation.

当您的应用程序/网站需要标准导航栏时, vue-navigation-bar用于80%的情况。 布局的左侧有brand-image ,两个插槽用于menu-options ,可根据指定进行推拉。

I know there are lots of other styles that navbar's can be, for instance the brand-image could be in the middle - but this component won't be allowing you to do that - so if that's your thing then I would probably look to roll out something on your own, or fork this to apply to your needs if possible. That being said, the actual css here is very easy to override - I'm using BEM with SASS (.scss) and have the style skeleton posted below - so you should be able to style it quite nicely without issue. I've put a lot of time in placing sensible defaults that should work well against any style.

我知道导航栏可以有很多其他样式,例如brand-image可能在中间-但是此组件将不允许您这样做-因此,如果这是您的事,那么我可能会想您可以自己解决一些问题,或者在可能的情况下将其应用于您的需求。 话虽这么说,这里的实际css很容易被覆盖-我正在将BEMSASS ( .scss )一起使用,并在下面贴上样式框架-因此,您应该可以对它进行漂亮的样式设置而不会出现问题。 我花了很多时间来放置明智的默认值,该默认值应该适合任何样式。

The trade-off is that the initialization and

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Vue项目中,左侧导航栏通常是通过使用组件来实现的。根据引用[1]中的代码,可以看到在页面中使用了`<template>`标签来定义导航栏的结构。其中,`<el-aside>`标签用于显示一级菜单下的二级菜单,而`<el-main>`标签用于显示二级菜单对应的页面。在`<script>`标签中,通过引入`SideMenu`组件,并在`components`属性中注册该组件,可以实现导航栏的功能。同时,在`data`属性中定义了一个`lists`数组,用于存储菜单的数据。每个菜单项都包含一个`title`属性和一个`children`属性,`children`属性存储了二级菜单的数据。通过在模板中使用`SideMenu`组件,并将`lists`数组作为参数传递给该组件,可以动态生成导航菜单。[1] 如果需要使用动态数据构建导航菜单,可以参考引用[2]中的代码。在`action.js`文件中,通过配置获取动态树数据的请求路径,可以从后端获取动态数据。然后,在`LeftAside.vue`组件中,可以通过接口获取数据,并将数据传递给导航菜单组件,以构建动态导航菜单。[2] 另外,如果需要实现分页功能,可以参考引用[3]中的代码。在模板中使用`<el-pagination>`标签,通过设置相应的属性和事件来实现分页功能。可以设置`current-page`属性来指定当前页,`page-size`属性来设置每页显示的记录数,`total`属性来设置总记录数。通过监听`size-change`事件和`current-change`事件,可以在每页显示的记录数变化和当前页码变化时进行相应的处理。[3] 综上所述,通过使用组件和相应的属性、事件来实现左侧导航栏、动态导航菜单和分页功能,可以满足Vue项目中左侧导航栏的需求。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值