1.5.1 • Published 1 year ago

@wines/navbar v1.5.1

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

@wines/navbar

NavBar 导航栏

用于提供页面的导航能力。

在 page.json 中引入组件

{
  "navigationBarTitleText": "wux-navbar",
  "usingComponents": {
    "wux-navbar": "@wines/navbar",
    "wux-icon": "@wines/icon"
  }
}

示例

<view class="page">
	<view class="page__hd">
		<view class="page__title">NavBar</view>
		<view class="page__desc">导航栏</view>
	</view>
	<view class="page__bd">
		<view class="sub-title">Default</view>
		<wux-navbar
		 leftText="Back"
		 title="NavBar"
		 rightText="Click me!"
		 bind:click="onClick"
		/>
		<view class="sub-title">Default</view>
		<wux-navbar theme="dark">
			<wux-icon slot="left" type="ios-arrow-back" size="23" />
			<view>导航栏</view>
			<wux-icon slot="right" type="ios-more" size="23" />
		</wux-navbar>
	</view>
</view>
import './index.less';
Page({
  onClick(e) {
    console.log('onClick', e);
    if (e.detail.type === 'right') {
      void wx.showModal({
        title: 'Thank you for your support!',
        showCancel: !1,
      });
    }
  },
});

API

NavBar props

参数类型描述默认值
prefixClsstring自定义类名前缀wux-navbar
themestring主题色,可选值为 light、stable、positive、calm、assertive、balanced、energized、royal、darklight
titlestring标题-
leftTextstring导航左边内容-
rightTextstring导航右边内容-
bind:clickfunction点击事件-

NavBar slot

名称描述
-自定义标题
left自定义导航左边内容
right自定义导航右边内容

NavBar externalClasses

名称描述
wux-class根节点样式类
1.5.1

1 year ago

1.5.0

1 year ago

1.3.5

2 years ago

1.4.0

2 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago