12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import baseComponent from '../helpers/baseComponent'
- import classNames from '../helpers/libs/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 })
- },
- },
- })
|