master
yutent 2023-09-20 19:11:22 +08:00
parent 3908bf7fe6
commit fd154f1bcf
1 changed files with 8 additions and 8 deletions

View File

@ -330,10 +330,10 @@ class TemplateInstance {
for (let part of this._parts) { for (let part of this._parts) {
if (part !== void 0) { if (part !== void 0) {
if (part.strings !== void 0) { if (part.strings !== void 0) {
part._$setValue(values, i) part.$setValue(values, i)
i += part.strings.length - 2 i += part.strings.length - 2
} else { } else {
part._$setValue(values[i]) part.$setValue(values[i])
} }
} }
i++ i++
@ -365,7 +365,7 @@ class ChildPart {
get endNode() { get endNode() {
return this._$endNode return this._$endNode
} }
_$setValue(value) { $setValue(value) {
if (isPrimitive(value)) { if (isPrimitive(value)) {
if (value === NOTHING || value == null || value === '') { if (value === NOTHING || value == null || value === '') {
if (this._$committedValue !== NOTHING) { if (this._$committedValue !== NOTHING) {
@ -457,7 +457,7 @@ class ChildPart {
} else { } else {
itemPart = itemParts[partIndex] itemPart = itemParts[partIndex]
} }
itemPart._$setValue(item) itemPart.$setValue(item)
partIndex++ partIndex++
} }
if (partIndex < itemParts.length) { if (partIndex < itemParts.length) {
@ -495,7 +495,7 @@ class AttributePart {
return this.element.tagName return this.element.tagName
} }
_$setValue(value, valueIndex) { $setValue(value, valueIndex) {
let strings = this.strings let strings = this.strings
let changed = false let changed = false
if (strings === void 0) { if (strings === void 0) {
@ -591,7 +591,7 @@ class EventPart extends AttributePart {
this.type = EVENT_PART this.type = EVENT_PART
} }
_$setValue(listener) { $setValue(listener) {
let host = this.options.host let host = this.options.host
let options = {} let options = {}
@ -672,7 +672,7 @@ class ElementPart {
this.options = options this.options = options
} }
_$setValue(value) {} $setValue(value) {}
} }
export function render(value, container, options = {}) { export function render(value, container, options = {}) {
@ -687,7 +687,7 @@ export function render(value, container, options = {}) {
) )
container[WC_PART] = part container[WC_PART] = part
} }
part._$setValue(value) part.$setValue(value)
return part return part
} }