From f281cd5decc70e900929b560fa3162b7e62667cd Mon Sep 17 00:00:00 2001 From: yutent Date: Fri, 24 Nov 2023 14:59:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=9D=A2=E5=8C=85=E5=B1=91?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E7=AE=80=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/badge/index.js | 2 +- src/breadcrumb/index.js | 35 +++++++++++------------------------ 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/src/badge/index.js b/src/badge/index.js index 511a1df..bfed21b 100644 --- a/src/badge/index.js +++ b/src/badge/index.js @@ -64,7 +64,7 @@ class Badge extends Component { css` $colors: ( info: 'blue', - success: 'teal', + success: 'green', warning: 'orange' ); diff --git a/src/breadcrumb/index.js b/src/breadcrumb/index.js index f4598e1..4533f3c 100644 --- a/src/breadcrumb/index.js +++ b/src/breadcrumb/index.js @@ -1,12 +1,10 @@ /** - * {} + * {面包屑导航} * @author yutent * @date 2023/04/10 16:12:33 */ -import { css, html, Component, bind, styleMap } from 'wkit' - -const last = Symbol('last') +import { css, html, Component, styleMap } from 'wkit' class Breadcrumb extends Component { static styles = [ @@ -25,9 +23,7 @@ class Breadcrumb extends Component { let list = Array.from(this.children) list.forEach((it, i) => { if (it.tagName === 'WC-BREADCRUMB-ITEM') { - if (list.length === i + 1) { - it.last = true - } + it.last = list.length === i + 1 } else { it.remove() } @@ -41,44 +37,35 @@ class Breadcrumb extends Component { class Item extends Component { static props = { - path: '', - separator: '/' + separator: '/', + last: 'bool!' } static styles = [ css` :host, - .breadcrumb-item { + .item { display: inline-flex; align-items: center; height: 32px; font-size: 14px; } - .separator { + .pipe { margin: 0 8px; user-select: none; } ` ] - get last() { - return this[last] || false - } - - set last(val) { - this[last] = !!val - this.$requestUpdate() - } - render() { return html` -