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') {