榆山数据端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

52 lines
1.2 KiB

import baseComponent from '../helpers/baseComponent'
import classNames from '../helpers/classNames'
baseComponent({
properties: {
prefixCls: {
type: String,
value: 'wux-navbar',
},
theme: {
type: String,
value: 'light',
},
title: {
type: String,
value: '',
},
leftText: {
type: String,
value: '',
},
rightText: {
type: String,
value: '',
},
},
computed: {
classes: ['prefixCls, theme', function(prefixCls, theme) {
const wrap = classNames(prefixCls, {
[`${prefixCls}--${theme}`]: theme,
})
const left = `${prefixCls}__left`
const text = `${prefixCls}__text`
const title = `${prefixCls}__title`
const right = `${prefixCls}__right`
return {
wrap,
left,
text,
title,
right,
}
}],
},
methods: {
onClick(e) {
const { type } = e.currentTarget.dataset
this.triggerEvent('click', { type })
},
},
})