Skip to content

Commit c74c645

Browse files
committed
fix: support once (with skip) client side (fix #498)
1 parent 4c03b38 commit c74c645

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/client/updaters/tag.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ export default function updateTag (appId, options, type, tags, head, body) {
4444
}
4545

4646
const newElement = document.createElement(type)
47-
newElement.setAttribute(attribute, appId)
47+
48+
if (!tag.once) {
49+
newElement.setAttribute(attribute, appId)
50+
}
4851

4952
Object.keys(tag).forEach((attr) => {
5053
/* istanbul ignore next */

src/shared/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const tagsWithInnerContent = ['noscript', 'script', 'style']
104104
// Attributes which are inserted as childNodes instead of HTMLAttribute
105105
export const tagAttributeAsInnerContent = ['innerHTML', 'cssText', 'json']
106106

107-
export const tagProperties = ['once', 'template']
107+
export const tagProperties = ['once', 'skip', 'template']
108108

109109
// Attributes which should be added with data- prefix
110110
export const commonDataAttributes = ['body', 'pbody']

0 commit comments

Comments
 (0)