From 4a5127fecfdf69e85e92697278b6ff846368fe23 Mon Sep 17 00:00:00 2001 From: shadowdreamer Date: Mon, 6 Sep 2021 13:51:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=80=89=E4=B8=89=E4=B8=AA=E5=A4=A9?= =?UTF-8?q?=E8=B5=8B=E4=B9=8B=E5=90=8E=E6=8C=89=E9=92=AE=E6=96=87=E6=A1=88?= =?UTF-8?q?=E5=8F=98=E5=8C=96=EF=BC=8C=E5=8A=A0=E7=82=B9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=B7=B2=E9=80=89=E5=A4=A9=E8=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.js | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/app.js b/src/app.js index 34a7008..30facf1 100644 --- a/src/app.js +++ b/src/app.js @@ -101,6 +101,9 @@ class App{ if(li.hasClass('selected')) { li.removeClass('selected') this.#talentSelected.delete(talent); + if(this.#talentSelected.size<3) { + talentPage.find('#next').text('请选择3个') + } } else { if(this.#talentSelected.size==3) { this.hint('只能选3个天赋'); @@ -122,6 +125,9 @@ class App{ } li.addClass('selected'); this.#talentSelected.add(talent); + if(this.#talentSelected.size==3) { + talentPage.find('#next').text('开始新人生') + } } }); }); @@ -139,18 +145,30 @@ class App{ }) // Property - const propertyPage = $(` + // hint of extension tobermory.es6-string-html + const propertyPage = $(/*html*/`
调整初始属性
可用属性点:0
+ +
`); - + propertyPage.mounted = ()=>{ + propertyPage + .find('#talentSelectedView').append( + $(Array.from(this.#talentSelected) + .map(({name,description})=>`
  • ${name}(${description})
  • `) + .join('')) + ) + } const groups = {}; const total = ()=>{ let t = 0; @@ -478,6 +496,9 @@ class App{ $('#main').detach(); p.clear(); p.page.appendTo('body'); + if(typeof p.page.mounted === 'function'){ + p.page.mounted() + } } hint(message, type='info') {