@skaldapp/monaco-sfc 1.2.15 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue.worker.js +863 -353
- package/package.json +12 -12
package/dist/vue.worker.js
CHANGED
|
@@ -51,6 +51,8 @@ var NS = Symbol("ns");
|
|
|
51
51
|
var OWNER_ELEMENT = Symbol("owner");
|
|
52
52
|
var OWNER_DOCUMENT = Symbol("owner_document");
|
|
53
53
|
var ATTRIBUTES = Symbol("attributes");
|
|
54
|
+
var CLASS_LIST = Symbol("class_list");
|
|
55
|
+
var DATASET = Symbol("dataset");
|
|
54
56
|
var PREV = Symbol("prev");
|
|
55
57
|
var NEXT = Symbol("next");
|
|
56
58
|
var CHILD = Symbol("child");
|
|
@@ -442,6 +444,13 @@ var NodeList = class extends Array {
|
|
|
442
444
|
return this[index] ?? null;
|
|
443
445
|
}
|
|
444
446
|
};
|
|
447
|
+
/** Common fields available on every selector matcher. */
|
|
448
|
+
/** Matchers whose comparison value is carried entirely by `name`. */
|
|
449
|
+
/** An attribute selector, optionally requiring an exact value. */
|
|
450
|
+
/** A pseudo-class selector without an argument. */
|
|
451
|
+
/** A functional pseudo-class selector. */
|
|
452
|
+
/** The internal scope marker used while matching relative selectors. */
|
|
453
|
+
/** A local- or qualified-name matcher with a precomputed HTML comparison name. */
|
|
445
454
|
var SUPPORTED_IDENTIFIER_TEST = /^(?:--|-?[A-Za-z_\u0080-\u{10FFFF}])[A-Za-z0-9_\u0080-\u{10FFFF}-]*$/u;
|
|
446
455
|
function readFunctionArgument(selector, start) {
|
|
447
456
|
let depth = 1;
|
|
@@ -514,7 +523,7 @@ function parseSelector(selector, insideHas = false, allowLeadingCombinator = fal
|
|
|
514
523
|
}
|
|
515
524
|
const name = token[8] ? asciiLowercase(token[8]) : token[2] || token[7];
|
|
516
525
|
if (token[7] != null && !token[6] && part.matchers.length > 0) throwSelectorSyntaxError(selector);
|
|
517
|
-
let type;
|
|
526
|
+
let type = 0;
|
|
518
527
|
let value = token[4] ?? token[5] ?? token[7];
|
|
519
528
|
if (token[2]) {
|
|
520
529
|
if (!SUPPORTED_IDENTIFIER_TEST.test(name)) throwSelectorSyntaxError(selector);
|
|
@@ -529,19 +538,20 @@ function parseSelector(selector, insideHas = false, allowLeadingCombinator = fal
|
|
|
529
538
|
} else if (token[6]) {
|
|
530
539
|
if (!SUPPORTED_IDENTIFIER_TEST.test(name)) throwSelectorSyntaxError(selector);
|
|
531
540
|
type = token[6] === "#" ? 2 : 3;
|
|
532
|
-
} else if (token[8])
|
|
533
|
-
|
|
534
|
-
else if (token[7] && SUPPORTED_IDENTIFIER_TEST.test(token[7])) type = 1;
|
|
535
|
-
else throwSelectorSyntaxError(selector);
|
|
536
|
-
if (token[9]) {
|
|
541
|
+
} else if (token[8]) {
|
|
542
|
+
if (!token[9]) throwSelectorSyntaxError(selector);
|
|
537
543
|
[value, tokenizer.lastIndex] = readFunctionArgument(normalizedSelector, tokenizer.lastIndex);
|
|
538
544
|
if (name !== "has" && name !== "not") throwSelectorSyntaxError(selector);
|
|
539
545
|
if (name === "has" && insideHas) throwSelectorSyntaxError(selector);
|
|
540
546
|
parseSelector(value, insideHas || name === "has", name === "has");
|
|
541
|
-
|
|
547
|
+
type = 6;
|
|
548
|
+
} else if (token[7] === "*") type = 0;
|
|
549
|
+
else if (token[7] && SUPPORTED_IDENTIFIER_TEST.test(token[7])) type = 1;
|
|
550
|
+
else throwSelectorSyntaxError(selector);
|
|
542
551
|
part.matchers.push({
|
|
543
552
|
type,
|
|
544
553
|
name,
|
|
554
|
+
htmlName: type === 1 || type === 4 ? asciiLowercase(name) : void 0,
|
|
545
555
|
value
|
|
546
556
|
});
|
|
547
557
|
consumed = tokenizer.lastIndex;
|
|
@@ -603,8 +613,7 @@ function matchesSelectorRecursive(element, parts, scope) {
|
|
|
603
613
|
const { combinator, matchers } = parts[parts.length - 1];
|
|
604
614
|
if (combinator === 4) {
|
|
605
615
|
if (!matchesSelectorMatcher(element, matchers, scope)) return false;
|
|
606
|
-
|
|
607
|
-
return pp.length === 0 || matchesSelectorRecursive(element, pp, scope);
|
|
616
|
+
return parts.length === 1 || matchesSelectorRecursive(element, parts.slice(0, -1), scope);
|
|
608
617
|
}
|
|
609
618
|
const link = combinator === 1 || combinator === 0 ? PARENT : PREV;
|
|
610
619
|
let ref = element[link];
|
|
@@ -612,9 +621,7 @@ function matchesSelectorRecursive(element, parts, scope) {
|
|
|
612
621
|
if (combinator === 0 || combinator === 2) {
|
|
613
622
|
while (ref) {
|
|
614
623
|
if (isElementNode(ref) && matchesSelectorMatcher(ref, matchers, scope)) {
|
|
615
|
-
|
|
616
|
-
if (pp.length === 0) return true;
|
|
617
|
-
if (matchesSelectorRecursive(ref, pp, scope)) return true;
|
|
624
|
+
if (parts.length === 1 || matchesSelectorRecursive(ref, parts.slice(0, -1), scope)) return true;
|
|
618
625
|
}
|
|
619
626
|
ref = ref[link];
|
|
620
627
|
}
|
|
@@ -625,30 +632,27 @@ function matchesSelectorRecursive(element, parts, scope) {
|
|
|
625
632
|
if (!ref) return false;
|
|
626
633
|
}
|
|
627
634
|
if (!isElementNode(ref) || !matchesSelectorMatcher(ref, matchers, scope)) return false;
|
|
628
|
-
|
|
629
|
-
return pp.length === 0 || matchesSelectorRecursive(ref, pp, scope);
|
|
635
|
+
return parts.length === 1 || matchesSelectorRecursive(ref, parts.slice(0, -1), scope);
|
|
630
636
|
}
|
|
631
637
|
}
|
|
632
|
-
function getSelectorAttribute(element, name) {
|
|
633
|
-
return element.getAttributeNS(null, element.namespaceURI === "http://www.w3.org/1999/xhtml" ? asciiLowercase(name) : name);
|
|
634
|
-
}
|
|
635
638
|
function matchesSelectorMatcher(element, matcher, scope) {
|
|
636
639
|
if (!element) return false;
|
|
637
640
|
if (Array.isArray(matcher)) {
|
|
638
641
|
for (const single of matcher) if (matchesSelectorMatcher(element, single, scope) === false) return false;
|
|
639
642
|
return true;
|
|
640
643
|
}
|
|
641
|
-
const { type, name, value } = matcher;
|
|
644
|
+
const { type, name, htmlName, value } = matcher;
|
|
642
645
|
switch (type) {
|
|
643
646
|
case 0: return name === "*";
|
|
644
|
-
case 1: return element.namespaceURI === "http://www.w3.org/1999/xhtml" ?
|
|
645
|
-
case
|
|
647
|
+
case 1: return element.localName === (element.namespaceURI === "http://www.w3.org/1999/xhtml" ? htmlName : name);
|
|
648
|
+
case 8: return element[NAME] === (element.namespaceURI === "http://www.w3.org/1999/xhtml" ? htmlName : name);
|
|
649
|
+
case 2: return element.getAttributeNS(null, "id") === name;
|
|
646
650
|
case 3:
|
|
647
|
-
const classAttr =
|
|
651
|
+
const classAttr = element.getAttributeNS(null, "class");
|
|
648
652
|
if (!classAttr) return false;
|
|
649
653
|
return splitOnASCIIWhitespace(classAttr).includes(name);
|
|
650
654
|
case 4:
|
|
651
|
-
const attribute =
|
|
655
|
+
const attribute = element.getAttributeNS(null, element.namespaceURI === "http://www.w3.org/1999/xhtml" ? htmlName : name);
|
|
652
656
|
return value == null ? attribute != null : attribute === value;
|
|
653
657
|
case 7: return element === scope;
|
|
654
658
|
case 5: throwSelectorSyntaxError(`:${name}`);
|
|
@@ -661,6 +665,11 @@ function matchesSelectorMatcher(element, matcher, scope) {
|
|
|
661
665
|
return false;
|
|
662
666
|
}
|
|
663
667
|
// node_modules/@remote-dom/polyfill/build/esm/shared.mjs
|
|
668
|
+
function toPropertyIndex(property) {
|
|
669
|
+
if (typeof property !== "string") return void 0;
|
|
670
|
+
const index = Number(property);
|
|
671
|
+
return Number.isInteger(index) && index >= 0 && index < 2 ** 32 - 1 && String(index) === property ? index : void 0;
|
|
672
|
+
}
|
|
664
673
|
function isAttributeNode(node) {
|
|
665
674
|
return node.nodeType === 2;
|
|
666
675
|
}
|
|
@@ -823,13 +832,11 @@ function getElementsByClassName(within, classNames) {
|
|
|
823
832
|
}
|
|
824
833
|
function getElementsByTagName(within, qualifiedName) {
|
|
825
834
|
const name = String(qualifiedName);
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
}
|
|
832
|
-
return elements;
|
|
835
|
+
return querySelectorAll(within, [{
|
|
836
|
+
type: name === "*" ? 0 : 8,
|
|
837
|
+
name,
|
|
838
|
+
htmlName: asciiLowercase(name)
|
|
839
|
+
}]);
|
|
833
840
|
}
|
|
834
841
|
function descendants(node) {
|
|
835
842
|
const nodes = [];
|
|
@@ -1561,39 +1568,12 @@ var NamedNodeMap = class {
|
|
|
1561
1568
|
removeNamedItem(name) {
|
|
1562
1569
|
const qualifiedName = String(name);
|
|
1563
1570
|
const normalizedName = this[OWNER_ELEMENT][NS] === "http://www.w3.org/1999/xhtml" ? asciiLowercase(qualifiedName) : qualifiedName;
|
|
1564
|
-
return performWithCustomElementReactions(() =>
|
|
1571
|
+
return performWithCustomElementReactions(() => removeNamedItemImmediately(this, (attr) => attr.name === normalizedName));
|
|
1565
1572
|
}
|
|
1566
1573
|
removeNamedItemNS(namespaceURI, localName) {
|
|
1567
1574
|
const namespace = normalizeNamespace(namespaceURI);
|
|
1568
1575
|
const normalizedLocalName = String(localName);
|
|
1569
|
-
return performWithCustomElementReactions(() =>
|
|
1570
|
-
}
|
|
1571
|
-
removeNamedItemImmediately(matches) {
|
|
1572
|
-
const ownerElement = this[OWNER_ELEMENT];
|
|
1573
|
-
let attr = this[CHILD];
|
|
1574
|
-
let prev = null;
|
|
1575
|
-
while (attr != null) {
|
|
1576
|
-
if (matches(attr)) {
|
|
1577
|
-
if (prev) prev[NEXT] = attr[NEXT];
|
|
1578
|
-
if (this[CHILD] === attr) this[CHILD] = attr[NEXT];
|
|
1579
|
-
const oldValue = attr.value;
|
|
1580
|
-
attr[NEXT] = null;
|
|
1581
|
-
attr[OWNER_ELEMENT] = null;
|
|
1582
|
-
if (attributeObserversActive) queueMutationRecord({
|
|
1583
|
-
type: "attributes",
|
|
1584
|
-
target: ownerElement,
|
|
1585
|
-
attributeName: attr.name,
|
|
1586
|
-
attributeNamespace: attr[NS],
|
|
1587
|
-
oldValue
|
|
1588
|
-
});
|
|
1589
|
-
ownerElement[HOOKS].removeAttribute?.(ownerElement, attr.name, attr[NS]);
|
|
1590
|
-
enqueueAttributeReaction(ownerElement, attr.localName, oldValue, null, attr[NS]);
|
|
1591
|
-
return attr;
|
|
1592
|
-
}
|
|
1593
|
-
prev = attr;
|
|
1594
|
-
attr = attr[NEXT];
|
|
1595
|
-
}
|
|
1596
|
-
return null;
|
|
1576
|
+
return performWithCustomElementReactions(() => removeNamedItemImmediately(this, (attr) => attr.localName === normalizedLocalName && attr[NS] === namespace));
|
|
1597
1577
|
}
|
|
1598
1578
|
setNamedItem(attr) {
|
|
1599
1579
|
return performWithCustomElementReactions(() => this.setNamedItemImmediately(attr));
|
|
@@ -1650,6 +1630,54 @@ var NamedNodeMap = class {
|
|
|
1650
1630
|
}
|
|
1651
1631
|
}
|
|
1652
1632
|
};
|
|
1633
|
+
function removeNamedItemImmediately(attributes, matches, destination) {
|
|
1634
|
+
const ownerElement = attributes[OWNER_ELEMENT];
|
|
1635
|
+
let attr = attributes[CHILD];
|
|
1636
|
+
let prev = null;
|
|
1637
|
+
while (attr != null) {
|
|
1638
|
+
if (matches(attr)) {
|
|
1639
|
+
const qualifiedName = attr.name;
|
|
1640
|
+
const localName = attr.localName;
|
|
1641
|
+
const namespace = attr[NS];
|
|
1642
|
+
const oldValue = attr.value;
|
|
1643
|
+
if (prev) prev[NEXT] = attr[NEXT];
|
|
1644
|
+
if (attributes[CHILD] === attr) attributes[CHILD] = attr[NEXT];
|
|
1645
|
+
attr[NEXT] = null;
|
|
1646
|
+
attr[OWNER_ELEMENT] = null;
|
|
1647
|
+
if (destination) adoptNodes([attr], destination);
|
|
1648
|
+
if (attributeObserversActive) queueMutationRecord({
|
|
1649
|
+
type: "attributes",
|
|
1650
|
+
target: ownerElement,
|
|
1651
|
+
attributeName: qualifiedName,
|
|
1652
|
+
attributeNamespace: namespace,
|
|
1653
|
+
oldValue
|
|
1654
|
+
});
|
|
1655
|
+
ownerElement[HOOKS].removeAttribute?.(ownerElement, qualifiedName, namespace);
|
|
1656
|
+
enqueueAttributeReaction(ownerElement, localName, oldValue, null, namespace);
|
|
1657
|
+
return attr;
|
|
1658
|
+
}
|
|
1659
|
+
prev = attr;
|
|
1660
|
+
attr = attr[NEXT];
|
|
1661
|
+
}
|
|
1662
|
+
return null;
|
|
1663
|
+
}
|
|
1664
|
+
/** @internal */
|
|
1665
|
+
function removeAttributeForAdoption(attributes, attribute, destination) {
|
|
1666
|
+
const removed = removeNamedItemImmediately(attributes, (candidate) => candidate === attribute, destination);
|
|
1667
|
+
if (removed == null) throw new Error("The owner element does not contain the adopted attribute.");
|
|
1668
|
+
return removed;
|
|
1669
|
+
}
|
|
1670
|
+
var namedNodeMapPropertyFallback = new Proxy({}, { get(target, property, receiver) {
|
|
1671
|
+
const namedNodeMap = receiver;
|
|
1672
|
+
const index = toPropertyIndex(property);
|
|
1673
|
+
if (index !== void 0) {
|
|
1674
|
+
const indexedAttribute = namedNodeMap.item(index);
|
|
1675
|
+
if (indexedAttribute) return indexedAttribute;
|
|
1676
|
+
}
|
|
1677
|
+
if (property in target) return Reflect.get(target, property, receiver);
|
|
1678
|
+
return typeof property === "string" ? namedNodeMap.getNamedItem(property) ?? void 0 : void 0;
|
|
1679
|
+
} });
|
|
1680
|
+
Object.setPrototypeOf(NamedNodeMap.prototype, namedNodeMapPropertyFallback);
|
|
1653
1681
|
// node_modules/@remote-dom/polyfill/build/esm/Attr.mjs
|
|
1654
1682
|
var Attr = class extends Node$2 {
|
|
1655
1683
|
nodeType = 2;
|
|
@@ -1904,6 +1932,186 @@ function serialize(workItems) {
|
|
|
1904
1932
|
}
|
|
1905
1933
|
return chunks.join("");
|
|
1906
1934
|
}
|
|
1935
|
+
// node_modules/@remote-dom/polyfill/build/esm/DOMTokenList.mjs
|
|
1936
|
+
function validateTokens(token, otherToken) {
|
|
1937
|
+
if (token === "" || otherToken === "") throw createDOMException("The token provided must not be empty.", "SyntaxError");
|
|
1938
|
+
if (/[\t\n\f\r ]/.test(token) || otherToken !== void 0 && /[\t\n\f\r ]/.test(otherToken)) throw createDOMException("The token provided contains ASCII whitespace, which is not valid in tokens.", "InvalidCharacterError");
|
|
1939
|
+
}
|
|
1940
|
+
function normalizeTokens(tokens) {
|
|
1941
|
+
for (let index = 0; index < tokens.length; index++) tokens[index] = String(tokens[index]);
|
|
1942
|
+
for (const token of tokens) validateTokens(token);
|
|
1943
|
+
return tokens;
|
|
1944
|
+
}
|
|
1945
|
+
var DOMTokenList = class {
|
|
1946
|
+
#cachedRawValue;
|
|
1947
|
+
#cachedTokens = [];
|
|
1948
|
+
constructor(element) {
|
|
1949
|
+
this[OWNER_ELEMENT] = element;
|
|
1950
|
+
}
|
|
1951
|
+
get [VALUE]() {
|
|
1952
|
+
const rawValue = this[OWNER_ELEMENT].className;
|
|
1953
|
+
if (rawValue !== this.#cachedRawValue) {
|
|
1954
|
+
this.#cachedTokens = [...new Set(splitOnASCIIWhitespace(rawValue))];
|
|
1955
|
+
this.#cachedRawValue = rawValue;
|
|
1956
|
+
}
|
|
1957
|
+
return this.#cachedTokens;
|
|
1958
|
+
}
|
|
1959
|
+
get length() {
|
|
1960
|
+
return this[VALUE].length;
|
|
1961
|
+
}
|
|
1962
|
+
get value() {
|
|
1963
|
+
return this[OWNER_ELEMENT].className;
|
|
1964
|
+
}
|
|
1965
|
+
set value(value) {
|
|
1966
|
+
this[OWNER_ELEMENT].className = String(value);
|
|
1967
|
+
}
|
|
1968
|
+
#setTokens(tokens) {
|
|
1969
|
+
const rawValue = tokens.join(" ");
|
|
1970
|
+
this.#cachedRawValue = rawValue;
|
|
1971
|
+
this.#cachedTokens = tokens;
|
|
1972
|
+
this.value = rawValue;
|
|
1973
|
+
}
|
|
1974
|
+
item(index) {
|
|
1975
|
+
return this[VALUE][index] ?? null;
|
|
1976
|
+
}
|
|
1977
|
+
contains(token) {
|
|
1978
|
+
return this[VALUE].includes(String(token));
|
|
1979
|
+
}
|
|
1980
|
+
add(...tokens) {
|
|
1981
|
+
const normalizedTokens = normalizeTokens(tokens);
|
|
1982
|
+
const currentTokens = this[VALUE];
|
|
1983
|
+
if (normalizedTokens.length === 0) {
|
|
1984
|
+
this.#setTokens(currentTokens);
|
|
1985
|
+
return;
|
|
1986
|
+
}
|
|
1987
|
+
if (normalizedTokens.length === 1) {
|
|
1988
|
+
const token = normalizedTokens[0];
|
|
1989
|
+
this.#setTokens(currentTokens.includes(token) ? currentTokens : [...currentTokens, token]);
|
|
1990
|
+
return;
|
|
1991
|
+
}
|
|
1992
|
+
const nextTokens = new Set(currentTokens);
|
|
1993
|
+
for (const token of normalizedTokens) nextTokens.add(token);
|
|
1994
|
+
this.#setTokens(nextTokens.size === currentTokens.length ? currentTokens : [...nextTokens]);
|
|
1995
|
+
}
|
|
1996
|
+
remove(...tokens) {
|
|
1997
|
+
const normalizedTokens = normalizeTokens(tokens);
|
|
1998
|
+
if (!this[OWNER_ELEMENT].hasAttribute("class")) return;
|
|
1999
|
+
const currentTokens = this[VALUE];
|
|
2000
|
+
if (normalizedTokens.length === 0 || currentTokens.length === 0) {
|
|
2001
|
+
this.#setTokens(currentTokens);
|
|
2002
|
+
return;
|
|
2003
|
+
}
|
|
2004
|
+
if (normalizedTokens.length === 1) {
|
|
2005
|
+
const index = currentTokens.indexOf(normalizedTokens[0]);
|
|
2006
|
+
this.#setTokens(index < 0 ? currentTokens : currentTokens.filter((_, tokenIndex) => tokenIndex !== index));
|
|
2007
|
+
return;
|
|
2008
|
+
}
|
|
2009
|
+
const removedTokens = new Set(normalizedTokens);
|
|
2010
|
+
const nextTokens = [];
|
|
2011
|
+
for (const token of currentTokens) if (!removedTokens.has(token)) nextTokens.push(token);
|
|
2012
|
+
this.#setTokens(nextTokens.length === currentTokens.length ? currentTokens : nextTokens);
|
|
2013
|
+
}
|
|
2014
|
+
toggle(token, force) {
|
|
2015
|
+
const normalizedToken = String(token);
|
|
2016
|
+
validateTokens(normalizedToken);
|
|
2017
|
+
const tokens = this[VALUE];
|
|
2018
|
+
const index = tokens.indexOf(normalizedToken);
|
|
2019
|
+
const present = index >= 0;
|
|
2020
|
+
const next = force === void 0 ? !present : Boolean(force);
|
|
2021
|
+
if (next !== present) this.#setTokens(next ? [...tokens, normalizedToken] : tokens.filter((_, tokenIndex) => tokenIndex !== index));
|
|
2022
|
+
return next;
|
|
2023
|
+
}
|
|
2024
|
+
replace(token, newToken) {
|
|
2025
|
+
const normalizedToken = String(token);
|
|
2026
|
+
const normalizedNewToken = String(newToken);
|
|
2027
|
+
validateTokens(normalizedToken, normalizedNewToken);
|
|
2028
|
+
const tokens = this[VALUE];
|
|
2029
|
+
const index = tokens.indexOf(normalizedToken);
|
|
2030
|
+
if (index < 0) return false;
|
|
2031
|
+
if (normalizedToken === normalizedNewToken) {
|
|
2032
|
+
this.#setTokens(tokens);
|
|
2033
|
+
return true;
|
|
2034
|
+
}
|
|
2035
|
+
const nextTokens = [];
|
|
2036
|
+
let seenReplacement = false;
|
|
2037
|
+
for (let tokenIndex = 0; tokenIndex < tokens.length; tokenIndex++) {
|
|
2038
|
+
const candidate = tokenIndex === index ? normalizedNewToken : tokens[tokenIndex];
|
|
2039
|
+
if (candidate === normalizedNewToken) {
|
|
2040
|
+
if (seenReplacement) continue;
|
|
2041
|
+
seenReplacement = true;
|
|
2042
|
+
}
|
|
2043
|
+
nextTokens.push(candidate);
|
|
2044
|
+
}
|
|
2045
|
+
this.#setTokens(nextTokens);
|
|
2046
|
+
return true;
|
|
2047
|
+
}
|
|
2048
|
+
toString() {
|
|
2049
|
+
return this.value;
|
|
2050
|
+
}
|
|
2051
|
+
[Symbol.iterator]() {
|
|
2052
|
+
return this[VALUE][Symbol.iterator]();
|
|
2053
|
+
}
|
|
2054
|
+
};
|
|
2055
|
+
Object.setPrototypeOf(DOMTokenList.prototype, new Proxy({}, {
|
|
2056
|
+
get(target, name, receiver) {
|
|
2057
|
+
const index = toPropertyIndex(name);
|
|
2058
|
+
return index !== void 0 ? receiver[VALUE][index] : Reflect.get(target, name, receiver);
|
|
2059
|
+
},
|
|
2060
|
+
set(target, name, value, receiver) {
|
|
2061
|
+
return toPropertyIndex(name) !== void 0 || Reflect.set(target, name, value, receiver);
|
|
2062
|
+
}
|
|
2063
|
+
}));
|
|
2064
|
+
// node_modules/@remote-dom/polyfill/build/esm/DOMStringMap.mjs
|
|
2065
|
+
function toDataAttributeName(name) {
|
|
2066
|
+
return "data-" + asciiLowercase(name.replace(/[A-Z]/g, "-$&"));
|
|
2067
|
+
}
|
|
2068
|
+
function toDataPropertyName(name) {
|
|
2069
|
+
return name.slice(5).replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
2070
|
+
}
|
|
2071
|
+
function isValidDataPropertyName(name) {
|
|
2072
|
+
return !/-[a-z]/.test(name);
|
|
2073
|
+
}
|
|
2074
|
+
function validateDataPropertyName(name) {
|
|
2075
|
+
if (!isValidDataPropertyName(name)) throw createDOMException("Invalid dataset property name", "SyntaxError");
|
|
2076
|
+
}
|
|
2077
|
+
function createDOMStringMap(element) {
|
|
2078
|
+
return new Proxy({}, {
|
|
2079
|
+
get: (target, name) => typeof name === "string" && isValidDataPropertyName(name) ? element.getAttribute(toDataAttributeName(name)) ?? Reflect.get(target, name) : Reflect.get(target, name),
|
|
2080
|
+
set: (target, name, value) => {
|
|
2081
|
+
if (typeof name !== "string") return Reflect.set(target, name, value);
|
|
2082
|
+
validateDataPropertyName(name);
|
|
2083
|
+
element.setAttribute(toDataAttributeName(name), String(value));
|
|
2084
|
+
return true;
|
|
2085
|
+
},
|
|
2086
|
+
deleteProperty: (target, name) => {
|
|
2087
|
+
if (typeof name !== "string") return Reflect.deleteProperty(target, name);
|
|
2088
|
+
if (!isValidDataPropertyName(name)) return true;
|
|
2089
|
+
element.removeAttribute(toDataAttributeName(name));
|
|
2090
|
+
return true;
|
|
2091
|
+
},
|
|
2092
|
+
defineProperty: (target, name, descriptor) => {
|
|
2093
|
+
if (typeof name !== "string") return Reflect.defineProperty(target, name, descriptor);
|
|
2094
|
+
if ("get" in descriptor || "set" in descriptor) return false;
|
|
2095
|
+
validateDataPropertyName(name);
|
|
2096
|
+
element.setAttribute(toDataAttributeName(name), String(descriptor.value));
|
|
2097
|
+
return true;
|
|
2098
|
+
},
|
|
2099
|
+
preventExtensions: () => false,
|
|
2100
|
+
has: (target, name) => Reflect.has(target, name) || typeof name === "string" && isValidDataPropertyName(name) && element.hasAttribute(toDataAttributeName(name)),
|
|
2101
|
+
ownKeys: (target) => [...element.getAttributeNames().filter((name) => name.startsWith("data-") && toDataAttributeName(toDataPropertyName(name)) === name).map(toDataPropertyName), ...Reflect.ownKeys(target).filter((key) => typeof key !== "string")],
|
|
2102
|
+
getOwnPropertyDescriptor: (target, name) => {
|
|
2103
|
+
if (typeof name !== "string") return Reflect.getOwnPropertyDescriptor(target, name);
|
|
2104
|
+
if (!isValidDataPropertyName(name)) return Reflect.getOwnPropertyDescriptor(target, name);
|
|
2105
|
+
const value = element.getAttribute(toDataAttributeName(name));
|
|
2106
|
+
return value == null ? Reflect.getOwnPropertyDescriptor(target, name) : {
|
|
2107
|
+
value,
|
|
2108
|
+
writable: true,
|
|
2109
|
+
enumerable: true,
|
|
2110
|
+
configurable: true
|
|
2111
|
+
};
|
|
2112
|
+
}
|
|
2113
|
+
});
|
|
2114
|
+
}
|
|
1907
2115
|
// node_modules/@remote-dom/polyfill/build/esm/Element.mjs
|
|
1908
2116
|
var Element$2 = class extends ParentNode {
|
|
1909
2117
|
nodeType = 1;
|
|
@@ -1925,6 +2133,18 @@ var Element$2 = class extends ParentNode {
|
|
|
1925
2133
|
get tagName() {
|
|
1926
2134
|
return this.nodeName;
|
|
1927
2135
|
}
|
|
2136
|
+
get className() {
|
|
2137
|
+
return this.getAttribute("class") ?? "";
|
|
2138
|
+
}
|
|
2139
|
+
set className(value) {
|
|
2140
|
+
this.setAttribute("class", String(value));
|
|
2141
|
+
}
|
|
2142
|
+
get classList() {
|
|
2143
|
+
return this[CLASS_LIST] ??= new DOMTokenList(this);
|
|
2144
|
+
}
|
|
2145
|
+
get dataset() {
|
|
2146
|
+
return this[DATASET] ??= createDOMStringMap(this);
|
|
2147
|
+
}
|
|
1928
2148
|
get id() {
|
|
1929
2149
|
return this.getAttributeNS(null, "id") ?? "";
|
|
1930
2150
|
}
|
|
@@ -2026,6 +2246,17 @@ var Element$2 = class extends ParentNode {
|
|
|
2026
2246
|
removeAttributeNS(namespace, name) {
|
|
2027
2247
|
this.attributes.removeNamedItemNS(namespace, name);
|
|
2028
2248
|
}
|
|
2249
|
+
matches(selector) {
|
|
2250
|
+
return matchesSelector(this, selector);
|
|
2251
|
+
}
|
|
2252
|
+
closest(selector) {
|
|
2253
|
+
let element = this;
|
|
2254
|
+
while (element) {
|
|
2255
|
+
if (element.matches(selector)) return element;
|
|
2256
|
+
element = element.parentElement;
|
|
2257
|
+
}
|
|
2258
|
+
return null;
|
|
2259
|
+
}
|
|
2029
2260
|
get outerHTML() {
|
|
2030
2261
|
return serializeNode(this);
|
|
2031
2262
|
}
|
|
@@ -2185,6 +2416,17 @@ var Document$1 = class extends ParentNode {
|
|
|
2185
2416
|
return cloneNode(node, deep, this);
|
|
2186
2417
|
}
|
|
2187
2418
|
adoptNode(node) {
|
|
2419
|
+
if (node.nodeType === 2) {
|
|
2420
|
+
const attribute = node;
|
|
2421
|
+
const ownerElement = attribute.ownerElement;
|
|
2422
|
+
if (ownerElement) return performWithCustomElementReactions(() => {
|
|
2423
|
+
removeAttributeForAdoption(ownerElement.attributes, attribute, this);
|
|
2424
|
+
return attribute;
|
|
2425
|
+
});
|
|
2426
|
+
if (attribute[OWNER_DOCUMENT] === this) return attribute;
|
|
2427
|
+
adoptNodes([attribute], this);
|
|
2428
|
+
return attribute;
|
|
2429
|
+
}
|
|
2188
2430
|
if (node[OWNER_DOCUMENT] === this) return node;
|
|
2189
2431
|
const adoption = collectAdoptionSnapshot(node);
|
|
2190
2432
|
return performWithCustomElementReactions(() => {
|
|
@@ -3162,7 +3404,8 @@ var require_language_core$1 = /* @__PURE__ */ __commonJSMin(((exports, module, t
|
|
|
3162
3404
|
return scriptRegistry.get(id);
|
|
3163
3405
|
},
|
|
3164
3406
|
set(id, snapshot, languageId, _plugins = plugins) {
|
|
3165
|
-
|
|
3407
|
+
const scriptPlugins = filterPluginsByExtension(id, plugins);
|
|
3408
|
+
if (!languageId) for (const plugin of scriptPlugins) {
|
|
3166
3409
|
languageId = plugin.getLanguageId?.(id);
|
|
3167
3410
|
if (languageId) break;
|
|
3168
3411
|
}
|
|
@@ -3171,7 +3414,7 @@ var require_language_core$1 = /* @__PURE__ */ __commonJSMin(((exports, module, t
|
|
|
3171
3414
|
return;
|
|
3172
3415
|
}
|
|
3173
3416
|
let associatedOnly = false;
|
|
3174
|
-
for (const plugin of
|
|
3417
|
+
for (const plugin of scriptPlugins) if (plugin.isAssociatedFileOnly?.(id, languageId)) {
|
|
3175
3418
|
associatedOnly = true;
|
|
3176
3419
|
break;
|
|
3177
3420
|
}
|
|
@@ -3220,7 +3463,7 @@ var require_language_core$1 = /* @__PURE__ */ __commonJSMin(((exports, module, t
|
|
|
3220
3463
|
};
|
|
3221
3464
|
scriptRegistry.set(id, sourceScript);
|
|
3222
3465
|
if (associatedOnly) return sourceScript;
|
|
3223
|
-
for (const languagePlugin of _plugins) {
|
|
3466
|
+
for (const languagePlugin of filterPluginsByExtension(id, _plugins)) {
|
|
3224
3467
|
const virtualCode = languagePlugin.createVirtualCode?.(id, languageId, snapshot, prepareCreateVirtualCode(sourceScript));
|
|
3225
3468
|
if (virtualCode) {
|
|
3226
3469
|
sourceScript.generated = {
|
|
@@ -3298,6 +3541,12 @@ var require_language_core$1 = /* @__PURE__ */ __commonJSMin(((exports, module, t
|
|
|
3298
3541
|
} };
|
|
3299
3542
|
}
|
|
3300
3543
|
}
|
|
3544
|
+
function filterPluginsByExtension(id, plugins) {
|
|
3545
|
+
const fileName = String(id);
|
|
3546
|
+
let longestExtension;
|
|
3547
|
+
for (const plugin of plugins) for (const extension of plugin.extensions ?? []) if (fileName.endsWith(extension) && extension.length > (longestExtension?.length ?? -1)) longestExtension = extension;
|
|
3548
|
+
return plugins.filter((plugin) => !plugin.extensions || longestExtension !== void 0 && plugin.extensions.includes(longestExtension));
|
|
3549
|
+
}
|
|
3301
3550
|
function* forEachEmbeddedCode(virtualCode) {
|
|
3302
3551
|
yield virtualCode;
|
|
3303
3552
|
if (virtualCode.embeddedCodes) for (const embeddedCode of virtualCode.embeddedCodes) yield* forEachEmbeddedCode(embeddedCode);
|
|
@@ -4209,6 +4458,7 @@ var require_transform$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4209
4458
|
}
|
|
4210
4459
|
function transformWorkspaceEdit(edit, context, mode, versions = {}) {
|
|
4211
4460
|
const sourceResult = {};
|
|
4461
|
+
const unmappedEdits = /* @__PURE__ */ new Set();
|
|
4212
4462
|
let hasResult = false;
|
|
4213
4463
|
for (const tsUri in edit.changeAnnotations) {
|
|
4214
4464
|
sourceResult.changeAnnotations ??= {};
|
|
@@ -4230,6 +4480,8 @@ var require_transform$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4230
4480
|
const virtualCode = decoded && sourceScript?.generated?.embeddedCodes.get(decoded[1]);
|
|
4231
4481
|
if (sourceScript && virtualCode) {
|
|
4232
4482
|
const embeddedDocument = context.documents.get(context.encodeEmbeddedDocumentUri(sourceScript.id, virtualCode.id), virtualCode.languageId, virtualCode.snapshot);
|
|
4483
|
+
const tsEdits = edit.changes[tsUri];
|
|
4484
|
+
for (const tsEdit of tsEdits) unmappedEdits.add(tsEdit);
|
|
4233
4485
|
for (const [sourceScript, map] of context.language.maps.forEach(virtualCode)) {
|
|
4234
4486
|
const sourceDocument = context.documents.get(sourceScript.id, sourceScript.languageId, sourceScript.snapshot);
|
|
4235
4487
|
const docs = [
|
|
@@ -4237,7 +4489,6 @@ var require_transform$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4237
4489
|
embeddedDocument,
|
|
4238
4490
|
map
|
|
4239
4491
|
];
|
|
4240
|
-
const tsEdits = edit.changes[tsUri];
|
|
4241
4492
|
for (const tsEdit of tsEdits) if (mode === "rename" || mode === "fileName" || mode === "codeAction") {
|
|
4242
4493
|
let _data;
|
|
4243
4494
|
const range = (0, featureWorkers_1.getSourceRange)(docs, tsEdit.range, (data) => {
|
|
@@ -4245,6 +4496,7 @@ var require_transform$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4245
4496
|
return (0, language_core_1.isRenameEnabled)(data);
|
|
4246
4497
|
});
|
|
4247
4498
|
if (range) {
|
|
4499
|
+
unmappedEdits.delete(tsEdit);
|
|
4248
4500
|
sourceResult.changes[sourceDocument.uri] ??= [];
|
|
4249
4501
|
sourceResult.changes[sourceDocument.uri].push({
|
|
4250
4502
|
newText: (0, language_core_1.resolveRenameEditText)(tsEdit.newText, _data),
|
|
@@ -4255,6 +4507,7 @@ var require_transform$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4255
4507
|
} else {
|
|
4256
4508
|
const range = (0, featureWorkers_1.getSourceRange)(docs, tsEdit.range);
|
|
4257
4509
|
if (range) {
|
|
4510
|
+
unmappedEdits.delete(tsEdit);
|
|
4258
4511
|
sourceResult.changes[sourceDocument.uri] ??= [];
|
|
4259
4512
|
sourceResult.changes[sourceDocument.uri].push({
|
|
4260
4513
|
newText: tsEdit.newText,
|
|
@@ -4278,6 +4531,7 @@ var require_transform$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4278
4531
|
const virtualCode = decoded && sourceScript?.generated?.embeddedCodes.get(decoded[1]);
|
|
4279
4532
|
if (sourceScript && virtualCode) {
|
|
4280
4533
|
const embeddedDocument = context.documents.get(context.encodeEmbeddedDocumentUri(sourceScript.id, virtualCode.id), virtualCode.languageId, virtualCode.snapshot);
|
|
4534
|
+
for (const tsEdit of tsDocEdit.edits) unmappedEdits.add(tsEdit);
|
|
4281
4535
|
for (const [sourceScript, map] of context.language.maps.forEach(virtualCode)) {
|
|
4282
4536
|
const sourceDocument = context.documents.get(sourceScript.id, sourceScript.languageId, sourceScript.snapshot);
|
|
4283
4537
|
const docs = [
|
|
@@ -4298,18 +4552,24 @@ var require_transform$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4298
4552
|
_data = data;
|
|
4299
4553
|
return (0, language_core_1.isRenameEnabled)(data);
|
|
4300
4554
|
});
|
|
4301
|
-
if (range)
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4555
|
+
if (range) {
|
|
4556
|
+
unmappedEdits.delete(tsEdit);
|
|
4557
|
+
sourceEdit.edits.push({
|
|
4558
|
+
annotationId: "annotationId" in tsEdit ? tsEdit.annotationId : void 0,
|
|
4559
|
+
newText: (0, language_core_1.resolveRenameEditText)(tsEdit.newText, _data),
|
|
4560
|
+
range
|
|
4561
|
+
});
|
|
4562
|
+
}
|
|
4306
4563
|
} else {
|
|
4307
4564
|
const range = (0, featureWorkers_1.getSourceRange)(docs, tsEdit.range);
|
|
4308
|
-
if (range)
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4565
|
+
if (range) {
|
|
4566
|
+
unmappedEdits.delete(tsEdit);
|
|
4567
|
+
sourceEdit.edits.push({
|
|
4568
|
+
annotationId: "annotationId" in tsEdit ? tsEdit.annotationId : void 0,
|
|
4569
|
+
newText: tsEdit.newText,
|
|
4570
|
+
range
|
|
4571
|
+
});
|
|
4572
|
+
}
|
|
4313
4573
|
}
|
|
4314
4574
|
if (!sourceEdit.edits.length) sourceEdit = void 0;
|
|
4315
4575
|
}
|
|
@@ -4344,6 +4604,7 @@ var require_transform$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4344
4604
|
hasResult = true;
|
|
4345
4605
|
}
|
|
4346
4606
|
}
|
|
4607
|
+
if (mode === "codeAction" && unmappedEdits.size) return;
|
|
4347
4608
|
if (hasResult) return sourceResult;
|
|
4348
4609
|
}
|
|
4349
4610
|
function pushEditToDocumentChanges(arr, item) {
|
|
@@ -4558,6 +4819,13 @@ var init_main$3 = __esmMin((() => {
|
|
|
4558
4819
|
const startOffset = this.offsetAt(range.start);
|
|
4559
4820
|
const endOffset = this.offsetAt(range.end);
|
|
4560
4821
|
this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length);
|
|
4822
|
+
const insertedEndOffset = startOffset + change.text.length;
|
|
4823
|
+
const crlfAtStart = this._content.charCodeAt(startOffset - 1) === 13 && this._content.charCodeAt(startOffset) === 10;
|
|
4824
|
+
const crlfAtEnd = this._content.charCodeAt(insertedEndOffset - 1) === 13 && this._content.charCodeAt(insertedEndOffset) === 10;
|
|
4825
|
+
if (crlfAtStart || crlfAtEnd) {
|
|
4826
|
+
this._lineOffsets = void 0;
|
|
4827
|
+
continue;
|
|
4828
|
+
}
|
|
4561
4829
|
const startLine = Math.max(range.start.line, 0);
|
|
4562
4830
|
const endLine = Math.max(range.end.line, 0);
|
|
4563
4831
|
let lineOffsets = this._lineOffsets;
|
|
@@ -5096,6 +5364,7 @@ var require_provideCompletionItems = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
5096
5364
|
function register(context) {
|
|
5097
5365
|
let lastResult;
|
|
5098
5366
|
return async (uri, position, completionContext = { triggerKind: 1 }, token = cancellation_1.NoneCancellationToken) => {
|
|
5367
|
+
let currentResult;
|
|
5099
5368
|
let langaugeIdAndSnapshot;
|
|
5100
5369
|
let sourceScript;
|
|
5101
5370
|
const decoded = context.decodeEmbeddedDocumentUri(uri);
|
|
@@ -5108,59 +5377,61 @@ var require_provideCompletionItems = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
5108
5377
|
isIncomplete: false,
|
|
5109
5378
|
items: []
|
|
5110
5379
|
};
|
|
5111
|
-
if (completionContext?.triggerKind === 3 && lastResult?.uri.toString() === uri.toString())
|
|
5112
|
-
|
|
5113
|
-
const
|
|
5114
|
-
|
|
5115
|
-
const
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
const
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5380
|
+
if (completionContext?.triggerKind === 3 && lastResult?.uri.toString() === uri.toString()) {
|
|
5381
|
+
currentResult = lastResult;
|
|
5382
|
+
for (const cacheData of currentResult.results) {
|
|
5383
|
+
if (!cacheData.list?.isIncomplete) continue;
|
|
5384
|
+
const pluginIndex = context.plugins.findIndex((plugin) => plugin[1] === cacheData.plugin);
|
|
5385
|
+
if (cacheData.embeddedDocumentUri) {
|
|
5386
|
+
const decoded = context.decodeEmbeddedDocumentUri(cacheData.embeddedDocumentUri);
|
|
5387
|
+
const sourceScript = decoded && context.language.scripts.get(decoded[0]);
|
|
5388
|
+
const virtualCode = decoded && sourceScript?.generated?.embeddedCodes.get(decoded[1]);
|
|
5389
|
+
if (!sourceScript || !virtualCode) continue;
|
|
5390
|
+
const embeddedDocument = context.documents.get(context.encodeEmbeddedDocumentUri(sourceScript.id, virtualCode.id), virtualCode.languageId, virtualCode.snapshot);
|
|
5391
|
+
for (const [sourceScript, map] of context.language.maps.forEach(virtualCode)) {
|
|
5392
|
+
const docs = [
|
|
5393
|
+
context.documents.get(sourceScript.id, sourceScript.languageId, sourceScript.snapshot),
|
|
5394
|
+
embeddedDocument,
|
|
5395
|
+
map
|
|
5396
|
+
];
|
|
5397
|
+
for (const mapped of (0, featureWorkers_1.getGeneratedPositions)(docs, position, (data) => (0, language_core_1.isCompletionEnabled)(data))) {
|
|
5398
|
+
if (!cacheData.plugin.provideCompletionItems) continue;
|
|
5399
|
+
cacheData.list = await cacheData.plugin.provideCompletionItems(embeddedDocument, mapped, completionContext, token);
|
|
5400
|
+
if (!cacheData.list) continue;
|
|
5401
|
+
for (const item of cacheData.list.items) if (cacheData.plugin.resolveCompletionItem) item.data = {
|
|
5402
|
+
uri: uri.toString(),
|
|
5403
|
+
original: {
|
|
5404
|
+
additionalTextEdits: item.additionalTextEdits,
|
|
5405
|
+
textEdit: item.textEdit,
|
|
5406
|
+
data: item.data
|
|
5407
|
+
},
|
|
5408
|
+
pluginIndex,
|
|
5409
|
+
embeddedDocumentUri: embeddedDocument.uri
|
|
5410
|
+
};
|
|
5411
|
+
else delete item.data;
|
|
5412
|
+
cacheData.list = (0, transform_1.transformCompletionList)(cacheData.list, (range) => (0, featureWorkers_1.getSourceRange)(docs, range), embeddedDocument, context);
|
|
5413
|
+
}
|
|
5142
5414
|
}
|
|
5415
|
+
} else {
|
|
5416
|
+
if (!cacheData.plugin.provideCompletionItems) continue;
|
|
5417
|
+
const document = context.documents.get(uri, langaugeIdAndSnapshot.languageId, langaugeIdAndSnapshot.snapshot);
|
|
5418
|
+
cacheData.list = await cacheData.plugin.provideCompletionItems(document, position, completionContext, token);
|
|
5419
|
+
if (!cacheData.list) continue;
|
|
5420
|
+
for (const item of cacheData.list.items) if (cacheData.plugin.resolveCompletionItem) item.data = {
|
|
5421
|
+
uri: uri.toString(),
|
|
5422
|
+
original: {
|
|
5423
|
+
additionalTextEdits: item.additionalTextEdits,
|
|
5424
|
+
textEdit: item.textEdit,
|
|
5425
|
+
data: item.data
|
|
5426
|
+
},
|
|
5427
|
+
pluginIndex,
|
|
5428
|
+
embeddedDocumentUri: void 0
|
|
5429
|
+
};
|
|
5430
|
+
else delete item.data;
|
|
5143
5431
|
}
|
|
5144
|
-
} else {
|
|
5145
|
-
if (!cacheData.plugin.provideCompletionItems) continue;
|
|
5146
|
-
const document = context.documents.get(uri, langaugeIdAndSnapshot.languageId, langaugeIdAndSnapshot.snapshot);
|
|
5147
|
-
cacheData.list = await cacheData.plugin.provideCompletionItems(document, position, completionContext, token);
|
|
5148
|
-
if (!cacheData.list) continue;
|
|
5149
|
-
for (const item of cacheData.list.items) if (cacheData.plugin.resolveCompletionItem) item.data = {
|
|
5150
|
-
uri: uri.toString(),
|
|
5151
|
-
original: {
|
|
5152
|
-
additionalTextEdits: item.additionalTextEdits,
|
|
5153
|
-
textEdit: item.textEdit,
|
|
5154
|
-
data: item.data
|
|
5155
|
-
},
|
|
5156
|
-
pluginIndex,
|
|
5157
|
-
embeddedDocumentUri: void 0
|
|
5158
|
-
};
|
|
5159
|
-
else delete item.data;
|
|
5160
5432
|
}
|
|
5161
|
-
}
|
|
5162
|
-
|
|
5163
|
-
lastResult = {
|
|
5433
|
+
} else {
|
|
5434
|
+
currentResult = lastResult = {
|
|
5164
5435
|
uri,
|
|
5165
5436
|
results: []
|
|
5166
5437
|
};
|
|
@@ -5175,7 +5446,7 @@ var require_provideCompletionItems = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
5175
5446
|
if (completionContext?.triggerCharacter && !plugin[0].capabilities.completionProvider?.triggerCharacters?.includes(completionContext.triggerCharacter)) continue;
|
|
5176
5447
|
const isAdditional = codeInfo && typeof codeInfo.completion === "object" && codeInfo.completion.isAdditional || plugin[1].isAdditionalCompletion;
|
|
5177
5448
|
if (mainCompletionUri && (!isAdditional || mainCompletionUri !== document.uri)) continue;
|
|
5178
|
-
if (plugin[1].isAdditionalCompletion &&
|
|
5449
|
+
if (plugin[1].isAdditionalCompletion && currentResult.results.some((data) => data.plugin === plugin[1])) continue;
|
|
5179
5450
|
let completionList = await plugin[1].provideCompletionItems(document, position, completionContext, token);
|
|
5180
5451
|
if (!completionList || !completionList.items.length) continue;
|
|
5181
5452
|
if (typeof codeInfo?.completion === "object" && codeInfo.completion.onlyImport) completionList.items = completionList.items.filter((item) => !!item.labelDetails);
|
|
@@ -5193,7 +5464,7 @@ var require_provideCompletionItems = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
5193
5464
|
};
|
|
5194
5465
|
else delete item.data;
|
|
5195
5466
|
if (docs) completionList = (0, transform_1.transformCompletionList)(completionList, (range) => (0, featureWorkers_1.getSourceRange)(docs, range, language_core_1.isCompletionEnabled), document, context);
|
|
5196
|
-
|
|
5467
|
+
currentResult.results.push({
|
|
5197
5468
|
embeddedDocumentUri: docs ? vscode_uri_1.URI.parse(document.uri) : void 0,
|
|
5198
5469
|
plugin: plugin[1],
|
|
5199
5470
|
list: completionList
|
|
@@ -5210,7 +5481,7 @@ var require_provideCompletionItems = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
5210
5481
|
}
|
|
5211
5482
|
else await worker(context.documents.get(uri, langaugeIdAndSnapshot.languageId, langaugeIdAndSnapshot.snapshot), position);
|
|
5212
5483
|
}
|
|
5213
|
-
return combineCompletionList(
|
|
5484
|
+
return combineCompletionList(currentResult.results.map((cacheData) => cacheData.list));
|
|
5214
5485
|
function sortServices(a, b) {
|
|
5215
5486
|
return (b.isAdditionalCompletion ? -1 : 1) - (a.isAdditionalCompletion ? -1 : 1);
|
|
5216
5487
|
}
|
|
@@ -6674,7 +6945,7 @@ var require_resolveCodeAction = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6674
6945
|
item = await plugin[1].resolveCodeAction(item, token);
|
|
6675
6946
|
item = plugin[1].transformCodeAction?.(item) ?? (item.edit ? {
|
|
6676
6947
|
...item,
|
|
6677
|
-
edit: (0, transform_1.transformWorkspaceEdit)(item.edit, context, "codeAction"
|
|
6948
|
+
edit: (0, transform_1.transformWorkspaceEdit)(item.edit, context, "codeAction")
|
|
6678
6949
|
} : item);
|
|
6679
6950
|
}
|
|
6680
6951
|
delete item.data;
|
|
@@ -7154,16 +7425,27 @@ var require_resolveModuleName$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
7154
7425
|
};
|
|
7155
7426
|
return (moduleName, containingFile, compilerOptions, cache, redirectedReference, resolutionMode) => {
|
|
7156
7427
|
const result = ts.resolveModuleName(moduleName, containingFile, compilerOptions, moduleResolutionHost, cache, redirectedReference, resolutionMode);
|
|
7157
|
-
|
|
7158
|
-
|
|
7428
|
+
const resolvedModule = result.resolvedModule;
|
|
7429
|
+
if (resolvedModule) {
|
|
7430
|
+
const sourceFileInfo = toSourceFileInfo.get(resolvedModule.resolvedFileName);
|
|
7159
7431
|
if (sourceFileInfo) {
|
|
7160
|
-
|
|
7161
|
-
|
|
7432
|
+
resolvedModule.resolvedFileName = sourceFileInfo.sourceFileName;
|
|
7433
|
+
resolvedModule.extension = sourceFileInfo.extension;
|
|
7434
|
+
if (!compilerOptions.preserveSymlinks && host.realpath && resolvedModule.isExternalLibraryImport && !resolvedModule.originalPath && !ts.isExternalModuleNameRelative(moduleName)) {
|
|
7435
|
+
const realPath = host.realpath(sourceFileInfo.sourceFileName).replace(/\\/g, "/");
|
|
7436
|
+
if (!isSamePath(realPath, sourceFileInfo.sourceFileName)) {
|
|
7437
|
+
resolvedModule.originalPath = sourceFileInfo.sourceFileName;
|
|
7438
|
+
resolvedModule.resolvedFileName = realPath;
|
|
7439
|
+
}
|
|
7440
|
+
}
|
|
7162
7441
|
}
|
|
7163
7442
|
}
|
|
7164
7443
|
toSourceFileInfo.clear();
|
|
7165
7444
|
return result;
|
|
7166
7445
|
};
|
|
7446
|
+
function isSamePath(a, b) {
|
|
7447
|
+
return (typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames) ? a === b : a.toLowerCase() === b.toLowerCase();
|
|
7448
|
+
}
|
|
7167
7449
|
function fileExists(fileName) {
|
|
7168
7450
|
if (host.fileExists(fileName)) return (getFileSize?.(fileName) ?? host.readFile(fileName)?.length ?? 0) < 4194304;
|
|
7169
7451
|
return false;
|
|
@@ -7248,22 +7530,30 @@ var require_decorateLanguageServiceHost = /* @__PURE__ */ __commonJSMin(((export
|
|
|
7248
7530
|
if (pluginExtensions.length) {
|
|
7249
7531
|
const resolveModuleName = (0, resolveModuleName_1.createResolveModuleName)(ts, ts.sys.getFileSize, languageServiceHost, language.plugins, (fileName) => language.scripts.get(fileName));
|
|
7250
7532
|
const moduleResolutionCache = languageServiceHost.getModuleResolutionCache?.();
|
|
7533
|
+
const hasPluginExtension = (moduleName) => pluginExtensions.some((ext) => moduleName.endsWith(ext));
|
|
7251
7534
|
if (resolveModuleNameLiterals) languageServiceHost.resolveModuleNameLiterals = (moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, ...rest) => {
|
|
7252
7535
|
const disposeFixup = (0, utils_1.fixupImpliedNodeFormatForFile)(ts, pluginExtensions, containingSourceFile, moduleResolutionCache?.getPackageJsonInfoCache(), languageServiceHost, options);
|
|
7253
7536
|
try {
|
|
7254
|
-
|
|
7537
|
+
const hostLiterals = moduleLiterals.filter((literal) => !hasPluginExtension(literal.text));
|
|
7538
|
+
const hostResults = hostLiterals.length ? resolveModuleNameLiterals(hostLiterals, containingFile, redirectedReference, options, containingSourceFile, ...rest) : [];
|
|
7539
|
+
const hostResultMap = new Map(hostLiterals.map((literal, i) => [literal, hostResults[i]]));
|
|
7255
7540
|
return moduleLiterals.map((moduleLiteral) => {
|
|
7541
|
+
const hostResult = hostResultMap.get(moduleLiteral);
|
|
7542
|
+
if (hostResult?.resolvedModule) return hostResult;
|
|
7256
7543
|
const mode = ts.getModeForUsageLocation(containingSourceFile, moduleLiteral, options);
|
|
7257
|
-
|
|
7544
|
+
const result = resolveModuleName(moduleLiteral.text, containingFile, options, hostResult ? void 0 : moduleResolutionCache, redirectedReference, mode);
|
|
7545
|
+
return hostResult && !result.resolvedModule ? hostResult : result;
|
|
7258
7546
|
});
|
|
7259
7547
|
} finally {
|
|
7260
7548
|
disposeFixup?.();
|
|
7261
7549
|
}
|
|
7262
7550
|
};
|
|
7263
7551
|
if (resolveModuleNames) languageServiceHost.resolveModuleNames = (moduleNames, containingFile, reusedNames, redirectedReference, options, containingSourceFile) => {
|
|
7264
|
-
|
|
7552
|
+
const hostNames = moduleNames.filter((name) => !hasPluginExtension(name));
|
|
7553
|
+
const hostResults = hostNames.length ? resolveModuleNames(hostNames, containingFile, reusedNames, redirectedReference, options, containingSourceFile) : [];
|
|
7554
|
+
const hostResultMap = new Map(hostNames.map((name, i) => [name, hostResults[i]]));
|
|
7265
7555
|
return moduleNames.map((moduleName) => {
|
|
7266
|
-
return resolveModuleName(moduleName, containingFile, options, moduleResolutionCache, redirectedReference).resolvedModule;
|
|
7556
|
+
return hostResultMap.get(moduleName) ?? resolveModuleName(moduleName, containingFile, options, hostResultMap.has(moduleName) ? void 0 : moduleResolutionCache, redirectedReference).resolvedModule;
|
|
7267
7557
|
});
|
|
7268
7558
|
};
|
|
7269
7559
|
}
|
|
@@ -7411,18 +7701,19 @@ var require_transform$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
7411
7701
|
sourceFile.text = sourceScript.snapshot.getText(0, sourceScript.snapshot.getLength()) + sourceFile.text.substring(sourceScript.snapshot.getLength());
|
|
7412
7702
|
}
|
|
7413
7703
|
}
|
|
7414
|
-
function transformFileTextChanges(language, changes, fallbackToAnyMatch, filter) {
|
|
7704
|
+
function transformFileTextChanges(language, changes, fallbackToAnyMatch, filter, allOrNothing = false) {
|
|
7415
7705
|
const changesPerFile = {};
|
|
7416
7706
|
const newFiles = /* @__PURE__ */ new Set();
|
|
7417
7707
|
for (const fileChanges of changes) {
|
|
7418
7708
|
const [_, source] = (0, utils_1.getServiceScript)(language, fileChanges.fileName);
|
|
7419
|
-
if (source) fileChanges.textChanges
|
|
7709
|
+
if (source) for (const c of fileChanges.textChanges) {
|
|
7420
7710
|
const { fileName, textSpan } = transformSpan(language, fileChanges.fileName, c.span, fallbackToAnyMatch, filter) ?? {};
|
|
7421
7711
|
if (fileName && textSpan) (changesPerFile[fileName] ?? (changesPerFile[fileName] = [])).push({
|
|
7422
7712
|
...c,
|
|
7423
7713
|
span: textSpan
|
|
7424
7714
|
});
|
|
7425
|
-
|
|
7715
|
+
else if (allOrNothing) return;
|
|
7716
|
+
}
|
|
7426
7717
|
else {
|
|
7427
7718
|
const list = changesPerFile[fileChanges.fileName] ?? (changesPerFile[fileChanges.fileName] = []);
|
|
7428
7719
|
fileChanges.textChanges.forEach((c) => {
|
|
@@ -7591,6 +7882,7 @@ var require_decorateProgram = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
7591
7882
|
var require_proxyCreateProgram = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
7592
7883
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7593
7884
|
exports.proxyCreateProgram = proxyCreateProgram;
|
|
7885
|
+
exports.releaseRemovedProjects = releaseRemovedProjects;
|
|
7594
7886
|
var language_core_1 = require_language_core$1();
|
|
7595
7887
|
var common_1 = require_common$3();
|
|
7596
7888
|
var resolveModuleName_1 = require_resolveModuleName$1();
|
|
@@ -7608,23 +7900,24 @@ var require_proxyCreateProgram = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
7608
7900
|
for (const key of keysA) if (a[key] !== b[key]) return false;
|
|
7609
7901
|
return true;
|
|
7610
7902
|
};
|
|
7903
|
+
var projectStateReleasers = /* @__PURE__ */ new WeakMap();
|
|
7611
7904
|
function proxyCreateProgram(ts, original, create) {
|
|
7612
7905
|
const sourceFileSnapshots = new language_core_1.FileMap(ts.sys.useCaseSensitiveFileNames);
|
|
7613
7906
|
const parsedSourceFiles = /* @__PURE__ */ new WeakMap();
|
|
7614
|
-
|
|
7615
|
-
let
|
|
7616
|
-
|
|
7617
|
-
let moduleResolutionCache;
|
|
7618
|
-
return new Proxy(original, { apply: (target, thisArg, args) => {
|
|
7907
|
+
const states = /* @__PURE__ */ new Map();
|
|
7908
|
+
let fileSetVersion = 0;
|
|
7909
|
+
const proxy = new Proxy(original, { apply: (target, thisArg, args) => {
|
|
7619
7910
|
const options = args[0];
|
|
7620
7911
|
assert(!!options.host, "!!options.host");
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7912
|
+
const configFilePath = options.options.configFilePath;
|
|
7913
|
+
const stateKey = typeof configFilePath === "string" ? options.host.getCanonicalFileName(configFilePath) : void 0;
|
|
7914
|
+
let state = states.get(stateKey);
|
|
7915
|
+
if (!state || !arrayEqual(options.rootNames, state.options.rootNames) || !objectEqual(options.options, state.options.options)) {
|
|
7916
|
+
if (state) fileSetVersion++;
|
|
7917
|
+
const moduleResolutionCache = createModuleResolutionCache(options.host, options.options);
|
|
7624
7918
|
const created = create(ts, options);
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
language = (0, language_core_1.createLanguage)([...languagePlugins, { getLanguageId: common_1.resolveFileLanguageId }], new language_core_1.FileMap(ts.sys.useCaseSensitiveFileNames), (fileName, includeFsFiles) => {
|
|
7919
|
+
const languagePlugins = Array.isArray(created) ? created : created.languagePlugins;
|
|
7920
|
+
const language = (0, language_core_1.createLanguage)([...languagePlugins, { getLanguageId: common_1.resolveFileLanguageId }], new language_core_1.FileMap(ts.sys.useCaseSensitiveFileNames), (fileName, includeFsFiles) => {
|
|
7628
7921
|
if (includeFsFiles && !sourceFileSnapshots.has(fileName)) {
|
|
7629
7922
|
const sourceFileText = originalHost.readFile(fileName);
|
|
7630
7923
|
if (sourceFileText !== void 0) sourceFileSnapshots.set(fileName, [void 0, {
|
|
@@ -7643,10 +7936,25 @@ var require_proxyCreateProgram = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
7643
7936
|
else language.scripts.delete(fileName);
|
|
7644
7937
|
});
|
|
7645
7938
|
if ("setup" in created) created.setup?.(language);
|
|
7939
|
+
state = {
|
|
7940
|
+
options,
|
|
7941
|
+
languagePlugins,
|
|
7942
|
+
language,
|
|
7943
|
+
moduleResolutionCache,
|
|
7944
|
+
fileSetVersion
|
|
7945
|
+
};
|
|
7946
|
+
states.set(stateKey, state);
|
|
7947
|
+
} else if (state.fileSetVersion !== fileSetVersion) {
|
|
7948
|
+
state.moduleResolutionCache = createModuleResolutionCache(options.host, options.options);
|
|
7949
|
+
state.fileSetVersion = fileSetVersion;
|
|
7646
7950
|
}
|
|
7951
|
+
const { languagePlugins, language, moduleResolutionCache } = state;
|
|
7647
7952
|
const originalHost = options.host;
|
|
7648
7953
|
const pluginExtensions = languagePlugins.map((plugin) => plugin.typescript?.extraFileExtensions.map(({ extension }) => `.${extension}`) ?? []).flat();
|
|
7649
|
-
options.host = {
|
|
7954
|
+
options.host = {
|
|
7955
|
+
...originalHost,
|
|
7956
|
+
getSourceFileByPath: void 0
|
|
7957
|
+
};
|
|
7650
7958
|
options.host.getSourceFile = (fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) => {
|
|
7651
7959
|
const originalSourceFile = originalHost.getSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile);
|
|
7652
7960
|
if (!sourceFileSnapshots.has(fileName) || sourceFileSnapshots.get(fileName)?.[0] !== originalSourceFile) {
|
|
@@ -7688,10 +7996,11 @@ var require_proxyCreateProgram = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
7688
7996
|
const resolveModuleName = (0, resolveModuleName_1.createResolveModuleName)(ts, ts.sys.getFileSize, originalHost, language.plugins, (fileName) => language.scripts.get(fileName));
|
|
7689
7997
|
const resolveModuleNameLiterals = originalHost.resolveModuleNameLiterals;
|
|
7690
7998
|
const resolveModuleNames = originalHost.resolveModuleNames;
|
|
7999
|
+
const hasResolveHiddenExtensions = languagePlugins.some((plugin) => plugin.typescript?.resolveHiddenExtensions);
|
|
7691
8000
|
options.host.resolveModuleNameLiterals = (moduleLiterals, containingFile, redirectedReference, compilerOptions, containingSourceFile, ...rest) => {
|
|
7692
8001
|
const disposeFixup = (0, utils_1.fixupImpliedNodeFormatForFile)(ts, pluginExtensions, containingSourceFile, moduleResolutionCache.getPackageJsonInfoCache(), originalHost, compilerOptions);
|
|
7693
8002
|
try {
|
|
7694
|
-
if (resolveModuleNameLiterals && moduleLiterals.every((name) => !pluginExtensions.some((ext) => name.text.endsWith(ext)))) return resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, compilerOptions, containingSourceFile, ...rest);
|
|
8003
|
+
if (resolveModuleNameLiterals && !hasResolveHiddenExtensions && moduleLiterals.every((name) => !pluginExtensions.some((ext) => name.text.endsWith(ext)))) return resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, compilerOptions, containingSourceFile, ...rest);
|
|
7695
8004
|
return moduleLiterals.map((moduleLiteral) => {
|
|
7696
8005
|
const mode = ts.getModeForUsageLocation(containingSourceFile, moduleLiteral, compilerOptions);
|
|
7697
8006
|
return resolveModuleName(moduleLiteral.text, containingFile, compilerOptions, moduleResolutionCache, redirectedReference, mode);
|
|
@@ -7701,7 +8010,7 @@ var require_proxyCreateProgram = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
7701
8010
|
}
|
|
7702
8011
|
};
|
|
7703
8012
|
options.host.resolveModuleNames = (moduleNames, containingFile, reusedNames, redirectedReference, compilerOptions, containingSourceFile) => {
|
|
7704
|
-
if (resolveModuleNames && moduleNames.every((name) => !pluginExtensions.some((ext) => name.endsWith(ext)))) return resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference, compilerOptions, containingSourceFile);
|
|
8013
|
+
if (resolveModuleNames && !hasResolveHiddenExtensions && moduleNames.every((name) => !pluginExtensions.some((ext) => name.endsWith(ext)))) return resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference, compilerOptions, containingSourceFile);
|
|
7705
8014
|
return moduleNames.map((moduleName) => {
|
|
7706
8015
|
return resolveModuleName(moduleName, containingFile, compilerOptions, moduleResolutionCache, redirectedReference, containingSourceFile?.impliedNodeFormat).resolvedModule;
|
|
7707
8016
|
});
|
|
@@ -7711,6 +8020,20 @@ var require_proxyCreateProgram = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
7711
8020
|
(0, decorateProgram_1.decorateProgram)(language, program);
|
|
7712
8021
|
return program;
|
|
7713
8022
|
} });
|
|
8023
|
+
function createModuleResolutionCache(host, options) {
|
|
8024
|
+
return ts.createModuleResolutionCache(host.getCurrentDirectory(), host.getCanonicalFileName, options);
|
|
8025
|
+
}
|
|
8026
|
+
projectStateReleasers.set(proxy, (isActiveProject) => {
|
|
8027
|
+
for (const key of states.keys()) if (key !== void 0 && !isActiveProject(key)) states.delete(key);
|
|
8028
|
+
});
|
|
8029
|
+
return proxy;
|
|
8030
|
+
}
|
|
8031
|
+
/**
|
|
8032
|
+
* Drops the state kept for projects that the solution builder no longer builds.
|
|
8033
|
+
* `isActiveProject` receives the canonical path of a project's config file.
|
|
8034
|
+
*/
|
|
8035
|
+
function releaseRemovedProjects(createProgram, isActiveProject) {
|
|
8036
|
+
projectStateReleasers.get(createProgram)?.(isActiveProject);
|
|
7714
8037
|
}
|
|
7715
8038
|
function assert(condition, message) {
|
|
7716
8039
|
if (!condition) {
|
|
@@ -7948,7 +8271,7 @@ var require_proxyLanguageService = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
7948
8271
|
function organizeImports(language, organizeImports) {
|
|
7949
8272
|
return (args, formatOptions, preferences) => {
|
|
7950
8273
|
const unresolved = organizeImports(args, formatOptions, preferences);
|
|
7951
|
-
return (0, transform_1.transformFileTextChanges)(language, unresolved, false, language_core_1.isCodeActionsEnabled);
|
|
8274
|
+
return (0, transform_1.transformFileTextChanges)(language, unresolved, false, language_core_1.isCodeActionsEnabled, true) ?? [];
|
|
7952
8275
|
};
|
|
7953
8276
|
}
|
|
7954
8277
|
function getQuickInfoAtPosition(language, getQuickInfoAtPosition) {
|
|
@@ -8085,15 +8408,18 @@ var require_proxyLanguageService = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
8085
8408
|
}, refactorName, actionName, preferences, interactiveRefactorArguments);
|
|
8086
8409
|
} else edits = getEditsForRefactor(fileName, formatOptions, positionOrRange, refactorName, actionName, preferences, interactiveRefactorArguments);
|
|
8087
8410
|
if (edits) {
|
|
8088
|
-
|
|
8089
|
-
|
|
8411
|
+
const transformed = (0, transform_1.transformFileTextChanges)(language, edits.edits, false, language_core_1.isCodeActionsEnabled, true);
|
|
8412
|
+
if (transformed) {
|
|
8413
|
+
edits.edits = transformed;
|
|
8414
|
+
return edits;
|
|
8415
|
+
}
|
|
8090
8416
|
}
|
|
8091
8417
|
};
|
|
8092
8418
|
}
|
|
8093
8419
|
function getCombinedCodeFix(language, getCombinedCodeFix) {
|
|
8094
8420
|
return (...args) => {
|
|
8095
8421
|
const codeActions = getCombinedCodeFix(...args);
|
|
8096
|
-
codeActions.changes = (0, transform_1.transformFileTextChanges)(language, codeActions.changes, false, language_core_1.isCodeActionsEnabled);
|
|
8422
|
+
codeActions.changes = (0, transform_1.transformFileTextChanges)(language, codeActions.changes, false, language_core_1.isCodeActionsEnabled, true) ?? [];
|
|
8097
8423
|
return codeActions;
|
|
8098
8424
|
};
|
|
8099
8425
|
}
|
|
@@ -8135,11 +8461,14 @@ var require_proxyLanguageService = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
8135
8461
|
const generateRange = (0, transform_1.toGeneratedRange)(language, serviceScript, sourceScript, start, end, language_core_1.isCodeActionsEnabled);
|
|
8136
8462
|
if (generateRange !== void 0) fixes = getCodeFixesAtPosition(targetScript.id, generateRange[0], generateRange[1], errorCodes, formatOptions, preferences);
|
|
8137
8463
|
} else fixes = getCodeFixesAtPosition(fileName, start, end, errorCodes, formatOptions, preferences);
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8464
|
+
return fixes.filter((fix) => {
|
|
8465
|
+
const changes = (0, transform_1.transformFileTextChanges)(language, fix.changes, false, language_core_1.isCodeActionsEnabled, true);
|
|
8466
|
+
if (changes) {
|
|
8467
|
+
fix.changes = changes;
|
|
8468
|
+
return true;
|
|
8469
|
+
}
|
|
8470
|
+
return false;
|
|
8141
8471
|
});
|
|
8142
|
-
return fixes;
|
|
8143
8472
|
};
|
|
8144
8473
|
}
|
|
8145
8474
|
function getEncodedSemanticClassifications(language, getEncodedSemanticClassifications) {
|
|
@@ -10719,8 +11048,6 @@ var require_codeFeatures = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
10719
11048
|
/** @internal */
|
|
10720
11049
|
format: { format: true },
|
|
10721
11050
|
/** @internal */
|
|
10722
|
-
doNotReportTs2339AndTs2551: { verification: { shouldReport: (_source, code) => String(code) !== "2339" && String(code) !== "2551" } },
|
|
10723
|
-
/** @internal */
|
|
10724
11051
|
doNotReportTs2353AndTs2561: { verification: { shouldReport: (_source, code) => String(code) !== "2353" && String(code) !== "2561" } },
|
|
10725
11052
|
/** @internal */
|
|
10726
11053
|
doNotReportTs6133: { verification: { shouldReport: (_source, code) => String(code) !== "6133" } }
|
|
@@ -10756,6 +11083,7 @@ var require_names = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
10756
11083
|
setup: "",
|
|
10757
11084
|
slots: "",
|
|
10758
11085
|
src: "",
|
|
11086
|
+
template: "",
|
|
10759
11087
|
Emit: "",
|
|
10760
11088
|
EmitProps: "",
|
|
10761
11089
|
GlobalComponents: "",
|
|
@@ -10778,6 +11106,7 @@ var require_names = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
10778
11106
|
asFunctionalElement1: "",
|
|
10779
11107
|
asFunctionalSlot: "",
|
|
10780
11108
|
directiveBindingRestFields: "",
|
|
11109
|
+
directiveHookArgsRest: "",
|
|
10781
11110
|
functionalComponentArgsRest: "",
|
|
10782
11111
|
nonNull: "",
|
|
10783
11112
|
omit: "",
|
|
@@ -10789,9 +11118,12 @@ var require_names = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
10789
11118
|
ConstructorOverloads: "",
|
|
10790
11119
|
Elements: "",
|
|
10791
11120
|
EmitsToProps: "",
|
|
11121
|
+
EventArgs: "",
|
|
10792
11122
|
ExtractComponentContext: "",
|
|
10793
11123
|
ExtractComponentProps: "",
|
|
10794
11124
|
FunctionalComponent: "",
|
|
11125
|
+
HandlerArgs: "",
|
|
11126
|
+
HandlerParameters: "",
|
|
10795
11127
|
IsAny: "",
|
|
10796
11128
|
IsFunction: "",
|
|
10797
11129
|
NormalizeEmits: "",
|
|
@@ -16328,6 +16660,37 @@ var init_compiler_dom_esm_bundler = __esmMin((() => {
|
|
|
16328
16660
|
show: transformShow
|
|
16329
16661
|
};
|
|
16330
16662
|
}));
|
|
16663
|
+
// node_modules/@vue/language-core/lib/codegen/utils/camelized.js
|
|
16664
|
+
var require_camelized = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
16665
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16666
|
+
exports.generateCamelized = generateCamelized;
|
|
16667
|
+
var shared_1 = (init_shared_esm_bundler(), __toCommonJS$1(shared_esm_bundler_exports));
|
|
16668
|
+
function* generateCamelized(code, source, offset, features) {
|
|
16669
|
+
const parts = code.split("-");
|
|
16670
|
+
if (!features.__combineToken) features = {
|
|
16671
|
+
...features,
|
|
16672
|
+
__combineToken: Symbol()
|
|
16673
|
+
};
|
|
16674
|
+
for (let i = 0; i < parts.length; i++) {
|
|
16675
|
+
const part = parts[i];
|
|
16676
|
+
if (part !== "") {
|
|
16677
|
+
if (i === 0) yield [
|
|
16678
|
+
part,
|
|
16679
|
+
source,
|
|
16680
|
+
offset,
|
|
16681
|
+
features
|
|
16682
|
+
];
|
|
16683
|
+
else yield [
|
|
16684
|
+
(0, shared_1.capitalize)(part),
|
|
16685
|
+
source,
|
|
16686
|
+
offset,
|
|
16687
|
+
features
|
|
16688
|
+
];
|
|
16689
|
+
}
|
|
16690
|
+
offset += part.length + 1;
|
|
16691
|
+
}
|
|
16692
|
+
}
|
|
16693
|
+
}));
|
|
16331
16694
|
// node_modules/@vue/language-core/lib/codegen/template/context.js
|
|
16332
16695
|
var require_context$1 = /* @__PURE__ */ __commonJSMin(((exports, module, this$42) => {
|
|
16333
16696
|
var __createBinding = this$42 && this$42.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -16376,8 +16739,10 @@ var require_context$1 = /* @__PURE__ */ __commonJSMin(((exports, module, this$42
|
|
|
16376
16739
|
var language_core_1 = require_language_core$1();
|
|
16377
16740
|
var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS$1(compiler_dom_esm_bundler_exports)));
|
|
16378
16741
|
var codeFeatures_1 = require_codeFeatures();
|
|
16742
|
+
var names_1 = require_names();
|
|
16379
16743
|
var utils_1 = require_utils$5();
|
|
16380
16744
|
var boundary_1 = require_boundary();
|
|
16745
|
+
var camelized_1 = require_camelized();
|
|
16381
16746
|
var directiveCommentRE = /^<!--\s*@vue-(?<name>[-\w]+)\b(?<content>[\s\S]*)-->$/;
|
|
16382
16747
|
var reservedWords = /* @__PURE__ */ new Set([
|
|
16383
16748
|
"arguments",
|
|
@@ -16518,16 +16883,17 @@ var require_context$1 = /* @__PURE__ */ __commonJSMin(((exports, module, this$42
|
|
|
16518
16883
|
scopes.push(scope);
|
|
16519
16884
|
return scope;
|
|
16520
16885
|
}
|
|
16886
|
+
/** Per name and source, the offsets of the accesses and their source text, which may be the hyphenated name. */
|
|
16521
16887
|
const contextAccesses = /* @__PURE__ */ new Map();
|
|
16522
16888
|
const dotValueAccesses = /* @__PURE__ */ new Set();
|
|
16523
16889
|
const accessLog = [];
|
|
16524
|
-
function accessVariable(source, name, offset, dotValue = false) {
|
|
16890
|
+
function accessVariable(source, name, offset, dotValue = false, sourceName = name) {
|
|
16525
16891
|
accessLog.push(name);
|
|
16526
16892
|
let map = contextAccesses.get(name);
|
|
16527
16893
|
if (!map) contextAccesses.set(name, map = /* @__PURE__ */ new Map());
|
|
16528
16894
|
let arr = map.get(source);
|
|
16529
|
-
if (!arr) map.set(source, arr = /* @__PURE__ */ new
|
|
16530
|
-
if (offset !== void 0) arr.
|
|
16895
|
+
if (!arr) map.set(source, arr = /* @__PURE__ */ new Map());
|
|
16896
|
+
if (offset !== void 0) arr.set(offset, sourceName);
|
|
16531
16897
|
if (dotValue) dotValueAccesses.add(name);
|
|
16532
16898
|
}
|
|
16533
16899
|
function* generateAutoImport() {
|
|
@@ -16536,13 +16902,8 @@ var require_context$1 = /* @__PURE__ */ __commonJSMin(((exports, module, this$42
|
|
|
16536
16902
|
yield `// @ts-ignore${utils_1.newLine}`;
|
|
16537
16903
|
yield `[`;
|
|
16538
16904
|
for (const [varName, map] of all) for (const [source, offsets] of map) {
|
|
16539
|
-
if (!reservedWords.has(varName)) for (const offset of offsets) {
|
|
16540
|
-
yield
|
|
16541
|
-
varName,
|
|
16542
|
-
source,
|
|
16543
|
-
offset,
|
|
16544
|
-
codeFeatures_1.codeFeatures.importCompletionOnly
|
|
16545
|
-
];
|
|
16905
|
+
if (!reservedWords.has(varName)) for (const [offset, sourceName] of offsets) {
|
|
16906
|
+
yield* (0, camelized_1.generateCamelized)(sourceName, source, offset, codeFeatures_1.codeFeatures.importCompletionOnly);
|
|
16546
16907
|
yield `,`;
|
|
16547
16908
|
}
|
|
16548
16909
|
offsets.clear();
|
|
@@ -16562,14 +16923,15 @@ var require_context$1 = /* @__PURE__ */ __commonJSMin(((exports, module, this$42
|
|
|
16562
16923
|
if (name === void 0) hoistVars.set(originalVar, name = `__VLS_${variableId++}`);
|
|
16563
16924
|
return name;
|
|
16564
16925
|
}
|
|
16565
|
-
function* generateHoistVariables() {
|
|
16926
|
+
function* generateHoistVariables(scriptLang) {
|
|
16566
16927
|
if (hoistVars.size) {
|
|
16928
|
+
const isTs = (0, utils_1.isTsLang)(scriptLang);
|
|
16567
16929
|
yield `var `;
|
|
16568
16930
|
let first = true;
|
|
16569
16931
|
for (const [originalVar, hoistVar] of hoistVars) {
|
|
16570
16932
|
if (!first) yield `, `;
|
|
16571
16933
|
first = false;
|
|
16572
|
-
yield `${hoistVar} = ${originalVar}
|
|
16934
|
+
yield isTs ? `${hoistVar} = ${originalVar}!` : `${hoistVar} = ${names_1.names.nonNull}(${originalVar})`;
|
|
16573
16935
|
}
|
|
16574
16936
|
yield utils_1.endOfLine;
|
|
16575
16937
|
}
|
|
@@ -16616,37 +16978,6 @@ var require_context$1 = /* @__PURE__ */ __commonJSMin(((exports, module, this$42
|
|
|
16616
16978
|
};
|
|
16617
16979
|
}
|
|
16618
16980
|
}));
|
|
16619
|
-
// node_modules/@vue/language-core/lib/codegen/utils/camelized.js
|
|
16620
|
-
var require_camelized = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
16621
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16622
|
-
exports.generateCamelized = generateCamelized;
|
|
16623
|
-
var shared_1 = (init_shared_esm_bundler(), __toCommonJS$1(shared_esm_bundler_exports));
|
|
16624
|
-
function* generateCamelized(code, source, offset, features) {
|
|
16625
|
-
const parts = code.split("-");
|
|
16626
|
-
if (!features.__combineToken) features = {
|
|
16627
|
-
...features,
|
|
16628
|
-
__combineToken: Symbol()
|
|
16629
|
-
};
|
|
16630
|
-
for (let i = 0; i < parts.length; i++) {
|
|
16631
|
-
const part = parts[i];
|
|
16632
|
-
if (part !== "") {
|
|
16633
|
-
if (i === 0) yield [
|
|
16634
|
-
part,
|
|
16635
|
-
source,
|
|
16636
|
-
offset,
|
|
16637
|
-
features
|
|
16638
|
-
];
|
|
16639
|
-
else yield [
|
|
16640
|
-
(0, shared_1.capitalize)(part),
|
|
16641
|
-
source,
|
|
16642
|
-
offset,
|
|
16643
|
-
features
|
|
16644
|
-
];
|
|
16645
|
-
}
|
|
16646
|
-
offset += part.length + 1;
|
|
16647
|
-
}
|
|
16648
|
-
}
|
|
16649
|
-
}));
|
|
16650
16981
|
// node_modules/@vue/language-core/lib/codegen/utils/stringLiteralKey.js
|
|
16651
16982
|
var require_stringLiteralKey = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
16652
16983
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -17046,13 +17377,82 @@ var require_interpolation = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17046
17377
|
var bindingReferences_1 = require_bindingReferences();
|
|
17047
17378
|
function* generateInterpolation(options, ctx, block, features, code, start, prefix = "", suffix = "", inNarrowing = false) {
|
|
17048
17379
|
if (prefix) yield prefix;
|
|
17380
|
+
const bodies = options.reassertBindings?.size && !utils_1.identifierRE.test(code) ? collectFunctionBodies(options.typescript, (0, utils_1.getTypeScriptAST)(options.typescript, block, prefix + code + suffix)).map((body) => ({
|
|
17381
|
+
...body,
|
|
17382
|
+
start: body.start - prefix.length,
|
|
17383
|
+
end: body.end - prefix.length
|
|
17384
|
+
})) : [];
|
|
17385
|
+
const marks = [...bodies.map((body) => ({
|
|
17386
|
+
offset: body.end,
|
|
17387
|
+
body,
|
|
17388
|
+
enter: false
|
|
17389
|
+
})).reverse(), ...bodies.map((body) => ({
|
|
17390
|
+
offset: body.start,
|
|
17391
|
+
body,
|
|
17392
|
+
enter: true
|
|
17393
|
+
}))].sort((a, b) => a.offset - b.offset);
|
|
17394
|
+
const frames = [];
|
|
17395
|
+
let markIndex = 0;
|
|
17396
|
+
function* write(codes) {
|
|
17397
|
+
if (frames.length) frames[frames.length - 1].codes.push(...codes);
|
|
17398
|
+
else yield* codes;
|
|
17399
|
+
}
|
|
17400
|
+
function* generateCodeUntil(from, end) {
|
|
17401
|
+
while (markIndex < marks.length && marks[markIndex].offset <= end) {
|
|
17402
|
+
const { offset, body, enter } = marks[markIndex++];
|
|
17403
|
+
yield* write(generateNonIdentifierCode(code.slice(from, offset), block.name, start + from, features, from > 0));
|
|
17404
|
+
from = offset;
|
|
17405
|
+
if (enter) frames.push({
|
|
17406
|
+
body,
|
|
17407
|
+
codes: [],
|
|
17408
|
+
reasserts: /* @__PURE__ */ new Set()
|
|
17409
|
+
});
|
|
17410
|
+
else yield* write(generateFunctionBody(frames.pop()));
|
|
17411
|
+
}
|
|
17412
|
+
yield* write(generateNonIdentifierCode(code.slice(from, end), block.name, start + from, features, from > 0));
|
|
17413
|
+
}
|
|
17414
|
+
function* generateFunctionBody({ body, codes, reasserts }) {
|
|
17415
|
+
if (!reasserts.size) {
|
|
17416
|
+
yield* codes;
|
|
17417
|
+
return;
|
|
17418
|
+
}
|
|
17419
|
+
if (body.kind === "block") {
|
|
17420
|
+
yield utils_1.newLine;
|
|
17421
|
+
yield* generateReasserts(reasserts);
|
|
17422
|
+
yield* codes;
|
|
17423
|
+
return;
|
|
17424
|
+
}
|
|
17425
|
+
const verification = { verification: features.verification };
|
|
17426
|
+
if (body.kind === "parameter") {
|
|
17427
|
+
const boundary = yield* boundary_1.Boundary.start(block.name, start + body.start, start + body.end, verification);
|
|
17428
|
+
yield `(() => {${utils_1.newLine}`;
|
|
17429
|
+
yield* generateReasserts(reasserts);
|
|
17430
|
+
yield `return (`;
|
|
17431
|
+
yield* codes;
|
|
17432
|
+
yield `)${utils_1.endOfLine}})()`;
|
|
17433
|
+
yield boundary.end();
|
|
17434
|
+
} else {
|
|
17435
|
+
yield `{${utils_1.newLine}`;
|
|
17436
|
+
yield* generateReasserts(reasserts);
|
|
17437
|
+
const boundary = yield* boundary_1.Boundary.start(block.name, start + body.start, start + body.end, verification);
|
|
17438
|
+
yield `return`;
|
|
17439
|
+
yield boundary.end();
|
|
17440
|
+
yield ` (`;
|
|
17441
|
+
yield* codes;
|
|
17442
|
+
yield `)${utils_1.endOfLine}}`;
|
|
17443
|
+
}
|
|
17444
|
+
}
|
|
17445
|
+
function* generateReasserts(reasserts) {
|
|
17446
|
+
for (const name of reasserts) yield `${names_1.names.withDotValue}(${name}, ${(0, utils_1.getRefBrandArgument)(options.vueCompilerOptions, options.scriptLang)})${utils_1.endOfLine}`;
|
|
17447
|
+
}
|
|
17049
17448
|
let prevEnd = 0;
|
|
17050
17449
|
for (const [name, offset, isShorthand, isNarrowing, inTypeQuery, isNewOperand] of forEachIdentifiers(options.typescript, ctx, block, code, prefix, suffix, inNarrowing)) {
|
|
17051
17450
|
if (isShorthand) {
|
|
17052
|
-
yield*
|
|
17053
|
-
yield `:
|
|
17054
|
-
} else
|
|
17055
|
-
|
|
17451
|
+
yield* generateCodeUntil(prevEnd, offset + name.length);
|
|
17452
|
+
yield* write([`: `]);
|
|
17453
|
+
} else yield* generateCodeUntil(prevEnd, offset);
|
|
17454
|
+
if (frames.length && options.reassertBindings.has(name) && !options.setupConsts.has(name) && !options.setupRefs.has(name) && !(0, bindingReferences_1.shouldIdentifierSkipped)(ctx, name)) frames[frames.length - 1].reasserts.add(name);
|
|
17455
|
+
yield* write(generateIdentifier(options, ctx, [[
|
|
17056
17456
|
name,
|
|
17057
17457
|
block.name,
|
|
17058
17458
|
start + offset,
|
|
@@ -17060,12 +17460,66 @@ var require_interpolation = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17060
17460
|
...features,
|
|
17061
17461
|
__shorthandExpression: "js"
|
|
17062
17462
|
} : features
|
|
17063
|
-
]], name, block.name, start + offset, start + offset + name.length, isNarrowing, inTypeQuery, isNewOperand);
|
|
17463
|
+
]], name, block.name, start + offset, start + offset + name.length, isNarrowing, inTypeQuery, isNewOperand));
|
|
17064
17464
|
prevEnd = offset + name.length;
|
|
17065
17465
|
}
|
|
17066
|
-
|
|
17466
|
+
yield* generateCodeUntil(prevEnd, code.length);
|
|
17067
17467
|
if (suffix) yield suffix;
|
|
17068
17468
|
}
|
|
17469
|
+
function collectFunctionBodies(ts, ast) {
|
|
17470
|
+
const bodies = [];
|
|
17471
|
+
const visitBinding = (name) => {
|
|
17472
|
+
if (ts.isIdentifier(name)) return;
|
|
17473
|
+
for (const element of name.elements) {
|
|
17474
|
+
if (ts.isOmittedExpression(element)) continue;
|
|
17475
|
+
if (element.propertyName && ts.isComputedPropertyName(element.propertyName)) pushParameterExpression(element.propertyName.expression);
|
|
17476
|
+
visitBinding(element.name);
|
|
17477
|
+
if (element.initializer) pushParameterExpression(element.initializer);
|
|
17478
|
+
}
|
|
17479
|
+
};
|
|
17480
|
+
const pushParameterExpression = (node) => {
|
|
17481
|
+
bodies.push({
|
|
17482
|
+
...(0, shared_1.getStartEnd)(ts, node, ast),
|
|
17483
|
+
kind: "parameter"
|
|
17484
|
+
});
|
|
17485
|
+
visit(node);
|
|
17486
|
+
};
|
|
17487
|
+
const visit = (node) => {
|
|
17488
|
+
if ((ts.isArrowFunction(node) || ts.isFunctionExpression(node) || ts.isFunctionDeclaration(node) || ts.isMethodDeclaration(node) || ts.isGetAccessorDeclaration(node) || ts.isSetAccessorDeclaration(node) || ts.isConstructorDeclaration(node) || ts.isClassStaticBlockDeclaration(node)) && node.body) {
|
|
17489
|
+
if (!ts.isClassStaticBlockDeclaration(node)) {
|
|
17490
|
+
for (const modifier of node.modifiers ?? []) visit(modifier);
|
|
17491
|
+
if (node.name) visit(node.name);
|
|
17492
|
+
for (const typeParameter of node.typeParameters ?? []) visit(typeParameter);
|
|
17493
|
+
for (const parameter of node.parameters) {
|
|
17494
|
+
for (const modifier of parameter.modifiers ?? []) visit(modifier);
|
|
17495
|
+
visitBinding(parameter.name);
|
|
17496
|
+
if (parameter.type) visit(parameter.type);
|
|
17497
|
+
if (parameter.initializer) pushParameterExpression(parameter.initializer);
|
|
17498
|
+
}
|
|
17499
|
+
if (node.type) visit(node.type);
|
|
17500
|
+
}
|
|
17501
|
+
const { start, end } = (0, shared_1.getStartEnd)(ts, node.body, ast);
|
|
17502
|
+
if (ts.isBlock(node.body)) {
|
|
17503
|
+
const statements = node.body.statements;
|
|
17504
|
+
const prologue = statements.findIndex((statement) => !ts.isExpressionStatement(statement) || !ts.isStringLiteral(statement.expression));
|
|
17505
|
+
if (prologue !== -1) bodies.push({
|
|
17506
|
+
start: prologue ? statements[prologue - 1].end : start + 1,
|
|
17507
|
+
end: end - 1,
|
|
17508
|
+
kind: "block"
|
|
17509
|
+
});
|
|
17510
|
+
} else bodies.push({
|
|
17511
|
+
start,
|
|
17512
|
+
end,
|
|
17513
|
+
kind: "expression"
|
|
17514
|
+
});
|
|
17515
|
+
visit(node.body);
|
|
17516
|
+
return;
|
|
17517
|
+
}
|
|
17518
|
+
ts.forEachChild(node, visit);
|
|
17519
|
+
};
|
|
17520
|
+
ts.forEachChild(ast, visit);
|
|
17521
|
+
return bodies;
|
|
17522
|
+
}
|
|
17069
17523
|
/**
|
|
17070
17524
|
* Yield a code chunk, cutting the boundary character off as verification-only.
|
|
17071
17525
|
*
|
|
@@ -17701,8 +18155,11 @@ var require_utils$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17701
18155
|
const bindings = /* @__PURE__ */ new Map();
|
|
17702
18156
|
ts.forEachChild(ast, (node) => {
|
|
17703
18157
|
if (ts.isVariableStatement(node)) {
|
|
17704
|
-
const
|
|
17705
|
-
for (const decl of node.declarationList.declarations)
|
|
18158
|
+
const isConst = !!(node.declarationList.flags & ts.NodeFlags.Const);
|
|
18159
|
+
for (const decl of node.declarationList.declarations) {
|
|
18160
|
+
const flags = isConst ? 0 : 1;
|
|
18161
|
+
for (const { start, end } of (0, collectBindings_1.collectBindingRanges)(ts, decl.name, ast)) bindings.set(ast.text.slice(start, end), flags);
|
|
18162
|
+
}
|
|
17706
18163
|
} else if (ts.isFunctionDeclaration(node)) {
|
|
17707
18164
|
if (node.name && ts.isIdentifier(node.name)) bindings.set(_getNodeText(node.name), 2);
|
|
17708
18165
|
} else if (ts.isClassDeclaration(node)) {
|
|
@@ -17795,6 +18252,7 @@ var require_elementEvents = /* @__PURE__ */ __commonJSMin(((exports, module, thi
|
|
|
17795
18252
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17796
18253
|
exports.generateElementEvents = generateElementEvents;
|
|
17797
18254
|
exports.generateEventArg = generateEventArg;
|
|
18255
|
+
exports.getEventArgName = getEventArgName;
|
|
17798
18256
|
exports.generateEventExpression = generateEventExpression;
|
|
17799
18257
|
exports.generateModelEventExpression = generateModelEventExpression;
|
|
17800
18258
|
exports.isCompoundExpression = isCompoundExpression;
|
|
@@ -17854,18 +18312,18 @@ var require_elementEvents = /* @__PURE__ */ __commonJSMin(((exports, module, thi
|
|
|
17854
18312
|
if ((0, utils_2.isTsLang)(options.scriptLang)) yield `const ${eventVar}: ${eventType} = {${utils_2.newLine}`;
|
|
17855
18313
|
else yield `/** @type {${eventType}} */${utils_2.newLine}const ${eventVar} = {${utils_2.newLine}`;
|
|
17856
18314
|
for (const { prop, source, offset } of items) {
|
|
18315
|
+
const argsType = `${names_1.names.EventArgs}<${eventType}, '${propName}'>`;
|
|
17857
18316
|
if (prop.name === "on") {
|
|
17858
18317
|
yield `/** @type {typeof ${emitsVar}.`;
|
|
17859
18318
|
yield* generateEventArg(options, source, offset, emitPrefix.slice(0, -1), codeFeatures_1.codeFeatures.navigation);
|
|
17860
18319
|
yield `} */${utils_2.newLine}`;
|
|
17861
|
-
|
|
17862
|
-
if (prop.name === "on") {
|
|
18320
|
+
const emitArgName = getEventArgName(source, emitPrefix.slice(0, -1));
|
|
17863
18321
|
yield* generateEventArg(options, source, offset, propPrefix.slice(0, -1));
|
|
17864
18322
|
yield `: `;
|
|
17865
|
-
yield* generateEventExpression(options, ctx, prop);
|
|
18323
|
+
yield* generateEventExpression(options, ctx, prop, (0, utils_2.isTsLang)(options.scriptLang) ? argsType : utils_2.identifierRE.test(emitArgName) ? `${names_1.names.EventArgs}<typeof ${emitsVar}, '${emitArgName}'>` : `any[]`);
|
|
17866
18324
|
} else {
|
|
17867
18325
|
yield `'${propName}': `;
|
|
17868
|
-
yield* generateModelEventExpression(options, ctx, prop);
|
|
18326
|
+
yield* generateModelEventExpression(options, ctx, prop, argsType);
|
|
17869
18327
|
}
|
|
17870
18328
|
yield `,${utils_2.newLine}`;
|
|
17871
18329
|
}
|
|
@@ -17892,7 +18350,15 @@ var require_elementEvents = /* @__PURE__ */ __commonJSMin(((exports, module, thi
|
|
|
17892
18350
|
yield boundary.end();
|
|
17893
18351
|
}
|
|
17894
18352
|
}
|
|
17895
|
-
function
|
|
18353
|
+
function getEventArgName(name, directive = "on") {
|
|
18354
|
+
if (directive.length) name = (0, shared_1.capitalize)(name);
|
|
18355
|
+
return directive + name.split("-").map((part, i) => i ? (0, shared_1.capitalize)(part) : part).join("");
|
|
18356
|
+
}
|
|
18357
|
+
function* generateEventParameter(options, argsType) {
|
|
18358
|
+
if ((0, utils_2.isTsLang)(options.scriptLang)) yield `(...[$event]: ${argsType}) => {${utils_2.newLine}`;
|
|
18359
|
+
else yield `(/** @type {${argsType}} */ ...[$event]) => {${utils_2.newLine}`;
|
|
18360
|
+
}
|
|
18361
|
+
function* generateEventExpression(options, ctx, prop, argsType) {
|
|
17896
18362
|
if (prop.exp?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
|
|
17897
18363
|
const ast = (0, utils_2.getTypeScriptAST)(options.typescript, options.template, prop.exp.content);
|
|
17898
18364
|
const isCompound = isCompoundExpression(options.typescript, ast);
|
|
@@ -17901,10 +18367,8 @@ var require_elementEvents = /* @__PURE__ */ __commonJSMin(((exports, module, thi
|
|
|
17901
18367
|
const scope = ctx.scope();
|
|
17902
18368
|
scope.declare("$event");
|
|
17903
18369
|
const accessMark = ctx.accessLog.length;
|
|
17904
|
-
const codes = [];
|
|
17905
|
-
|
|
17906
|
-
yield `// @ts-ignore${utils_2.newLine}`;
|
|
17907
|
-
yield `(...[$event]) => {${utils_2.newLine}`;
|
|
18370
|
+
const codes = [...interpolation];
|
|
18371
|
+
yield* generateEventParameter(options, argsType);
|
|
17908
18372
|
yield `void $event${utils_2.endOfLine}`;
|
|
17909
18373
|
yield* generateReasserts(options, ctx, accessMark);
|
|
17910
18374
|
yield* ctx.generateConditionGuards();
|
|
@@ -17931,15 +18395,18 @@ var require_elementEvents = /* @__PURE__ */ __commonJSMin(((exports, module, thi
|
|
|
17931
18395
|
} else yield* interpolation;
|
|
17932
18396
|
} else yield `() => {}`;
|
|
17933
18397
|
}
|
|
17934
|
-
function* generateModelEventExpression(options, ctx, prop) {
|
|
18398
|
+
function* generateModelEventExpression(options, ctx, prop, argsType) {
|
|
17935
18399
|
if (prop.exp?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
|
|
17936
18400
|
const accessMark = ctx.accessLog.length;
|
|
17937
18401
|
const codes = [...(0, interpolation_1.generateInterpolation)(options, ctx, options.template, codeFeatures_1.codeFeatures.verification, prop.exp.content, prop.exp.loc.start.offset, void 0, void 0, true)];
|
|
17938
|
-
yield
|
|
17939
|
-
yield `(...[$event]) => {${utils_2.newLine}`;
|
|
18402
|
+
yield* generateEventParameter(options, argsType);
|
|
17940
18403
|
yield* generateReasserts(options, ctx, accessMark);
|
|
17941
18404
|
yield* ctx.generateConditionGuards();
|
|
18405
|
+
const boundary = yield* boundary_1.Boundary.start("template", prop.exp.loc.start.offset, prop.exp.loc.end.offset, codeFeatures_1.codeFeatures.verification);
|
|
18406
|
+
yield `(`;
|
|
17942
18407
|
yield* codes;
|
|
18408
|
+
yield `)`;
|
|
18409
|
+
yield boundary.end();
|
|
17943
18410
|
yield ` = $event${utils_2.endOfLine}`;
|
|
17944
18411
|
yield `}`;
|
|
17945
18412
|
} else yield `() => {}`;
|
|
@@ -18032,7 +18499,7 @@ var require_elementProps = /* @__PURE__ */ __commonJSMin(((exports, module, this
|
|
|
18032
18499
|
var elementEvents_1 = require_elementEvents();
|
|
18033
18500
|
var interpolation_1 = require_interpolation();
|
|
18034
18501
|
var objectProperty_1 = require_objectProperty();
|
|
18035
|
-
function* generateElementProps(options, ctx, node, props, checkUnknownProps, failedPropExps) {
|
|
18502
|
+
function* generateElementProps(options, ctx, node, props, checkUnknownProps, failedPropExps, attrsType) {
|
|
18036
18503
|
const isComponent = node.tagType === CompilerDOM.ElementTypes.COMPONENT;
|
|
18037
18504
|
for (const prop of props) if (prop.type === CompilerDOM.NodeTypes.DIRECTIVE && prop.name === "on") {
|
|
18038
18505
|
if (prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && !prop.arg.loc.source.startsWith("[") && !prop.arg.loc.source.endsWith("]")) {
|
|
@@ -18040,7 +18507,7 @@ var require_elementProps = /* @__PURE__ */ __commonJSMin(((exports, module, this
|
|
|
18040
18507
|
yield `...{ `;
|
|
18041
18508
|
yield* (0, elementEvents_1.generateEventArg)(options, prop.arg.loc.source, prop.arg.loc.start.offset);
|
|
18042
18509
|
yield `: `;
|
|
18043
|
-
yield* (0, elementEvents_1.generateEventExpression)(options, ctx, prop);
|
|
18510
|
+
yield* (0, elementEvents_1.generateEventExpression)(options, ctx, prop, attrsType ? `${names_1.names.EventArgs}<${attrsType}, '${(0, elementEvents_1.getEventArgName)(prop.arg.loc.source)}'>` : `any[]`);
|
|
18044
18511
|
yield `},`;
|
|
18045
18512
|
} else yield `...{ '${(0, shared_1.camelize)("on-" + prop.arg.loc.source)}': ${(0, utils_1.asType)("any", options.scriptLang)} },`;
|
|
18046
18513
|
yield utils_1.newLine;
|
|
@@ -18257,25 +18724,30 @@ var require_elementDirectives = /* @__PURE__ */ __commonJSMin(((exports, module,
|
|
|
18257
18724
|
function* generateElementDirectives(options, ctx, node) {
|
|
18258
18725
|
for (const prop of node.props) {
|
|
18259
18726
|
if (prop.type !== CompilerDOM.NodeTypes.DIRECTIVE || prop.name === "slot" || prop.name === "on" || prop.name === "model" || prop.name === "bind") continue;
|
|
18260
|
-
const boundary = yield* boundary_1.Boundary.start("template", prop.loc.start.offset, prop.loc.end.offset, codeFeatures_1.codeFeatures.verification);
|
|
18261
18727
|
if (options.isVapor && !(0, shared_1.isBuiltInDirective)(prop.name)) {
|
|
18728
|
+
const boundary = yield* boundary_1.Boundary.start("template", prop.loc.start.offset, prop.loc.end.offset, codeFeatures_1.codeFeatures.verification);
|
|
18262
18729
|
yield* generateIdentifier(options, ctx, prop);
|
|
18263
18730
|
yield `(${names_1.names.nonNull}(null), `;
|
|
18264
18731
|
yield* generateValue(options, ctx, prop, false);
|
|
18265
18732
|
yield* generateArg(options, ctx, prop, false);
|
|
18266
18733
|
yield* generateModifiers(options, ctx, prop, "modifiers", false);
|
|
18267
18734
|
yield `)`;
|
|
18735
|
+
yield boundary.end();
|
|
18736
|
+
yield utils_1.endOfLine;
|
|
18268
18737
|
} else {
|
|
18269
|
-
|
|
18738
|
+
const hookVar = ctx.getInternalVariable();
|
|
18739
|
+
yield `const ${hookVar} = ${names_1.names.asFunctionalDirective}(`;
|
|
18270
18740
|
yield* generateIdentifier(options, ctx, prop);
|
|
18271
|
-
yield `, ${(0, utils_1.asType)(`import('${options.vueCompilerOptions.lib}').ObjectDirective`, options.scriptLang)})
|
|
18741
|
+
yield `, ${(0, utils_1.asType)(`import('${options.vueCompilerOptions.lib}').ObjectDirective`, options.scriptLang)})${utils_1.endOfLine}`;
|
|
18742
|
+
const boundary = yield* boundary_1.Boundary.start("template", prop.loc.start.offset, prop.loc.end.offset, codeFeatures_1.codeFeatures.verification);
|
|
18743
|
+
yield `${hookVar}(${names_1.names.nonNull}(null), { ...${names_1.names.directiveBindingRestFields}, `;
|
|
18272
18744
|
yield* generateArg(options, ctx, prop);
|
|
18273
18745
|
yield* generateModifiers(options, ctx, prop);
|
|
18274
18746
|
yield* generateValue(options, ctx, prop);
|
|
18275
|
-
yield `},${utils_1.newLine}
|
|
18747
|
+
yield `},${utils_1.newLine}...${names_1.names.directiveHookArgsRest}(${hookVar}))`;
|
|
18748
|
+
yield boundary.end();
|
|
18749
|
+
yield utils_1.endOfLine;
|
|
18276
18750
|
}
|
|
18277
|
-
yield boundary.end();
|
|
18278
|
-
yield utils_1.endOfLine;
|
|
18279
18751
|
}
|
|
18280
18752
|
}
|
|
18281
18753
|
function* generateIdentifier(options, ctx, prop) {
|
|
@@ -18288,7 +18760,7 @@ var require_elementDirectives = /* @__PURE__ */ __commonJSMin(((exports, module,
|
|
|
18288
18760
|
...codeFeatures_1.codeFeatures.withoutHighlightAndCompletion,
|
|
18289
18761
|
verification: options.vueCompilerOptions.checkUnknownDirectives && !(0, shared_1.isBuiltInDirective)(prop.name)
|
|
18290
18762
|
});
|
|
18291
|
-
if (!(0, shared_1.isBuiltInDirective)(prop.name)) ctx.accessVariable("template", (0, shared_1.camelize)(rawName), prop.loc.start.offset);
|
|
18763
|
+
if (!(0, shared_1.isBuiltInDirective)(prop.name)) ctx.accessVariable("template", (0, shared_1.camelize)(rawName), prop.loc.start.offset, false, rawName);
|
|
18292
18764
|
yield boundary.end();
|
|
18293
18765
|
}
|
|
18294
18766
|
function* generateArg(options, ctx, prop, asBindingProperty = true) {
|
|
@@ -18616,11 +19088,12 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports, module, this$35)
|
|
|
18616
19088
|
yield* (0, utils_1.generateTypedVar)("let", componentVar, options.scriptLang, function* () {
|
|
18617
19089
|
yield `${names_1.names.WithComponent}<'${tag}', ${names_1.names.LocalComponents}, ${names_1.names.GlobalComponents}`;
|
|
18618
19090
|
yield originalNames.has(options.componentName) ? `, typeof ${names_1.names.export}` : `, void`;
|
|
19091
|
+
yield `, ${options.vueCompilerOptions.checkUnknownComponents}`;
|
|
18619
19092
|
for (const name of originalNames) yield `, '${name}'`;
|
|
18620
19093
|
yield `>[`;
|
|
18621
19094
|
yield* (0, stringLiteralKey_1.generateStringLiteralKey)(tag, startTagOffset, {
|
|
18622
19095
|
...codeFeatures_1.codeFeatures.semanticWithoutHighlight,
|
|
18623
|
-
...
|
|
19096
|
+
...codeFeatures_1.codeFeatures.verification
|
|
18624
19097
|
});
|
|
18625
19098
|
yield `]`;
|
|
18626
19099
|
});
|
|
@@ -18628,11 +19101,9 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports, module, this$35)
|
|
|
18628
19101
|
yield `/** @ts-ignore @type {`;
|
|
18629
19102
|
for (const offset of [startTagOffset, endTagOffset]) {
|
|
18630
19103
|
if (offset === void 0) continue;
|
|
18631
|
-
|
|
18632
|
-
|
|
18633
|
-
|
|
18634
|
-
yield ` | typeof ${names_1.names.components}.`;
|
|
18635
|
-
yield* (0, camelized_1.generateCamelized)((0, shared_1.capitalize)(tag), "template", offset, codeFeatures_1.codeFeatures.navigation);
|
|
19104
|
+
for (const name of /* @__PURE__ */ new Set([tag, (0, shared_1.capitalize)(tag)])) {
|
|
19105
|
+
yield ` | typeof ${options.setupBindings.has((0, shared_1.camelize)(name)) ? "" : `${names_1.names.components}.`}`;
|
|
19106
|
+
yield* (0, camelized_1.generateCamelized)(name, "template", offset, codeFeatures_1.codeFeatures.navigation);
|
|
18636
19107
|
}
|
|
18637
19108
|
if (tag.includes("-")) {
|
|
18638
19109
|
yield ` | typeof ${names_1.names.components}[`;
|
|
@@ -18725,13 +19196,14 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports, module, this$35)
|
|
|
18725
19196
|
}
|
|
18726
19197
|
yield* (0, styleScopedClasses_1.generateStyleScopedClassReferences)(options, node);
|
|
18727
19198
|
const slotDir = node.props.find(CompilerDOM.isVSlot);
|
|
18728
|
-
|
|
18729
|
-
if (isCtxVarUsed) yield* (0, utils_1.generateTypedVar)("var", ctxVar, options.scriptLang, function* () {
|
|
19199
|
+
const hasSlots = !!slotDir || node.children.length > 0;
|
|
19200
|
+
if (isCtxVarUsed || hasSlots) yield* (0, utils_1.generateTypedVar)("var", ctxVar, options.scriptLang, function* () {
|
|
18730
19201
|
yield `${names_1.names.ExtractComponentContext}<typeof ${componentVar}, typeof ${vnodeVar}>`;
|
|
18731
19202
|
});
|
|
18732
19203
|
if (isPropsVarUsed) yield* (0, utils_1.generateTypedVar)("var", propsVar, options.scriptLang, function* () {
|
|
18733
19204
|
yield `${names_1.names.ExtractComponentProps}<typeof ${componentVar}, typeof ${vnodeVar}>`;
|
|
18734
19205
|
});
|
|
19206
|
+
if (hasSlots) yield* (0, vSlot_1.generateVSlot)(options, ctx, node, slotDir, ctxVar);
|
|
18735
19207
|
ctx.components.pop();
|
|
18736
19208
|
}
|
|
18737
19209
|
function* generateElement(options, ctx, node) {
|
|
@@ -18747,7 +19219,7 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports, module, this$35)
|
|
|
18747
19219
|
yield `)(`;
|
|
18748
19220
|
const boundary = yield* boundary_1.Boundary.start("template", startTagOffset, startTagOffset + node.tag.length, codeFeatures_1.codeFeatures.verification);
|
|
18749
19221
|
yield `{${utils_1.newLine}`;
|
|
18750
|
-
yield* (0, elementProps_1.generateElementProps)(options, ctx, node, node.props, options.vueCompilerOptions.checkUnknownProps, failedPropExps);
|
|
19222
|
+
yield* (0, elementProps_1.generateElementProps)(options, ctx, node, node.props, options.vueCompilerOptions.checkUnknownProps, failedPropExps, `typeof ${names_1.names.intrinsics}['${node.tag}']`);
|
|
18751
19223
|
yield `}`;
|
|
18752
19224
|
yield boundary.end();
|
|
18753
19225
|
yield `)${utils_1.endOfLine}`;
|
|
@@ -18771,7 +19243,7 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports, module, this$35)
|
|
|
18771
19243
|
yield `${options.vueCompilerOptions.checkUnknownProps ? names_1.names.asFunctionalElement0 : names_1.names.asFunctionalElement1}(${names_1.names.intrinsics}.template)(`;
|
|
18772
19244
|
const boundary = yield* boundary_1.Boundary.start("template", startTagOffset, startTagOffset + node.tag.length, codeFeatures_1.codeFeatures.verification);
|
|
18773
19245
|
yield `{${utils_1.newLine}`;
|
|
18774
|
-
yield* (0, elementProps_1.generateElementProps)(options, ctx, node, node.props, options.vueCompilerOptions.checkUnknownProps, failedPropExps);
|
|
19246
|
+
yield* (0, elementProps_1.generateElementProps)(options, ctx, node, node.props, options.vueCompilerOptions.checkUnknownProps, failedPropExps, `typeof ${names_1.names.intrinsics}.template`);
|
|
18775
19247
|
yield `}`;
|
|
18776
19248
|
yield boundary.end();
|
|
18777
19249
|
yield `)${utils_1.endOfLine}`;
|
|
@@ -18857,7 +19329,8 @@ var require_slotOutlet = /* @__PURE__ */ __commonJSMin(((exports, module, this$3
|
|
|
18857
19329
|
if (prop.name === "bind" && prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) return prop.arg.content === "name";
|
|
18858
19330
|
});
|
|
18859
19331
|
if (options.hasDefineSlots) {
|
|
18860
|
-
|
|
19332
|
+
const slotVar = ctx.getInternalVariable();
|
|
19333
|
+
yield `const ${slotVar} = ${names_1.names.asFunctionalSlot}(`;
|
|
18861
19334
|
if (nameProp) {
|
|
18862
19335
|
let codes;
|
|
18863
19336
|
if (nameProp.type === CompilerDOM.NodeTypes.ATTRIBUTE && nameProp.value) {
|
|
@@ -18882,10 +19355,11 @@ var require_slotOutlet = /* @__PURE__ */ __commonJSMin(((exports, module, this$3
|
|
|
18882
19355
|
yield `]`;
|
|
18883
19356
|
yield boundary.end();
|
|
18884
19357
|
}
|
|
18885
|
-
yield `)
|
|
19358
|
+
yield `)${utils_1.endOfLine}`;
|
|
19359
|
+
yield `${slotVar}(`;
|
|
18886
19360
|
const boundary = yield* boundary_1.Boundary.start("template", startTagOffset, startTagEndOffset, codeFeatures_1.codeFeatures.verification);
|
|
18887
19361
|
yield `{${utils_1.newLine}`;
|
|
18888
|
-
yield* (0, elementProps_1.generateElementProps)(options, ctx, node, node.props.filter((prop) => prop !== nameProp), true);
|
|
19362
|
+
yield* (0, elementProps_1.generateElementProps)(options, ctx, node, node.props.filter((prop) => prop !== nameProp), true, void 0, `Parameters<typeof ${slotVar}>[0]`);
|
|
18889
19363
|
yield `}`;
|
|
18890
19364
|
yield boundary.end();
|
|
18891
19365
|
yield `)${utils_1.endOfLine}`;
|
|
@@ -19280,23 +19754,26 @@ var require_template$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
19280
19754
|
if (vueCompilerOptions.inferTemplateDollarRefs) ctx.dollarVars.add("$refs");
|
|
19281
19755
|
if (vueCompilerOptions.inferTemplateDollarEl) ctx.dollarVars.add("$el");
|
|
19282
19756
|
if (template.ast) yield* (0, templateChild_1.generateTemplateChild)(options, ctx, template.ast);
|
|
19283
|
-
yield* ctx.generateHoistVariables();
|
|
19757
|
+
yield* ctx.generateHoistVariables(options.scriptLang);
|
|
19284
19758
|
yield* generateSlotsType(options, ctx);
|
|
19285
19759
|
yield* generateInheritedAttrsType(options, ctx);
|
|
19286
19760
|
yield* generateTemplateRefsType(options, ctx);
|
|
19287
19761
|
yield* generateRootElType(options, ctx);
|
|
19288
|
-
if (ctx.dollarVars.size)
|
|
19289
|
-
|
|
19290
|
-
|
|
19291
|
-
|
|
19292
|
-
yield `$
|
|
19293
|
-
if (ctx.
|
|
19294
|
-
|
|
19295
|
-
|
|
19296
|
-
|
|
19297
|
-
|
|
19298
|
-
|
|
19299
|
-
|
|
19762
|
+
if (ctx.dollarVars.size) {
|
|
19763
|
+
ctx.generatedTypes.add(names_1.names.dollars);
|
|
19764
|
+
yield* (0, utils_1.generateTypedVar)("var", names_1.names.dollars, options.scriptLang, function* () {
|
|
19765
|
+
yield `{${utils_1.newLine}`;
|
|
19766
|
+
if (ctx.dollarVars.has("$slots")) yield `$slots: ${ctx.generatedTypes.has(names_1.names.Slots) ? names_1.names.Slots : `{}`}${utils_1.endOfLine}`;
|
|
19767
|
+
if (ctx.dollarVars.has("$attrs")) {
|
|
19768
|
+
yield `$attrs: import('${vueCompilerOptions.lib}').ComponentPublicInstance['$attrs']`;
|
|
19769
|
+
if (ctx.generatedTypes.has(names_1.names.InheritedAttrs)) yield ` & ${names_1.names.InheritedAttrs}`;
|
|
19770
|
+
yield utils_1.endOfLine;
|
|
19771
|
+
}
|
|
19772
|
+
if (ctx.dollarVars.has("$refs")) yield `$refs: ${ctx.generatedTypes.has(names_1.names.TemplateRefs) ? names_1.names.TemplateRefs : `{}`}${utils_1.endOfLine}`;
|
|
19773
|
+
if (ctx.dollarVars.has("$el")) yield `$el: ${ctx.generatedTypes.has(names_1.names.RootEl) ? names_1.names.RootEl : `any`}${utils_1.endOfLine}`;
|
|
19774
|
+
yield `} & { [K in keyof import('${vueCompilerOptions.lib}').ComponentPublicInstance]: unknown }`;
|
|
19775
|
+
});
|
|
19776
|
+
}
|
|
19300
19777
|
yield* scope.end();
|
|
19301
19778
|
}
|
|
19302
19779
|
function* generateSlotsType(options, ctx) {
|
|
@@ -23767,8 +24244,9 @@ var require_scriptSetup$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
23767
24244
|
yield utils_1.endOfLine;
|
|
23768
24245
|
propTypes.push(`import('${vueCompilerOptions.lib}').${vueCompilerOptions.target >= 3.3 ? `ExtractPublicPropTypes` : `ExtractPropTypes`}<typeof ${names_1.names.propsOption}>`);
|
|
23769
24246
|
}
|
|
23770
|
-
|
|
23771
|
-
if (
|
|
24247
|
+
const hasEmitProps = scriptSetupRanges.defineEmits || scriptSetupRanges.defineModel.length;
|
|
24248
|
+
if (hasEmitProps) propTypes.push(names_1.names.EmitProps);
|
|
24249
|
+
if (options.templateAndStyleTypes.has(names_1.names.InheritedAttrs)) propTypes.push(hasEmitProps ? `Omit<${names_1.names.InheritedAttrs}, keyof ${names_1.names.EmitProps}>` : names_1.names.InheritedAttrs);
|
|
23772
24250
|
if (scriptSetupRanges.defineEmits) emitTypes.push(`typeof ${scriptSetupRanges.defineEmits.name ?? names_1.names.emit}`);
|
|
23773
24251
|
if (scriptSetupRanges.defineModel.length) emitTypes.push(`typeof ${names_1.names.modelEmit}`);
|
|
23774
24252
|
yield `return {} as {${utils_1.newLine}`;
|
|
@@ -23959,7 +24437,7 @@ var require_scriptSetup$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
23959
24437
|
});
|
|
23960
24438
|
const toImport = usedMacros.filter(({ alias }) => !options.setupBindings.has(alias));
|
|
23961
24439
|
if (toImport.length) {
|
|
23962
|
-
yield
|
|
24440
|
+
yield `${utils_1.newLine}const { `;
|
|
23963
24441
|
for (const { canonical, alias } of toImport) yield alias === canonical ? `${canonical}, ` : `${canonical}: ${alias}, `;
|
|
23964
24442
|
yield `} = `;
|
|
23965
24443
|
yield (0, utils_1.asType)(`typeof import('${options.vueCompilerOptions.lib}')`, options.scriptLang);
|
|
@@ -24105,11 +24583,34 @@ var require_template = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
24105
24583
|
yield* generateTemplateComponents(options);
|
|
24106
24584
|
yield* generateTemplateDirectives(options);
|
|
24107
24585
|
yield `void ${names_1.names.ctx}, ${names_1.names.components}, ${names_1.names.intrinsics}, ${names_1.names.directives}${utils_1.endOfLine}`;
|
|
24108
|
-
|
|
24109
|
-
|
|
24110
|
-
|
|
24111
|
-
|
|
24586
|
+
const exportedTypes = [
|
|
24587
|
+
names_1.names.Slots,
|
|
24588
|
+
names_1.names.InheritedAttrs,
|
|
24589
|
+
names_1.names.TemplateRefs,
|
|
24590
|
+
names_1.names.RootEl,
|
|
24591
|
+
names_1.names.StyleModules
|
|
24592
|
+
].filter((name) => options.templateAndStyleTypes.has(name) && !(name === names_1.names.Slots && options.scriptSetupRanges?.defineSlots));
|
|
24593
|
+
yield `const ${names_1.names.template} = () => {${utils_1.newLine}`;
|
|
24594
|
+
for (const name of options.dotValueBindings) yield `${names_1.names.withDotValue}(${name}, ${(0, utils_1.getRefBrandArgument)(options.vueCompilerOptions, options.scriptLang)})${utils_1.endOfLine}`;
|
|
24112
24595
|
if (options.templateAndStyleCodes.length) yield* options.templateAndStyleCodes;
|
|
24596
|
+
yield `return {${utils_1.newLine}`;
|
|
24597
|
+
for (const name of exportedTypes) yield `${name}: ${(0, utils_1.asType)(name, options.scriptLang)},${utils_1.newLine}`;
|
|
24598
|
+
if (options.templateAndStyleTypes.has(names_1.names.dollars)) yield `${names_1.names.dollars},${utils_1.newLine}`;
|
|
24599
|
+
yield `}${utils_1.endOfLine}`;
|
|
24600
|
+
yield `}${utils_1.endOfLine}`;
|
|
24601
|
+
const used = [names_1.names.template];
|
|
24602
|
+
const returnType = `ReturnType<typeof ${names_1.names.template}>`;
|
|
24603
|
+
for (const name of exportedTypes) yield* (0, utils_1.generateTypeAlias)(name, options.scriptLang, function* () {
|
|
24604
|
+
yield `${returnType}['${name}']`;
|
|
24605
|
+
});
|
|
24606
|
+
if (exportedTypes.length) used.push((0, utils_1.asType)(`[${exportedTypes.join(`, `)}]`, options.scriptLang));
|
|
24607
|
+
if (options.templateAndStyleTypes.has(names_1.names.dollars)) {
|
|
24608
|
+
yield* (0, utils_1.generateTypedVar)("let", names_1.names.dollars, options.scriptLang, function* () {
|
|
24609
|
+
yield `${returnType}['${names_1.names.dollars}']`;
|
|
24610
|
+
});
|
|
24611
|
+
used.push(names_1.names.dollars);
|
|
24612
|
+
}
|
|
24613
|
+
yield `void [${used.join(`, `)}]${utils_1.endOfLine}`;
|
|
24113
24614
|
}
|
|
24114
24615
|
function* generateTemplateCtx({ vueCompilerOptions, templateAndStyleTypes, scriptSetupRanges, fileName, scriptLang }, selfType) {
|
|
24115
24616
|
const exps = [];
|
|
@@ -24271,7 +24772,6 @@ var require_script = /* @__PURE__ */ __commonJSMin(((exports, module, this$24) =
|
|
|
24271
24772
|
yield* (0, template_1.generateTemplate)(options, names_1.names.src);
|
|
24272
24773
|
} else if (script && scriptRanges && scriptSetup && scriptSetupRanges) {
|
|
24273
24774
|
yield* (0, scriptSetup_1.generateScriptSetupImports)(scriptSetup, scriptSetupRanges);
|
|
24274
|
-
yield* (0, scriptSetup_1.generateMacros)(options);
|
|
24275
24775
|
let selfType;
|
|
24276
24776
|
const { exportDefault } = scriptRanges;
|
|
24277
24777
|
if (exportDefault) yield* generateScriptWithExportDefault(ctx, script, scriptRanges, exportDefault, vueCompilerOptions, selfType = names_1.names.self, exportExpression);
|
|
@@ -24279,6 +24779,7 @@ var require_script = /* @__PURE__ */ __commonJSMin(((exports, module, this$24) =
|
|
|
24279
24779
|
yield* (0, utils_1.generateSfcBlockSection)(script, 0, script.content.length, codeFeatures_1.codeFeatures.all);
|
|
24280
24780
|
yield `export default ${exportExpression}${utils_1.endOfLine}`;
|
|
24281
24781
|
}
|
|
24782
|
+
yield* (0, scriptSetup_1.generateMacros)(options);
|
|
24282
24783
|
yield* generateExportDeclareEqual(scriptSetup, names_1.names.export);
|
|
24283
24784
|
if (scriptSetup.generic) yield* (0, scriptSetup_1.generateGeneric)(options, ctx, scriptSetup, scriptSetupRanges, scriptSetup.generic, (0, scriptSetup_1.generateSetupFunction)(options, ctx, scriptSetup, scriptSetupRanges, (0, template_1.generateTemplate)(options, selfType)));
|
|
24284
24785
|
else {
|
|
@@ -24609,7 +25110,7 @@ var require_scriptSetupRanges = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
24609
25110
|
var collectBindings_1 = require_collectBindings();
|
|
24610
25111
|
var shared_1 = require_shared$1();
|
|
24611
25112
|
var utils_1 = require_utils$4();
|
|
24612
|
-
var tsCheckRE =
|
|
25113
|
+
var tsCheckRE = /^\/\/(?:\s*@ts-(?:no)?check(?:$|\s)|\/\s*<reference\s)/;
|
|
24613
25114
|
function parseScriptSetupRanges(ts, sourceFile, vueCompilerOptions) {
|
|
24614
25115
|
const defineModel = [];
|
|
24615
25116
|
let defineProps;
|
|
@@ -27250,7 +27751,7 @@ var init_main$1 = __esmMin((() => {
|
|
|
27250
27751
|
*/
|
|
27251
27752
|
function is(value) {
|
|
27252
27753
|
const candidate = value;
|
|
27253
|
-
return Is$1.objectLiteral(candidate) && Is$1.string(candidate.label) && (Is$1.undefined(candidate.textEdit) || TextEdit$1.is(candidate)) && (Is$1.undefined(candidate.additionalTextEdits) || Is$1.typedArray(candidate.additionalTextEdits, TextEdit$1.is));
|
|
27754
|
+
return Is$1.objectLiteral(candidate) && Is$1.string(candidate.label) && (Is$1.undefined(candidate.textEdit) || TextEdit$1.is(candidate.textEdit)) && (Is$1.undefined(candidate.additionalTextEdits) || Is$1.typedArray(candidate.additionalTextEdits, TextEdit$1.is));
|
|
27254
27755
|
}
|
|
27255
27756
|
ColorPresentation.is = is;
|
|
27256
27757
|
})(ColorPresentation$1 || (ColorPresentation$1 = {}));
|
|
@@ -27289,7 +27790,7 @@ var init_main$1 = __esmMin((() => {
|
|
|
27289
27790
|
*/
|
|
27290
27791
|
function is(value) {
|
|
27291
27792
|
const candidate = value;
|
|
27292
|
-
return Is$1.objectLiteral(candidate) && Is$1.uinteger(candidate.startLine) && Is$1.uinteger(candidate.
|
|
27793
|
+
return Is$1.objectLiteral(candidate) && Is$1.uinteger(candidate.startLine) && Is$1.uinteger(candidate.endLine) && (Is$1.undefined(candidate.startCharacter) || Is$1.uinteger(candidate.startCharacter)) && (Is$1.undefined(candidate.endCharacter) || Is$1.uinteger(candidate.endCharacter)) && (Is$1.undefined(candidate.kind) || Is$1.string(candidate.kind));
|
|
27293
27794
|
}
|
|
27294
27795
|
FoldingRange.is = is;
|
|
27295
27796
|
})(FoldingRange$1 || (FoldingRange$1 = {}));
|
|
@@ -108470,7 +108971,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108470
108971
|
"name": "Transition",
|
|
108471
108972
|
"description": {
|
|
108472
108973
|
"kind": "markdown",
|
|
108473
|
-
"value": "\n**하나의** 요소 또는
|
|
108974
|
+
"value": "\n**하나의** 요소 또는 컴포넌트(component)에 애니메이션 전환 효과를 제공합니다.\n\n- **Props**\n\n ```ts\n interface TransitionProps {\n /**\n * 전환 CSS 클래스 이름을 자동으로 생성하는 데 사용됩니다.\n * 예: `name: 'fade'`를 지정하면 `.fade-enter`,\n * `.fade-enter-active` 등으로 자동 확장됩니다.\n */\n name?: string\n /**\n * CSS 전환 클래스를 적용할지 여부입니다.\n * 기본값: true\n */\n css?: boolean\n /**\n * 전환 종료 타이밍을 결정하기 위해\n * 대기할 전환 이벤트의 종류를 지정합니다.\n * 기본 동작은 더 긴 지속 시간을 가진\n * 타입을 자동 감지합니다.\n */\n type?: 'transition' | 'animation'\n /**\n * 전환의 명시적 지속 시간을 지정합니다.\n * 기본 동작은 루트 전환 요소에서 첫 번째 `transitionend`\n * 또는 `animationend` 이벤트를 대기합니다.\n */\n duration?: number | { enter: number; leave: number }\n /**\n * 나가기/들어오기 전환의 타이밍 시퀀스를 제어합니다.\n * 기본 동작은 동시에 실행됩니다.\n */\n mode?: 'in-out' | 'out-in' | 'default'\n /**\n * 초기 렌더 시 전환을 적용할지 여부입니다.\n * 기본값: false\n */\n appear?: boolean\n\n /**\n * 전환 클래스를 커스터마이즈하기 위한 props입니다.\n * 템플릿에서는 케밥 케이스를 사용하세요. 예: enter-from-class=\"xxx\"\n */\n enterFromClass?: string\n enterActiveClass?: string\n enterToClass?: string\n appearFromClass?: string\n appearActiveClass?: string\n appearToClass?: string\n leaveFromClass?: string\n leaveActiveClass?: string\n leaveToClass?: string\n }\n ```\n\n- **이벤트**\n\n - `@before-enter`\n - `@before-leave`\n - `@enter`\n - `@leave`\n - `@appear`\n - `@after-enter`\n - `@after-leave`\n - `@after-appear`\n - `@enter-cancelled`\n - `@leave-cancelled` (`v-show`에서만)\n - `@appear-cancelled`\n\n- **예시**\n\n 단순 요소:\n\n ```html\n <Transition>\n <div v-if=\"ok\">토글된 내용</div>\n </Transition>\n ```\n\n `key` 속성을 변경하여 전환 강제 적용:\n\n ```html\n <Transition>\n <div :key=\"text\">{{ text }}</div>\n </Transition>\n ```\n\n 동적 컴포넌트, 전환 모드 + appear 시 애니메이션:\n\n ```html\n <Transition name=\"fade\" mode=\"out-in\" appear>\n <component :is=\"view\"></component>\n </Transition>\n ```\n\n 전환 이벤트 리스닝:\n\n ```html\n <Transition @after-enter=\"onTransitionComplete\">\n <div v-show=\"ok\">토글된 내용</div>\n </Transition>\n ```\n\n- **더 알아보기** [가이드 - Transition](https://ko.vuejs.org/guide/built-ins/transition.html)\n"
|
|
108474
108975
|
},
|
|
108475
108976
|
"attributes": [],
|
|
108476
108977
|
"references": "api/built-in-components.html#transition"
|
|
@@ -108479,7 +108980,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108479
108980
|
"name": "TransitionGroup",
|
|
108480
108981
|
"description": {
|
|
108481
108982
|
"kind": "markdown",
|
|
108482
|
-
"value": "\n목록 내 **여러** 요소 또는 컴포넌트에 전환 효과를 제공합니다.\n\n- **Props**\n\n `<TransitionGroup>`은 `mode`를
|
|
108983
|
+
"value": "\n목록 내 **여러** 요소 또는 컴포넌트에 전환 효과를 제공합니다.\n\n- **Props**\n\n `<TransitionGroup>`은 `mode`를 제외하면 `<Transition>`과 동일한 props를 받으며, 두 가지 props를 추가로 받습니다:\n\n ```ts\n interface TransitionGroupProps extends Omit<TransitionProps, 'mode'> {\n /**\n * 정의하지 않으면 fragment로 렌더링됩니다.\n */\n tag?: string\n /**\n * 이동 전환 중 적용되는 CSS 클래스를 커스터마이즈합니다.\n * 템플릿에서는 케밥 케이스를 사용하세요. 예: move-class=\"xxx\"\n */\n moveClass?: string\n }\n ```\n\n- **이벤트**\n\n `<TransitionGroup>`은 `<Transition>`과 동일한 이벤트를 발생시킵니다.\n\n- **상세 설명**\n\n 기본적으로 `<TransitionGroup>`은 래퍼 DOM 요소를 렌더링(rendering)하지 않지만, `tag` prop으로 래퍼 요소를 렌더링하도록 지정할 수 있습니다.\n\n 애니메이션이 제대로 동작하려면 `<transition-group>` 내의 모든 자식에 [**고유한 key**](https://ko.vuejs.org/guide/essentials/list.html#maintaining-state-with-key)가 있어야 합니다.\n\n `<TransitionGroup>`은 CSS transform을 통한 이동 전환을 지원합니다. 업데이트 후 자식의 화면 위치가 변경되면, 이동 CSS 클래스(`name` 속성에서 자동 생성되거나 `move-class` prop으로 지정됨)가 적용됩니다. 이동 클래스가 적용될 때 CSS `transform` 속성이 \"전환 가능\"하다면, [FLIP 기법](https://aerotwist.com/blog/flip-your-animations/)을 사용하여 목적지까지 부드럽게 이동하는 애니메이션이 적용됩니다.\n\n- **예시**\n\n ```html\n <TransitionGroup tag=\"ul\" name=\"slide\">\n <li v-for=\"item in items\" :key=\"item.id\">\n {{ item.text }}\n </li>\n </TransitionGroup>\n ```\n\n- **더 알아보기** [가이드 - TransitionGroup](https://ko.vuejs.org/guide/built-ins/transition-group.html)\n"
|
|
108483
108984
|
},
|
|
108484
108985
|
"attributes": [],
|
|
108485
108986
|
"references": "api/built-in-components.html#transitiongroup"
|
|
@@ -108488,7 +108989,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108488
108989
|
"name": "KeepAlive",
|
|
108489
108990
|
"description": {
|
|
108490
108991
|
"kind": "markdown",
|
|
108491
|
-
"value": "\n내부에
|
|
108992
|
+
"value": "\n내부에 감싸인, 동적으로 토글되는 컴포넌트를 캐시합니다.\n\n- **Props**\n\n ```ts\n interface KeepAliveProps {\n /**\n * 지정하면, `include`에 일치하는 이름의\n * 컴포넌트만 캐시됩니다.\n */\n include?: MatchPattern\n /**\n * `exclude`에 일치하는 이름의\n * 컴포넌트는 캐시되지 않습니다.\n */\n exclude?: MatchPattern\n /**\n * 캐시할 컴포넌트 인스턴스의 최대 개수입니다.\n */\n max?: number | string\n }\n\n type MatchPattern = string | RegExp | (string | RegExp)[]\n ```\n\n- **상세 설명**\n\n 동적 컴포넌트를 감쌀 때, `<KeepAlive>`는 비활성 컴포넌트 인스턴스(instance)를 파괴하지 않고 캐시합니다.\n\n 한 번에 `<KeepAlive>`의 직접 자식으로는 하나의 활성 컴포넌트 인스턴스만 존재할 수 있습니다.\n\n `<KeepAlive>` 내부에서 컴포넌트가 토글될 때, 해당 컴포넌트의 `activated` 및 `deactivated` 라이프사이클(lifecycle) 훅(hook)이 호출됩니다. 이는 `mounted`와 `unmounted`의 대안으로, 이 두 훅은 호출되지 않습니다. 이 동작은 `<KeepAlive>`의 직접 자식뿐만 아니라 모든 하위 컴포넌트에도 적용됩니다.\n\n- **예시**\n\n 기본 사용법:\n\n ```html\n <KeepAlive>\n <component :is=\"view\"></component>\n </KeepAlive>\n ```\n\n `v-if` / `v-else` 분기와 함께 사용할 때는 한 번에 하나의 컴포넌트만 렌더링되어야 합니다:\n\n ```html\n <KeepAlive>\n <comp-a v-if=\"a > 1\"></comp-a>\n <comp-b v-else></comp-b>\n </KeepAlive>\n ```\n\n `<Transition>`과 함께 사용:\n\n ```html\n <Transition>\n <KeepAlive>\n <component :is=\"view\"></component>\n </KeepAlive>\n </Transition>\n ```\n\n `include` / `exclude` 사용:\n\n ```html\n <!-- 콤마로 구분된 문자열 -->\n <KeepAlive include=\"a,b\">\n <component :is=\"view\"></component>\n </KeepAlive>\n\n <!-- 정규식 (v-bind 사용) -->\n <KeepAlive :include=\"/a|b/\">\n <component :is=\"view\"></component>\n </KeepAlive>\n\n <!-- 배열 (v-bind 사용) -->\n <KeepAlive :include=\"['a', 'b']\">\n <component :is=\"view\"></component>\n </KeepAlive>\n ```\n\n `max`와 함께 사용:\n\n ```html\n <KeepAlive :max=\"10\">\n <component :is=\"view\"></component>\n </KeepAlive>\n ```\n\n- **더 알아보기** [가이드 - KeepAlive](https://ko.vuejs.org/guide/built-ins/keep-alive.html)\n"
|
|
108492
108993
|
},
|
|
108493
108994
|
"attributes": [],
|
|
108494
108995
|
"references": "api/built-in-components.html#keepalive"
|
|
@@ -108497,7 +108998,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108497
108998
|
"name": "Teleport",
|
|
108498
108999
|
"description": {
|
|
108499
109000
|
"kind": "markdown",
|
|
108500
|
-
"value": "\n슬롯 콘텐츠를 DOM의 다른 위치에 렌더링합니다.\n\n- **Props**\n\n ```ts\n interface TeleportProps {\n /**\n * 필수. 대상 컨테이너를 지정합니다.\n * 선택자 또는 실제 요소가 될 수 있습니다.\n */\n to: string | HTMLElement\n /**\n * `true`이면, 콘텐츠가 대상 컨테이너로 이동하지 않고\n * 원래 위치에 남아 있습니다.\n * 동적으로 변경할 수 있습니다.\n */\n disabled?: boolean\n /**\n * `true`이면, Teleport는\n * 애플리케이션의 다른 부분이 마운트된 후\n * 대상 해석을 지연합니다. (3.5+)\n */\n defer?: boolean\n }\n ```\n\n- **예시**\n\n 대상 컨테이너 지정:\n\n ```html\n <Teleport to=\"#some-id\" />\n <Teleport to=\".some-class\" />\n <Teleport to=\"[data-teleport]\" />\n ```\n\n 조건부 비활성화:\n\n ```html\n <Teleport to=\"#popup\" :disabled=\"displayVideoInline\">\n <video src=\"./my-movie.mp4\">\n </Teleport>\n ```\n\n 대상 해석 지연 <sup class=\"vt-badge\" data-text=\"3.5+\" />:\n\n ```html\n <Teleport defer to=\"#late-div\">...</Teleport>\n\n <!-- 템플릿의 다른 위치에 -->\n <div id=\"late-div\"></div>\n ```\n\n- **더 알아보기** [가이드 - Teleport](https://ko.vuejs.org/guide/built-ins/teleport.html)\n"
|
|
109001
|
+
"value": "\n슬롯(slot) 콘텐츠를 DOM의 다른 위치에 렌더링합니다.\n\n- **Props**\n\n ```ts\n interface TeleportProps {\n /**\n * 필수. 대상 컨테이너를 지정합니다.\n * 선택자 또는 실제 요소가 될 수 있습니다.\n */\n to: string | HTMLElement\n /**\n * `true`이면, 콘텐츠가 대상 컨테이너로 이동하지 않고\n * 원래 위치에 남아 있습니다.\n * 동적으로 변경할 수 있습니다.\n */\n disabled?: boolean\n /**\n * `true`이면, Teleport는\n * 애플리케이션의 다른 부분이 마운트된 후\n * 대상 해석을 지연합니다. (3.5+)\n */\n defer?: boolean\n }\n ```\n\n- **예시**\n\n 대상 컨테이너 지정:\n\n ```html\n <Teleport to=\"#some-id\" />\n <Teleport to=\".some-class\" />\n <Teleport to=\"[data-teleport]\" />\n ```\n\n 조건부 비활성화:\n\n ```html\n <Teleport to=\"#popup\" :disabled=\"displayVideoInline\">\n <video src=\"./my-movie.mp4\">\n </Teleport>\n ```\n\n 대상 해석 지연 <sup class=\"vt-badge\" data-text=\"3.5+\" />:\n\n ```html\n <Teleport defer to=\"#late-div\">...</Teleport>\n\n <!-- 템플릿의 다른 위치에 -->\n <div id=\"late-div\"></div>\n ```\n\n- **더 알아보기** [가이드 - Teleport](https://ko.vuejs.org/guide/built-ins/teleport.html)\n"
|
|
108501
109002
|
},
|
|
108502
109003
|
"attributes": [],
|
|
108503
109004
|
"references": "api/built-in-components.html#teleport"
|
|
@@ -108506,7 +109007,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108506
109007
|
"name": "Suspense",
|
|
108507
109008
|
"description": {
|
|
108508
109009
|
"kind": "markdown",
|
|
108509
|
-
"value": "\n컴포넌트 트리 내에서 중첩된 비동기 의존성을 조율하는 데 사용됩니다.\n\n- **Props**\n\n ```ts\n interface SuspenseProps {\n timeout?: string | number\n suspensible?: boolean\n }\n ```\n\n- **이벤트**\n\n - `@resolve`\n - `@pending`\n - `@fallback`\n\n- **상세 설명**\n\n `<Suspense>`는
|
|
109010
|
+
"value": "\n컴포넌트 트리 내에서 중첩된 비동기 의존성을 조율하는 데 사용됩니다.\n\n- **Props**\n\n ```ts\n interface SuspenseProps {\n timeout?: string | number\n suspensible?: boolean\n }\n ```\n\n- **이벤트**\n\n - `@resolve`\n - `@pending`\n - `@fallback`\n\n- **상세 설명**\n\n `<Suspense>`는 `#default` 슬롯과 `#fallback` 슬롯, 두 개의 슬롯을 받습니다. 기본 슬롯을 메모리에서 렌더링하는 동안 fallback 슬롯의 내용을 표시합니다.\n\n 기본 슬롯을 렌더링하는 동안 비동기 의존성([비동기 컴포넌트](https://ko.vuejs.org/guide/components/async.html) 및 [`async setup()`](https://ko.vuejs.org/guide/built-ins/suspense.html#async-setup)이 있는 컴포넌트)을 만나면, 모든 의존성이 해결될 때까지 기본 슬롯을 표시하지 않습니다.\n\n Suspense를 `suspensible`로 설정하면, 모든 비동기 의존성이 부모 Suspense에서 처리됩니다. [구현 세부사항](https://github.com/vuejs/core/pull/6736)을 참고하세요.\n\n- **더 알아보기** [가이드 - Suspense](https://ko.vuejs.org/guide/built-ins/suspense.html)\n"
|
|
108510
109011
|
},
|
|
108511
109012
|
"attributes": [],
|
|
108512
109013
|
"references": "api/built-in-components.html#suspense"
|
|
@@ -108515,7 +109016,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108515
109016
|
"name": "component",
|
|
108516
109017
|
"description": {
|
|
108517
109018
|
"kind": "markdown",
|
|
108518
|
-
"value": "\n동적 컴포넌트 또는 엘리먼트를
|
|
109019
|
+
"value": "\n동적 컴포넌트 또는 엘리먼트를 렌더링(rendering)하기 위한 \"메타 컴포넌트\"입니다.\n\n- **Props**\n\n ```ts\n interface DynamicComponentProps {\n is: string | Component\n }\n ```\n\n- **상세 설명**\n\n 실제로 렌더링할 컴포넌트는 `is` prop에 따라 결정됩니다.\n\n - `is`가 문자열일 경우, HTML 태그 이름이거나 등록된 컴포넌트의 이름일 수 있습니다.\n\n - 또는, `is`에 컴포넌트의 정의 자체를 직접 바인딩(binding)할 수도 있습니다.\n\n- **예시**\n\n 등록된 이름으로 컴포넌트 렌더링하기 (옵션 API):\n\n ```vue\n <script>\n import Foo from './Foo.vue'\n import Bar from './Bar.vue'\n\n export default {\n components: { Foo, Bar },\n data() {\n return {\n view: 'Foo'\n }\n }\n }\n <\/script>\n\n <template>\n <component :is=\"view\" />\n </template>\n ```\n\n 컴포넌트 정의로 렌더링하기 (`<script setup>`을 사용하는 컴포지션 API):\n\n ```vue\n <script setup>\n import Foo from './Foo.vue'\n import Bar from './Bar.vue'\n <\/script>\n\n <template>\n <component :is=\"Math.random() > 0.5 ? Foo : Bar\" />\n </template>\n ```\n\n HTML 엘리먼트 렌더링하기:\n\n ```html\n <component :is=\"href ? 'a' : 'span'\"></component>\n ```\n\n [내장 컴포넌트](./built-in-components)도 모두 `is`에 전달할 수 있지만, 이름으로 전달하려면 반드시 등록해야 합니다. 예를 들어:\n\n ```vue\n <script>\n import { Transition, TransitionGroup } from 'vue'\n\n export default {\n components: {\n Transition,\n TransitionGroup\n }\n }\n <\/script>\n\n <template>\n <component :is=\"isGroup ? 'TransitionGroup' : 'Transition'\">\n ...\n </component>\n </template>\n ```\n\n 컴포넌트 자체를 `is`에 전달하는 경우(예: `<script setup>`에서)는 등록이 필요하지 않습니다.\n\n `<component>` 태그에 `v-model`을 사용할 경우, 템플릿 컴파일러는 이를 `modelValue` prop과 `update:modelValue` 이벤트 리스너(listener)로 확장합니다. 이는 다른 컴포넌트와 마찬가지입니다. 하지만 이 동작은 `<input>`이나 `<select>`와 같은 네이티브 HTML 엘리먼트와는 호환되지 않습니다. 따라서 동적으로 생성된 네이티브 엘리먼트에 `v-model`을 사용하는 것은 동작하지 않습니다:\n\n ```vue\n <script setup>\n import { ref } from 'vue'\n\n const tag = ref('input')\n const username = ref('')\n <\/script>\n\n <template>\n <!-- 'input'이 네이티브 HTML 엘리먼트이므로 동작하지 않습니다 -->\n <component :is=\"tag\" v-model=\"username\" />\n </template>\n ```\n\n 이와 같은 예외적인 경우는 드물며, 실제 애플리케이션에서 네이티브 폼 필드는 보통 컴포넌트로 감싸서 사용합니다. 만약 네이티브 엘리먼트를 직접 사용해야 한다면, `v-model`을 속성과 이벤트로 수동 분리하여 사용할 수 있습니다.\n\n- **관련 문서** [동적 컴포넌트](https://ko.vuejs.org/guide/essentials/component-basics.html#dynamic-components)\n"
|
|
108519
109020
|
},
|
|
108520
109021
|
"attributes": [],
|
|
108521
109022
|
"references": "api/built-in-special-elements.html#component"
|
|
@@ -108524,7 +109025,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108524
109025
|
"name": "slot",
|
|
108525
109026
|
"description": {
|
|
108526
109027
|
"kind": "markdown",
|
|
108527
|
-
"value": "\n템플릿에서 슬롯 콘텐츠의 출력 위치를 나타냅니다.\n\n- **Props**\n\n ```ts\n interface SlotProps {\n /**\n * <slot>에 전달된 모든 prop은\n * 스코프 슬롯의 인자로 전달됩니다\n */\n [key: string]: any\n /**\n * 슬롯 이름을 지정할 때 사용됩니다.\n */\n name?: string\n }\n ```\n\n- **상세 설명**\n\n `<slot>` 엘리먼트는 `name` 속성을 사용하여 슬롯 이름을 지정할 수 있습니다. `name`이 지정되지 않으면 기본 슬롯이 렌더링됩니다. 슬롯 엘리먼트에
|
|
109028
|
+
"value": "\n템플릿에서 슬롯(slot) 콘텐츠의 출력 위치를 나타냅니다.\n\n- **Props**\n\n ```ts\n interface SlotProps {\n /**\n * <slot>에 전달된 모든 prop은\n * 스코프 슬롯의 인자로 전달됩니다\n */\n [key: string]: any\n /**\n * 슬롯 이름을 지정할 때 사용됩니다.\n */\n name?: string\n }\n ```\n\n- **상세 설명**\n\n `<slot>` 엘리먼트는 `name` 속성을 사용하여 슬롯 이름을 지정할 수 있습니다. `name`이 지정되지 않으면 기본 슬롯이 렌더링됩니다. 슬롯 엘리먼트에 지정한 추가 속성들은 부모에서 정의된 스코프 슬롯(scoped slots)에 슬롯 prop으로 전달됩니다.\n\n 해당 엘리먼트 자체는 일치하는 슬롯 콘텐츠로 대체됩니다.\n\n Vue 템플릿의 `<slot>` 엘리먼트는 JavaScript로 컴파일되므로, [네이티브 `<slot>` 엘리먼트](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot)와 혼동하지 마세요.\n\n- **관련 문서** [컴포넌트 - 슬롯](https://ko.vuejs.org/guide/components/slots.html)\n"
|
|
108528
109029
|
},
|
|
108529
109030
|
"attributes": [],
|
|
108530
109031
|
"references": "api/built-in-special-elements.html#slot"
|
|
@@ -108533,7 +109034,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108533
109034
|
"name": "template",
|
|
108534
109035
|
"description": {
|
|
108535
109036
|
"kind": "markdown",
|
|
108536
|
-
"value": "\n`<template>` 태그는 DOM에 엘리먼트를 렌더링하지
|
|
109037
|
+
"value": "\n`<template>` 태그는 DOM에 엘리먼트를 렌더링하지 않으면서 내장 디렉티브를 사용하고 싶을 때 플레이스홀더 역할을 합니다.\n\n- **상세 설명**\n\n `<template>`에 대한 특별한 처리는 다음 디렉티브(directive) 중 하나와 함께 사용될 때만 적용됩니다:\n\n - `v-if`, `v-else-if`, 또는 `v-else`\n - `v-for`\n - `v-slot`\n\n 이들 디렉티브가 없으면 [네이티브 `<template>` 엘리먼트](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template)로 렌더링됩니다.\n\n `v-for`가 있는 `<template>`에는 [`key` 속성](https://ko.vuejs.org/api/built-in-special-attributes.html#key)을 사용할 수 있습니다. 그 외의 모든 속성과 디렉티브는, 대응하는 엘리먼트가 없으면 의미가 없으므로 무시됩니다.\n\n 싱글 파일 컴포넌트는 전체 템플릿을 감싸기 위해 [최상위 `<template>` 태그](https://ko.vuejs.org/api/sfc-spec.html#language-blocks)를 사용합니다. 이 사용법은 위에서 설명한 `<template>`의 사용과는 별개입니다. 최상위 태그는 템플릿 자체의 일부가 아니며, 디렉티브와 같은 템플릿 문법을 지원하지 않습니다.\n\n- **관련 문서**\n - [가이드 - `<template>`에서의 `v-if`](https://ko.vuejs.org/guide/essentials/conditional.html#v-if-on-template)\n - [가이드 - `<template>`에서의 `v-for`](https://ko.vuejs.org/guide/essentials/list.html#v-for-on-template)\n - [가이드 - 명명된 슬롯](https://ko.vuejs.org/guide/components/slots.html#named-slots)\n"
|
|
108537
109038
|
},
|
|
108538
109039
|
"attributes": [],
|
|
108539
109040
|
"references": "api/built-in-special-elements.html#template"
|
|
@@ -108544,7 +109045,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108544
109045
|
"name": "v-text",
|
|
108545
109046
|
"description": {
|
|
108546
109047
|
"kind": "markdown",
|
|
108547
|
-
"value": "요소의 텍스트 콘텐츠를 업데이트합니다.\n\n- **기대값:** `string`\n\n- **세부사항**\n\n `v-text`는 요소의 [textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) 속성을 설정하여 동작하므로, 요소 내부의 기존 콘텐츠를 모두 덮어씁니다. `textContent`의 일부만 업데이트해야 한다면 [
|
|
109048
|
+
"value": "요소의 텍스트 콘텐츠를 업데이트합니다.\n\n- **기대값:** `string`\n\n- **세부사항**\n\n `v-text`는 요소의 [textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) 속성을 설정하여 동작하므로, 요소 내부의 기존 콘텐츠를 모두 덮어씁니다. `textContent`의 일부만 업데이트해야 한다면 [이중 중괄호(mustache) 보간](https://ko.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)을 대신 사용해야 합니다(예: <span v-pre>`<span>Keep this but update a {{dynamicPortion}}</span>`</span>).\n\n- **예시**\n\n ```html\n <span v-text=\"msg\"></span>\n <!-- 아래와 동일 -->\n <span>{{msg}}</span>\n ```\n\n- **참고** [템플릿 문법 - 텍스트 보간(interpolation)](https://ko.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)"
|
|
108548
109049
|
},
|
|
108549
109050
|
"references": "api/built-in-directives.html#v-text"
|
|
108550
109051
|
},
|
|
@@ -108552,7 +109053,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108552
109053
|
"name": "v-html",
|
|
108553
109054
|
"description": {
|
|
108554
109055
|
"kind": "markdown",
|
|
108555
|
-
"value": "요소의 [innerHTML](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML)을 업데이트합니다.\n\n- **기대값:** `string`\n\n- **세부사항**\n\n `v-html`의 내용은 일반 HTML로 삽입되며, Vue 템플릿 문법은 처리되지 않습니다. `v-html`을 사용해
|
|
109056
|
+
"value": "요소의 [innerHTML](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML)을 업데이트합니다.\n\n- **기대값:** `string`\n\n- **세부사항**\n\n `v-html`의 내용은 일반 HTML로 삽입되며, Vue 템플릿 문법은 처리되지 않습니다. `v-html`을 사용해 템플릿(template)을 조합하려고 한다면, 그 대신 컴포넌트(component)를 사용하는 방향으로 해결 방법을 다시 검토해 보세요.\n\n ::: warning 보안 주의\n 웹사이트에서 임의의 HTML을 동적으로 렌더링(rendering)하는 것은 매우 위험할 수 있습니다. 이는 쉽게 [XSS 공격](https://en.wikipedia.org/wiki/Cross-site_scripting)으로 이어질 수 있기 때문입니다. 신뢰할 수 있는 콘텐츠에만 `v-html`을 사용하고, 사용자가 제공한 콘텐츠에는 **절대** 사용하지 마세요.\n :::\n\n [싱글 파일 컴포넌트](https://ko.vuejs.org/guide/scaling-up/sfc.html)에서는, `scoped` 스타일이 `v-html` 내부의 콘텐츠에는 적용되지 않습니다. 이는 해당 HTML이 Vue의 템플릿 컴파일러에 의해 처리되지 않기 때문입니다. `v-html` 콘텐츠에 scoped CSS를 적용하려면 [CSS 모듈](./sfc-css-features#css-modules)을 사용하거나, BEM처럼 수동 스코핑 전략을 적용한 별도의 전역 `<style>` 요소를 사용할 수 있습니다.\n\n- **예시**\n\n ```html\n <div v-html=\"html\"></div>\n ```\n\n- **참고** [템플릿 문법 - Raw HTML](https://ko.vuejs.org/guide/essentials/template-syntax.html#raw-html)"
|
|
108556
109057
|
},
|
|
108557
109058
|
"references": "api/built-in-directives.html#v-html"
|
|
108558
109059
|
},
|
|
@@ -108560,7 +109061,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108560
109061
|
"name": "v-show",
|
|
108561
109062
|
"description": {
|
|
108562
109063
|
"kind": "markdown",
|
|
108563
|
-
"value": "표현식 값의 참/거짓에 따라 요소의 표시 여부를 토글합니다.\n\n- **기대값:** `any`\n\n- **세부사항**\n\n `v-show`는 인라인 스타일을 통해 `display` CSS 속성을 설정하여 동작하며, 요소가 보일 때 초기 `display` 값을 최대한 존중합니다. 또한 조건이 변경될 때
|
|
109064
|
+
"value": "표현식 값의 참/거짓에 따라 요소의 표시 여부를 토글합니다.\n\n- **기대값:** `any`\n\n- **세부사항**\n\n `v-show`는 인라인 스타일을 통해 `display` CSS 속성을 설정하여 동작하며, 요소가 보일 때 초기 `display` 값을 최대한 존중합니다. 또한 조건이 변경될 때 트랜지션(transition)을 트리거합니다.\n\n- **참고** [조건부 렌더링 - v-show](https://ko.vuejs.org/guide/essentials/conditional.html#v-show)"
|
|
108564
109065
|
},
|
|
108565
109066
|
"references": "api/built-in-directives.html#v-show"
|
|
108566
109067
|
},
|
|
@@ -108568,7 +109069,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108568
109069
|
"name": "v-if",
|
|
108569
109070
|
"description": {
|
|
108570
109071
|
"kind": "markdown",
|
|
108571
|
-
"value": "표현식 값의 참/거짓에 따라 요소 또는 템플릿 조각을 조건부로 렌더링합니다.\n\n- **기대값:** `any`\n\n- **세부사항**\n\n `v-if` 요소가 토글될 때, 해당 요소와 그 안의 디렉티브/컴포넌트는 파괴되고 다시 생성됩니다. 초기 조건이 거짓이라면 내부 콘텐츠는 전혀 렌더링되지 않습니다.\n\n `<template>`에
|
|
109072
|
+
"value": "표현식 값의 참/거짓에 따라 요소 또는 템플릿 조각을 조건부로 렌더링합니다.\n\n- **기대값:** `any`\n\n- **세부사항**\n\n `v-if` 요소가 토글될 때, 해당 요소와 그 안의 디렉티브/컴포넌트는 파괴되고 다시 생성됩니다. 초기 조건이 거짓이라면 내부 콘텐츠는 전혀 렌더링되지 않습니다.\n\n `<template>`에 사용하여, 텍스트만 포함하거나 여러 요소를 포함하는 조건부 블록을 나타낼 수 있습니다.\n\n 이 디렉티브(directive)는 조건이 변경될 때 트랜지션을 트리거합니다.\n\n `v-for`와 함께 사용할 때는 `v-if`가 더 높은 우선순위를 가집니다. 이 두 디렉티브를 하나의 요소에 함께 사용하는 것은 권장하지 않습니다. 자세한 내용은 [리스트 렌더링 가이드](https://ko.vuejs.org/guide/essentials/list.html#v-for-with-v-if)를 참고하세요.\n\n- **참고** [조건부 렌더링 - v-if](https://ko.vuejs.org/guide/essentials/conditional.html#v-if)"
|
|
108572
109073
|
},
|
|
108573
109074
|
"references": "api/built-in-directives.html#v-if"
|
|
108574
109075
|
},
|
|
@@ -108577,7 +109078,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108577
109078
|
"valueSet": "v",
|
|
108578
109079
|
"description": {
|
|
108579
109080
|
"kind": "markdown",
|
|
108580
|
-
"value": "`v-if` 또는 `v-if` / `v-else-if` 체인의 \"else 블록\"을 나타냅니다.\n\n- **표현식 없음**\n\n- **세부사항**\n\n - 제한: 이전 형제 요소에 `v-if` 또는 `v-else-if`가 있어야 합니다.\n\n - `<template>`에
|
|
109081
|
+
"value": "`v-if` 또는 `v-if` / `v-else-if` 체인의 \"else 블록\"을 나타냅니다.\n\n- **표현식 없음**\n\n- **세부사항**\n\n - 제한: 이전 형제 요소에 `v-if` 또는 `v-else-if`가 있어야 합니다.\n\n - `<template>`에 사용하여, 텍스트만 포함하거나 여러 요소를 포함하는 조건부 블록을 나타낼 수 있습니다.\n\n- **예시**\n\n ```html\n <div v-if=\"Math.random() > 0.5\">\n Now you see me\n </div>\n <div v-else>\n Now you don't\n </div>\n ```\n\n- **참고** [조건부 렌더링 - v-else](https://ko.vuejs.org/guide/essentials/conditional.html#v-else)"
|
|
108581
109082
|
},
|
|
108582
109083
|
"references": "api/built-in-directives.html#v-else"
|
|
108583
109084
|
},
|
|
@@ -108585,7 +109086,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108585
109086
|
"name": "v-else-if",
|
|
108586
109087
|
"description": {
|
|
108587
109088
|
"kind": "markdown",
|
|
108588
|
-
"value": "`v-if`의 \"else if 블록\"을 나타냅니다. 체이닝이 가능합니다.\n\n- **기대값:** `any`\n\n- **세부사항**\n\n - 제한: 이전 형제 요소에 `v-if` 또는 `v-else-if`가 있어야 합니다.\n\n - `<template>`에
|
|
109089
|
+
"value": "`v-if`의 \"else if 블록\"을 나타냅니다. 체이닝이 가능합니다.\n\n- **기대값:** `any`\n\n- **세부사항**\n\n - 제한: 이전 형제 요소에 `v-if` 또는 `v-else-if`가 있어야 합니다.\n\n - `<template>`에 사용하여, 텍스트만 포함하거나 여러 요소를 포함하는 조건부 블록을 나타낼 수 있습니다.\n\n- **예시**\n\n ```html\n <div v-if=\"type === 'A'\">\n A\n </div>\n <div v-else-if=\"type === 'B'\">\n B\n </div>\n <div v-else-if=\"type === 'C'\">\n C\n </div>\n <div v-else>\n Not A/B/C\n </div>\n ```\n\n- **참고** [조건부 렌더링 - v-else-if](https://ko.vuejs.org/guide/essentials/conditional.html#v-else-if)"
|
|
108589
109090
|
},
|
|
108590
109091
|
"references": "api/built-in-directives.html#v-else-if"
|
|
108591
109092
|
},
|
|
@@ -108593,7 +109094,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108593
109094
|
"name": "v-for",
|
|
108594
109095
|
"description": {
|
|
108595
109096
|
"kind": "markdown",
|
|
108596
|
-
"value": "소스 데이터를 기반으로 요소 또는 템플릿 블록을 여러 번 렌더링합니다.\n\n- **기대값:** `Array | Object | number | string | Iterable`\n\n- **세부사항**\n\n 디렉티브의 값은 현재 반복 중인 요소에 대한 별칭을 제공하기 위해 `alias in expression`이라는 특수 문법을 사용해야 합니다:\n\n ```html\n <div v-for=\"item in items\">\n {{ item.text }}\n </div>\n ```\n\n 또는, 인덱스(또는 객체에서 사용할 경우 키)에 대한 별칭도 지정할 수 있습니다:\n\n ```html\n <div v-for=\"(item, index) in items\"></div>\n <div v-for=\"(value, key) in object\"></div>\n <div v-for=\"(value, name, index) in object\"></div>\n ```\n\n `v-for
|
|
109097
|
+
"value": "소스 데이터를 기반으로 요소 또는 템플릿 블록을 여러 번 렌더링합니다.\n\n- **기대값:** `Array | Object | number | string | Iterable`\n\n- **세부사항**\n\n 디렉티브의 값은 현재 반복 중인 요소에 대한 별칭을 제공하기 위해 `alias in expression`이라는 특수 문법을 사용해야 합니다:\n\n ```html\n <div v-for=\"item in items\">\n {{ item.text }}\n </div>\n ```\n\n 또는, 인덱스(또는 객체에서 사용할 경우 키)에 대한 별칭도 지정할 수 있습니다:\n\n ```html\n <div v-for=\"(item, index) in items\"></div>\n <div v-for=\"(value, key) in object\"></div>\n <div v-for=\"(value, name, index) in object\"></div>\n ```\n\n `v-for`는 기본적으로 요소를 이동시키지 않고 제자리에서 패치하려고 시도합니다. 요소의 순서를 강제로 재정렬하려면 `key` 특수 속성으로 정렬 힌트를 제공해야 합니다:\n\n ```html\n <div v-for=\"item in items\" :key=\"item.id\">\n {{ item.text }}\n </div>\n ```\n\n `v-for`는 [이터러블 프로토콜](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol)을 구현한 값(네이티브 `Map` 및 `Set` 포함)에도 사용할 수 있습니다.\n\n- **참고**\n - [리스트 렌더링](https://ko.vuejs.org/guide/essentials/list.html)"
|
|
108597
109098
|
},
|
|
108598
109099
|
"references": "api/built-in-directives.html#v-for"
|
|
108599
109100
|
},
|
|
@@ -108601,7 +109102,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108601
109102
|
"name": "v-on",
|
|
108602
109103
|
"description": {
|
|
108603
109104
|
"kind": "markdown",
|
|
108604
|
-
"value": "요소에 이벤트
|
|
109105
|
+
"value": "요소에 이벤트 리스너(listener)를 연결합니다.\n\n- **축약형:** `@`\n\n- **기대값:** `Function | 인라인 문장 | Object (인자 없이)`\n\n- **인자:** `event` (Object 문법 사용 시 선택)\n\n- **수식어**\n\n - `.stop` - `event.stopPropagation()` 호출\n - `.prevent` - `event.preventDefault()` 호출\n - `.capture` - 캡처 모드로 이벤트 리스너 추가\n - `.self` - 이벤트가 이 요소에서 발생한 경우에만 핸들러 트리거\n - `.{keyAlias}` - 특정 키에서만 핸들러 트리거\n - `.once` - 핸들러를 최대 한 번만 트리거\n - `.left` - 마우스 왼쪽 버튼 이벤트에서만 핸들러 트리거\n - `.right` - 마우스 오른쪽 버튼 이벤트에서만 핸들러 트리거\n - `.middle` - 마우스 가운데 버튼 이벤트에서만 핸들러 트리거\n - `.passive` - `{ passive: true }`로 DOM 이벤트 연결\n\n- **세부사항**\n\n 이벤트 타입은 인자로 표시됩니다. 표현식은 메서드 이름이나 인라인 문장일 수 있으며, 수식어(modifiers)가 있으면 생략할 수도 있습니다.\n\n 일반 요소에 사용하면 [**네이티브 DOM 이벤트**](https://developer.mozilla.org/en-US/docs/Web/Events)만 리스닝합니다. 커스텀 엘리먼트 컴포넌트에 사용하면 해당 자식 컴포넌트에서 발생한 **커스텀 이벤트**를 리스닝합니다.\n\n 네이티브 DOM 이벤트를 리스닝할 때, 메서드는 네이티브 이벤트를 유일한 인자로 받습니다. 인라인 문장을 사용할 경우, 특별한 `$event` 속성에 접근할 수 있습니다: `v-on:click=\"handle('ok', $event)\"`.\n\n `v-on`은 인자 없이 이벤트/리스너 쌍의 객체에 바인딩(binding)하는 것도 지원합니다. 객체 문법을 사용할 때는 수식어를 지원하지 않습니다.\n\n- **예시**\n\n ```html\n <!-- 메서드 핸들러 -->\n <button v-on:click=\"doThis\"></button>\n\n <!-- 동적 이벤트 -->\n <button v-on:[event]=\"doThis\"></button>\n\n <!-- 인라인 문장 -->\n <button v-on:click=\"doThat('hello', $event)\"></button>\n\n <!-- 축약형 -->\n <button @click=\"doThis\"></button>\n\n <!-- 축약형 동적 이벤트 -->\n <button @[event]=\"doThis\"></button>\n\n <!-- 이벤트 전파 중지 -->\n <button @click.stop=\"doThis\"></button>\n\n <!-- 기본 동작 방지 -->\n <button @click.prevent=\"doThis\"></button>\n\n <!-- 표현식 없이 기본 동작 방지 -->\n <form @submit.prevent></form>\n\n <!-- 수식어 체이닝 -->\n <button @click.stop.prevent=\"doThis\"></button>\n\n <!-- keyAlias를 사용한 키 수식어 -->\n <input @keyup.enter=\"onEnter\" />\n\n <!-- 클릭 이벤트가 최대 한 번만 트리거됨 -->\n <button v-on:click.once=\"doThis\"></button>\n\n <!-- 객체 문법 -->\n <button v-on=\"{ mousedown: doThis, mouseup: doThat }\"></button>\n ```\n\n 자식 컴포넌트에서 커스텀 이벤트를 리스닝(자식에서 \"my-event\"가 emit될 때 핸들러가 호출됨):\n\n ```html\n <MyComponent @my-event=\"handleThis\" />\n\n <!-- 인라인 문장 -->\n <MyComponent @my-event=\"handleThis(123, $event)\" />\n ```\n\n- **참고**\n - [이벤트 핸들링](https://ko.vuejs.org/guide/essentials/event-handling.html)\n - [컴포넌트 - 커스텀 이벤트](https://ko.vuejs.org/guide/essentials/component-basics.html#listening-to-events)"
|
|
108605
109106
|
},
|
|
108606
109107
|
"references": "api/built-in-directives.html#v-on"
|
|
108607
109108
|
},
|
|
@@ -108609,7 +109110,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108609
109110
|
"name": "v-bind",
|
|
108610
109111
|
"description": {
|
|
108611
109112
|
"kind": "markdown",
|
|
108612
|
-
"value": "하나 이상의 속성 또는 컴포넌트 prop을 표현식에 동적으로 바인딩합니다.\n\n- **축약형:**\n - `:` 또는 `.` (`.prop` 수식어 사용 시)\n - 값 생략(속성과 바인딩 값의 이름이 같을 때, 3.4+ 필요)\n\n- **기대값:** `any (인자 사용 시) | Object (인자 없이)`\n\n- **인자:** `attrOrProp (선택)`\n\n- **수식어**\n\n - `.camel` - 케밥 케이스 속성명을 camelCase로 변환\n - `.prop` - 바인딩을 DOM
|
|
109113
|
+
"value": "하나 이상의 속성 또는 컴포넌트 prop을 표현식에 동적으로 바인딩합니다.\n\n- **축약형:**\n - `:` 또는 `.` (`.prop` 수식어 사용 시)\n - 값 생략(속성과 바인딩 값의 이름이 같을 때, 3.4+ 필요)\n\n- **기대값:** `any (인자 사용 시) | Object (인자 없이)`\n\n- **인자:** `attrOrProp (선택)`\n\n- **수식어**\n\n - `.camel` - 케밥 케이스 속성명을 camelCase로 변환\n - `.prop` - 바인딩을 DOM 속성(property)으로 강제 설정 (3.2+)\n - `.attr` - 바인딩을 DOM 속성(attribute)으로 강제 설정 (3.2+)\n\n- **사용법**\n\n `class` 또는 `style` 속성에 바인딩할 때, `v-bind`는 Array 또는 Object와 같은 추가 값 타입을 지원합니다. 자세한 내용은 아래 가이드 섹션을 참고하세요.\n\n 요소에 바인딩을 설정할 때, Vue는 기본적으로 `in` 연산자 체크를 통해 해당 키가 속성(property)으로 정의되어 있는지 확인합니다. 속성이 정의되어 있으면, Vue는 값을 HTML 속성(attribute)이 아닌 DOM 속성(property)으로 설정합니다. 대부분의 경우 이 방식이 잘 동작하지만, `.prop` 또는 `.attr` 수식어를 명시적으로 사용하여 이 동작을 오버라이드할 수 있습니다. 특히 [커스텀 엘리먼트 작업 시](https://ko.vuejs.org/guide/extras/web-components.html#passing-dom-properties) 필요할 수 있습니다.\n\n 컴포넌트 prop 바인딩에 사용할 때, prop은 자식 컴포넌트에서 올바르게 선언되어 있어야 합니다.\n\n 인자 없이 사용할 경우, 속성명-값 쌍을 포함하는 객체를 바인딩할 수 있습니다.\n\n- **예시**\n\n ```html\n <!-- 속성 바인딩 -->\n <img v-bind:src=\"imageSrc\" />\n\n <!-- 동적 속성명 -->\n <button v-bind:[key]=\"value\"></button>\n\n <!-- 축약형 -->\n <img :src=\"imageSrc\" />\n\n <!-- 동일 이름 축약형 (3.4+), :src=\"src\"로 확장됨 -->\n <img :src />\n\n <!-- 축약형 동적 속성명 -->\n <button :[key]=\"value\"></button>\n\n <!-- 인라인 문자열 연결 -->\n <img :src=\"'/path/to/images/' + fileName\" />\n\n <!-- 클래스 바인딩 -->\n <div :class=\"{ red: isRed }\"></div>\n <div :class=\"[classA, classB]\"></div>\n <div :class=\"[classA, { classB: isB, classC: isC }]\"></div>\n\n <!-- 스타일 바인딩 -->\n <div :style=\"{ fontSize: size + 'px' }\"></div>\n <div :style=\"[styleObjectA, styleObjectB]\"></div>\n\n <!-- 속성 객체 바인딩 -->\n <div v-bind=\"{ id: someProp, 'other-attr': otherProp }\"></div>\n\n <!-- prop 바인딩. \"prop\"은 자식 컴포넌트에서 선언되어야 함 -->\n <MyComponent :prop=\"someThing\" />\n\n <!-- 부모와 자식 컴포넌트에서 공통된 prop 전달 -->\n <MyComponent v-bind=\"$props\" />\n\n <!-- XLink -->\n <svg><a :xlink:special=\"foo\"></a></svg>\n ```\n\n `.prop` 수식어에는 전용 축약형 `.`도 있습니다:\n\n ```html\n <div :someProperty.prop=\"someObject\"></div>\n\n <!-- 아래와 동일 -->\n <div .someProperty=\"someObject\"></div>\n ```\n\n `.camel` 수식어는 in-DOM 템플릿에서 `v-bind` 속성명을 camelCase로 변환할 수 있습니다. 예: SVG `viewBox` 속성\n\n ```html\n <svg :view-box.camel=\"viewBox\"></svg>\n ```\n\n `.camel`은 문자열 템플릿을 사용하거나, 빌드 단계에서 템플릿을 미리 컴파일하는 경우 필요하지 않습니다.\n\n- **참고**\n - [클래스 및 스타일 바인딩](https://ko.vuejs.org/guide/essentials/class-and-style.html)\n - [컴포넌트 - Prop 전달 세부사항](https://ko.vuejs.org/guide/components/props.html#prop-passing-details)"
|
|
108613
109114
|
},
|
|
108614
109115
|
"references": "api/built-in-directives.html#v-bind"
|
|
108615
109116
|
},
|
|
@@ -108625,7 +109126,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108625
109126
|
"name": "v-slot",
|
|
108626
109127
|
"description": {
|
|
108627
109128
|
"kind": "markdown",
|
|
108628
|
-
"value": "props를 받을 것으로 예상되는 명명된 슬롯 또는 스코프
|
|
109129
|
+
"value": "props를 받을 것으로 예상되는 명명된 슬롯(named slots) 또는 스코프 슬롯(scoped slots)을 나타냅니다.\n\n- **축약형:** `#`\n\n- **기대값:** 함수 인자 위치에서 유효한 JavaScript 표현식(구조 분해 지원 포함). 선택 사항 - 슬롯에 props가 전달될 것으로 예상될 때만 필요.\n\n- **인자:** 슬롯 이름(선택, 기본값은 `default`)\n\n- **제한:**\n\n - `<template>`\n - [컴포넌트](https://ko.vuejs.org/guide/components/slots.html#scoped-slots) (props가 있는 단일 기본 슬롯의 경우)\n\n- **예시**\n\n ```html\n <!-- 명명된 슬롯 -->\n <BaseLayout>\n <template v-slot:header>\n Header content\n </template>\n\n <template v-slot:default>\n Default slot content\n </template>\n\n <template v-slot:footer>\n Footer content\n </template>\n </BaseLayout>\n\n <!-- props를 받는 명명된 슬롯 -->\n <InfiniteScroll>\n <template v-slot:item=\"slotProps\">\n <div class=\"item\">\n {{ slotProps.item.text }}\n </div>\n </template>\n </InfiniteScroll>\n\n <!-- 구조 분해와 함께 props를 받는 기본 슬롯 -->\n <Mouse v-slot=\"{ x, y }\">\n Mouse position: {{ x }}, {{ y }}\n </Mouse>\n ```\n\n- **참고**\n - [컴포넌트 - 슬롯](https://ko.vuejs.org/guide/components/slots.html)"
|
|
108629
109130
|
},
|
|
108630
109131
|
"references": "api/built-in-directives.html#v-slot"
|
|
108631
109132
|
},
|
|
@@ -108634,7 +109135,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108634
109135
|
"valueSet": "v",
|
|
108635
109136
|
"description": {
|
|
108636
109137
|
"kind": "markdown",
|
|
108637
|
-
"value": "이 요소와 모든 자식에 대한 컴파일을 건너뜁니다.\n\n- **표현식 없음**\n\n- **세부사항**\n\n `v-pre`가 있는 요소 내부에서는 모든 Vue 템플릿 문법이 그대로 보존되어 렌더링됩니다. 가장 일반적인 사용 사례는 원시
|
|
109138
|
+
"value": "이 요소와 모든 자식에 대한 컴파일을 건너뜁니다.\n\n- **표현식 없음**\n\n- **세부사항**\n\n `v-pre`가 있는 요소 내부에서는 모든 Vue 템플릿 문법이 그대로 보존되어 렌더링됩니다. 가장 일반적인 사용 사례는 원시 이중 중괄호 태그를 표시하는 것입니다.\n\n- **예시**\n\n ```html\n <span v-pre>{{ this will not be compiled }}</span>\n ```"
|
|
108638
109139
|
},
|
|
108639
109140
|
"references": "api/built-in-directives.html#v-pre"
|
|
108640
109141
|
},
|
|
@@ -108643,7 +109144,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108643
109144
|
"valueSet": "v",
|
|
108644
109145
|
"description": {
|
|
108645
109146
|
"kind": "markdown",
|
|
108646
|
-
"value": "요소와 컴포넌트를 한 번만 렌더링하고, 이후 업데이트를 건너뜁니다.\n\n- **표현식 없음**\n\n- **세부사항**\n\n 이후 다시 렌더링될 때, 해당 요소/컴포넌트와 모든 자식은 정적 콘텐츠로 간주되어
|
|
109147
|
+
"value": "요소와 컴포넌트를 한 번만 렌더링하고, 이후 업데이트를 건너뜁니다.\n\n- **표현식 없음**\n\n- **세부사항**\n\n 이후 다시 렌더링될 때, 해당 요소/컴포넌트와 모든 자식은 정적 콘텐츠로 간주되어 건너뛰게 됩니다. 이는 업데이트 성능을 최적화하는 데 사용할 수 있습니다.\n\n ```html\n <!-- 단일 요소 -->\n <span v-once>This will never change: {{msg}}</span>\n <!-- 자식이 있는 요소 -->\n <div v-once>\n <h1>Comment</h1>\n <p>{{msg}}</p>\n </div>\n <!-- 컴포넌트 -->\n <MyComponent v-once :comment=\"msg\"></MyComponent>\n <!-- `v-for` 디렉티브 -->\n <ul>\n <li v-for=\"i in list\" v-once>{{i}}</li>\n </ul>\n ```\n\n 3.2부터는 [`v-memo`](#v-memo)를 사용해 무효화 조건과 함께 템플릿의 일부를 메모이즈할 수도 있습니다.\n\n- **참고**\n - [데이터 바인딩 문법 - 보간](https://ko.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)\n - [v-memo](#v-memo)"
|
|
108647
109148
|
},
|
|
108648
109149
|
"references": "api/built-in-directives.html#v-once"
|
|
108649
109150
|
},
|
|
@@ -108651,7 +109152,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108651
109152
|
"name": "v-memo",
|
|
108652
109153
|
"description": {
|
|
108653
109154
|
"kind": "markdown",
|
|
108654
|
-
"value": "- 3.2+에서만 지원\n\n- **기대값:** `any[]`\n\n- **세부사항**\n\n 템플릿의 서브 트리를 메모이즈합니다. 요소와 컴포넌트 모두에 사용할 수 있습니다. 디렉티브는
|
|
109155
|
+
"value": "- 3.2+에서만 지원\n\n- **기대값:** `any[]`\n\n- **세부사항**\n\n 템플릿의 서브 트리를 메모이즈합니다. 요소와 컴포넌트 모두에 사용할 수 있습니다. 디렉티브는 메모이제이션(memoization)을 위해 비교할 고정 길이의 의존성 값 배열을 받습니다. 배열의 모든 값이 마지막 렌더와 동일하다면, 전체 서브 트리에 대한 업데이트를 건너뜁니다. 예를 들어:\n\n ```html\n <div v-memo=\"[valueA, valueB]\">\n ...\n </div>\n ```\n\n 컴포넌트가 다시 렌더링될 때, `valueA`와 `valueB`가 모두 동일하다면 이 `<div>`와 그 자식에 대한 모든 업데이트를 건너뜁니다. 실제로, 메모이즈된 서브 트리의 복사본을 재사용할 수 있으므로 Virtual DOM VNode 생성조차도 건너뜁니다.\n\n 메모이제이션 배열을 올바르게 지정하는 것이 중요합니다. 그렇지 않으면 실제로 적용되어야 할 업데이트를 건너뛸 수 있습니다. 의존성 배열이 비어있는 `v-memo=\"[]\"`는 기능적으로 `v-once`와 동일합니다.\n\n **`v-for`와 함께 사용하기**\n\n `v-memo`는 성능이 중요한 시나리오에서 마이크로 최적화를 위해 제공되며, 거의 필요하지 않습니다. 가장 일반적인 활용 사례는 대용량 `v-for` 리스트(길이 > 1000)를 렌더링할 때입니다:\n\n ```html\n <div v-for=\"item in list\" :key=\"item.id\" v-memo=\"[item.id === selected]\">\n <p>ID: {{ item.id }} - selected: {{ item.id === selected }}</p>\n <p>...more child nodes</p>\n </div>\n ```\n\n 컴포넌트의 `selected` 상태가 변경될 때, 대부분의 항목이 동일하더라도 많은 VNode가 생성됩니다. 여기서 `v-memo` 사용은 \"이 항목이 선택됨/해제됨으로 변경된 경우에만 업데이트하라\"는 의미입니다. 영향을 받지 않은 항목은 이전 VNode를 재사용하여 diffing을 완전히 건너뜁니다. 이때, Vue가 항목의 `:key`에서 이를 자동으로 추론하므로 memo 의존성 배열에 `item.id`를 포함할 필요는 없습니다.\n\n :::warning\n `v-memo`를 `v-for`와 함께 사용할 때는 반드시 같은 요소에 사용해야 합니다. **`v-memo`는 `v-for` 내부에서는 동작하지 않습니다.**\n :::\n\n `v-memo`는 자식 컴포넌트 업데이트 체크가 비최적화된 특정 엣지 케이스에서 원치 않는 업데이트를 수동으로 방지하는 데도 사용할 수 있습니다. 하지만, 필요한 업데이트가 건너뛰어지지 않도록 올바른 의존성 배열을 지정하는 것은 개발자의 책임입니다.\n\n- **참고**\n - [v-once](#v-once)"
|
|
108655
109156
|
},
|
|
108656
109157
|
"references": "api/built-in-directives.html#v-memo"
|
|
108657
109158
|
},
|
|
@@ -108660,7 +109161,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108660
109161
|
"valueSet": "v",
|
|
108661
109162
|
"description": {
|
|
108662
109163
|
"kind": "markdown",
|
|
108663
|
-
"value": "컴파일되지 않은
|
|
109164
|
+
"value": "컴파일되지 않은 템플릿이 준비되기 전까지 화면에서 숨기는 데 사용됩니다.\n\n- **표현식 없음**\n\n- **세부사항**\n\n **이 디렉티브는 빌드 단계가 없는 환경에서만 필요합니다.**\n\n in-DOM 템플릿을 사용할 때, \"컴파일되지 않은 템플릿의 깜빡임\"이 발생할 수 있습니다. 즉, 마운트(mount)된 컴포넌트가 렌더링된 콘텐츠로 교체되기 전까지 사용자가 원시 이중 중괄호 태그를 볼 수 있습니다.\n\n `v-cloak`는 관련 컴포넌트 인스턴스(instance)가 마운트될 때까지 요소에 남아 있습니다. `[v-cloak] { display: none }`과 같은 CSS 규칙과 결합하여, 컴포넌트가 준비될 때까지 원시 템플릿을 숨기는 데 사용할 수 있습니다.\n\n- **예시**\n\n ```css\n [v-cloak] {\n display: none;\n }\n ```\n\n ```html\n <div v-cloak>\n {{ message }}\n </div>\n ```\n\n 컴파일이 완료될 때까지 `<div>`는 보이지 않습니다."
|
|
108664
109165
|
},
|
|
108665
109166
|
"references": "api/built-in-directives.html#v-cloak"
|
|
108666
109167
|
},
|
|
@@ -108668,7 +109169,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108668
109169
|
"name": "key",
|
|
108669
109170
|
"description": {
|
|
108670
109171
|
"kind": "markdown",
|
|
108671
|
-
"value": "`key` 특수 속성은 주로 Vue의 가상 DOM 알고리즘이 새로운 노드 목록과 이전 노드 목록을 비교(diffing)할 때 vnode를 식별하는 힌트로 사용됩니다.\n\n- **기대값:** `number | string | symbol`\n\n- **세부사항**\n\n key가 없으면, Vue는 요소의 이동을 최소화하고 같은 타입의 요소를 최대한 제자리에서 패치/재사용하려는 알고리즘을 사용합니다. key가 있으면, key의 순서 변경에 따라
|
|
109172
|
+
"value": "`key` 특수 속성은 주로 Vue의 가상 DOM 알고리즘이 새로운 노드 목록과 이전 노드 목록을 비교(diffing)할 때 vnode를 식별하는 힌트로 사용됩니다.\n\n- **기대값:** `number | string | symbol`\n\n- **세부사항**\n\n key가 없으면, Vue는 요소의 이동을 최소화하고 같은 타입의 요소를 최대한 제자리에서 패치/재사용하려는 알고리즘을 사용합니다. key가 있으면, key의 순서 변경에 따라 요소가 재정렬되고, 더 이상 존재하지 않는 key를 가진 요소는 항상 제거/파괴됩니다.\n\n 같은 부모를 둔 자식들은 **고유한 key**를 가져야 합니다. 중복된 key는 렌더링(rendering) 오류를 일으킵니다.\n\n 가장 일반적인 사용 사례는 `v-for`와 결합하는 것입니다:\n\n ```html\n <ul>\n <li v-for=\"item in items\" :key=\"item.id\">...</li>\n </ul>\n ```\n\n 또한 요소/컴포넌트(component)를 재사용하는 대신 교체하도록 강제할 때도 사용할 수 있습니다. 이는 다음과 같은 경우에 유용할 수 있습니다:\n\n - 컴포넌트의 라이프사이클(lifecycle) 훅(hook)을 제대로 트리거하고 싶을 때\n - 트랜지션(transition)을 트리거하고 싶을 때\n\n 예를 들어:\n\n ```html\n <transition>\n <span :key=\"text\">{{ text }}</span>\n </transition>\n ```\n\n `text`가 변경되면, `<span>`은 패치되는 대신 항상 교체되므로 트랜지션이 트리거됩니다.\n\n- **관련 문서** [가이드 - 리스트 렌더링 - `key`로 상태 유지하기](https://ko.vuejs.org/guide/essentials/list.html#maintaining-state-with-key)"
|
|
108672
109173
|
},
|
|
108673
109174
|
"references": "api/built-in-special-attributes.html#key"
|
|
108674
109175
|
},
|
|
@@ -108676,7 +109177,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108676
109177
|
"name": "ref",
|
|
108677
109178
|
"description": {
|
|
108678
109179
|
"kind": "markdown",
|
|
108679
|
-
"value": "[템플릿 ref](https://ko.vuejs.org/guide/essentials/template-refs.html)를 나타냅니다.\n\n- **기대값:** `string | Function`\n\n- **세부사항**\n\n `ref`는 요소나 자식 컴포넌트에 대한 참조를 등록하는 데 사용됩니다.\n\n 옵션 API에서는 참조가 컴포넌트의 `this.$refs` 객체에 등록됩니다:\n\n ```html\n <!-- this.$refs.p로 저장됨 -->\n <p ref=\"p\">hello</p>\n ```\n\n 컴포지션 API에서는 참조가 동일한 이름의 ref에 저장됩니다:\n\n ```vue\n <script setup>\n import { useTemplateRef } from 'vue'\n\n const pRef = useTemplateRef('p')\n <\/script>\n\n <template>\n <p ref=\"p\">hello</p>\n </template>\n ```\n\n 일반 DOM 요소에 사용하면 참조는 해당 요소가 되고, 자식 컴포넌트에 사용하면 참조는 자식 컴포넌트
|
|
109180
|
+
"value": "[템플릿(template) ref](https://ko.vuejs.org/guide/essentials/template-refs.html)를 나타냅니다.\n\n- **기대값:** `string | Function`\n\n- **세부사항**\n\n `ref`는 요소나 자식 컴포넌트에 대한 참조를 등록하는 데 사용됩니다.\n\n 옵션 API에서는 참조가 컴포넌트의 `this.$refs` 객체에 등록됩니다:\n\n ```html\n <!-- this.$refs.p로 저장됨 -->\n <p ref=\"p\">hello</p>\n ```\n\n 컴포지션 API에서는 참조가 동일한 이름의 ref에 저장됩니다:\n\n ```vue\n <script setup>\n import { useTemplateRef } from 'vue'\n\n const pRef = useTemplateRef('p')\n <\/script>\n\n <template>\n <p ref=\"p\">hello</p>\n </template>\n ```\n\n 일반 DOM 요소에 사용하면 참조는 해당 요소가 되고, 자식 컴포넌트에 사용하면 참조는 자식 컴포넌트 인스턴스(instance)가 됩니다.\n\n 또는 `ref`에 함수 값을 전달하여, 참조를 어디에 저장할지 완전히 제어할 수도 있습니다:\n\n ```html\n <ChildComponent :ref=\"(el) => child = el\" />\n ```\n\n ref 등록 타이밍에 대한 중요한 참고 사항: ref 자체는 렌더 함수의 결과로 생성되기 때문에, 컴포넌트가 마운트(mount)될 때까지 참조에 접근해서는 안 됩니다.\n\n `this.$refs`는 반응형이 아니므로, 데이터 바인딩(binding)을 위해 템플릿에서 사용하려고 해서는 안 됩니다.\n\n- **관련 문서**\n - [가이드 - 템플릿 ref](https://ko.vuejs.org/guide/essentials/template-refs.html)\n - [가이드 - 템플릿 ref 타입 지정](https://ko.vuejs.org/guide/typescript/composition-api.html#typing-template-refs) <sup class=\"vt-badge ts\" />\n - [가이드 - 컴포넌트 템플릿 ref 타입 지정](https://ko.vuejs.org/guide/typescript/composition-api.html#typing-component-template-refs) <sup class=\"vt-badge ts\" />"
|
|
108680
109181
|
},
|
|
108681
109182
|
"references": "api/built-in-special-attributes.html#ref"
|
|
108682
109183
|
},
|
|
@@ -108684,7 +109185,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108684
109185
|
"name": "is",
|
|
108685
109186
|
"description": {
|
|
108686
109187
|
"kind": "markdown",
|
|
108687
|
-
"value": "[동적 컴포넌트](https://ko.vuejs.org/guide/essentials/component-basics.html#dynamic-components) 바인딩에 사용됩니다.\n\n- **기대값:** `string | Component`\n\n- **네이티브 요소에서의 사용**\n \n - 3.1+에서만 지원됩니다\n\n `is` 속성이 네이티브 HTML 요소에 사용되면, [커스터마이즈드 내장 요소](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-customized-builtin-example)로 해석되며, 이는 웹 플랫폼의 네이티브 기능입니다.\n\n 하지만 [in-DOM 템플릿 파싱 주의사항](https://ko.vuejs.org/guide/essentials/component-basics.html#in-dom-template-parsing-caveats)에서 설명한 것처럼, 네이티브 요소를 Vue 컴포넌트로
|
|
109188
|
+
"value": "[동적 컴포넌트](https://ko.vuejs.org/guide/essentials/component-basics.html#dynamic-components) 바인딩에 사용됩니다.\n\n- **기대값:** `string | Component`\n\n- **네이티브 요소에서의 사용**\n \n - 3.1+에서만 지원됩니다\n\n `is` 속성이 네이티브 HTML 요소에 사용되면, [커스터마이즈드 내장 요소](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-customized-builtin-example)로 해석되며, 이는 웹 플랫폼의 네이티브 기능입니다.\n\n 하지만 [in-DOM 템플릿 파싱 주의사항](https://ko.vuejs.org/guide/essentials/component-basics.html#in-dom-template-parsing-caveats)에서 설명한 것처럼, 네이티브 요소를 Vue 컴포넌트로 대체할 필요가 있을 수 있습니다. 이 경우 `is` 속성 값 앞에 `vue:`를 붙이면 Vue가 해당 요소를 Vue 컴포넌트로 렌더링합니다:\n\n ```html\n <table>\n <tr is=\"vue:my-row-component\"></tr>\n </table>\n ```\n\n- **관련 문서**\n\n - [내장 특수 요소 - `<component>`](https://ko.vuejs.org/api/built-in-special-elements.html#component)\n - [동적 컴포넌트](https://ko.vuejs.org/guide/essentials/component-basics.html#dynamic-components)"
|
|
108688
109189
|
},
|
|
108689
109190
|
"references": "api/built-in-special-attributes.html#is"
|
|
108690
109191
|
},
|
|
@@ -108692,7 +109193,7 @@ var init_ko$2 = __esmMin((() => {
|
|
|
108692
109193
|
"name": "data-allow-mismatch",
|
|
108693
109194
|
"description": {
|
|
108694
109195
|
"kind": "markdown",
|
|
108695
|
-
"value": "[하이드레이션 불일치](https://ko.vuejs.org/guide/scaling-up/ssr.html#hydration-mismatch) 경고를 억제하는 데 사용할 수 있는 특수 속성입니다.\n\n- **예시**\n\n ```html\n <div data-allow-mismatch=\"text\">{{ data.toLocaleString() }}</div>\n ```\n\n
|
|
109196
|
+
"value": "[하이드레이션(hydration) 불일치](https://ko.vuejs.org/guide/scaling-up/ssr.html#hydration-mismatch) 경고를 억제하는 데 사용할 수 있는 특수 속성입니다.\n\n- **예시**\n\n ```html\n <div data-allow-mismatch=\"text\">{{ data.toLocaleString() }}</div>\n ```\n\n 값을 지정하면 허용할 불일치를 특정 유형으로 제한할 수 있습니다. 사용 가능한 값은 다음과 같습니다:\n\n - `text`\n - `children` (직접 자식에 대한 불일치만 허용)\n - `class`\n - `style`\n - `attribute`\n\n 값을 제공하지 않으면 모든 유형의 불일치가 허용됩니다.\n"
|
|
108696
109197
|
},
|
|
108697
109198
|
"references": "api/ssr.html#data-allow-mismatch"
|
|
108698
109199
|
}
|
|
@@ -108958,7 +109459,7 @@ var init_zh_cn$2 = __esmMin((() => {
|
|
|
108958
109459
|
"name": "Transition",
|
|
108959
109460
|
"description": {
|
|
108960
109461
|
"kind": "markdown",
|
|
108961
|
-
"value": "\n为**单个**元素或组件提供动画过渡效果。\n\n- **Props**\n\n ```ts\n interface TransitionProps {\n /**\n * 用于自动生成过渡 CSS class 名。\n * 例如 `name: 'fade'` 将自动扩展为 `.fade-enter`、\n * `.fade-enter-active` 等。\n */\n name?: string\n /**\n * 是否应用 CSS 过渡 class。\n * 默认:true\n */\n css?: boolean\n /**\n * 指定要等待的过渡事件类型\n * 来确定过渡结束的时间。\n * 默认情况下会自动检测\n * 持续时间较长的类型。\n */\n type?: 'transition' | 'animation'\n /**\n * 显式指定过渡的持续时间。\n * 默认情况下是等待过渡效果的根元素的第一个 `transitionend`\n * 或`animationend`事件。\n */\n duration?: number | { enter: number; leave: number }\n /**\n * 控制离开/进入过渡的时序。\n * 默认情况下是同时的。\n */\n mode?: 'in-out' | 'out-in' | 'default'\n /**\n * 是否对初始渲染使用过渡。\n * 默认:false\n */\n appear?: boolean\n\n /**\n * 用于自定义过渡 class 的 prop。\n * 在模板中使用短横线命名,例如:enter-from-class=\"xxx\"\n */\n enterFromClass?: string\n enterActiveClass?: string\n enterToClass?: string\n appearFromClass?: string\n appearActiveClass?: string\n appearToClass?: string\n leaveFromClass?: string\n leaveActiveClass?: string\n leaveToClass?: string\n }\n ```\n\n- **事件**\n\n - `@before-enter`\n - `@before-leave`\n - `@enter`\n - `@leave`\n - `@appear`\n - `@after-enter`\n - `@after-leave`\n - `@after-appear`\n - `@enter-cancelled`\n - `@leave-cancelled` (`v-show` only)\n - `@appear-cancelled`\n\n- **示例**\n\n 简单元素:\n\n ```html\n <Transition>\n <div v-if=\"ok\">toggled content</div>\n </Transition>\n ```\n\n 通过改变 `key`
|
|
109462
|
+
"value": "\n为**单个**元素或组件提供动画过渡效果。\n\n- **Props**\n\n ```ts\n interface TransitionProps {\n /**\n * 用于自动生成过渡 CSS class 名。\n * 例如 `name: 'fade'` 将自动扩展为 `.fade-enter`、\n * `.fade-enter-active` 等。\n */\n name?: string\n /**\n * 是否应用 CSS 过渡 class。\n * 默认:true\n */\n css?: boolean\n /**\n * 指定要等待的过渡事件类型\n * 来确定过渡结束的时间。\n * 默认情况下会自动检测\n * 持续时间较长的类型。\n */\n type?: 'transition' | 'animation'\n /**\n * 显式指定过渡的持续时间。\n * 默认情况下是等待过渡效果的根元素的第一个 `transitionend`\n * 或`animationend`事件。\n */\n duration?: number | { enter: number; leave: number }\n /**\n * 控制离开/进入过渡的时序。\n * 默认情况下是同时的。\n */\n mode?: 'in-out' | 'out-in' | 'default'\n /**\n * 是否对初始渲染使用过渡。\n * 默认:false\n */\n appear?: boolean\n\n /**\n * 用于自定义过渡 class 的 prop。\n * 在模板中使用短横线命名,例如:enter-from-class=\"xxx\"\n */\n enterFromClass?: string\n enterActiveClass?: string\n enterToClass?: string\n appearFromClass?: string\n appearActiveClass?: string\n appearToClass?: string\n leaveFromClass?: string\n leaveActiveClass?: string\n leaveToClass?: string\n }\n ```\n\n- **事件**\n\n - `@before-enter`\n - `@before-leave`\n - `@enter`\n - `@leave`\n - `@appear`\n - `@after-enter`\n - `@after-leave`\n - `@after-appear`\n - `@enter-cancelled`\n - `@leave-cancelled` (`v-show` only)\n - `@appear-cancelled`\n\n- **示例**\n\n 简单元素:\n\n ```html\n <Transition>\n <div v-if=\"ok\">toggled content</div>\n </Transition>\n ```\n\n 通过改变 `key` 属性来强制过渡执行:\n\n ```html\n <Transition>\n <div :key=\"text\">{{ text }}</div>\n </Transition>\n ```\n\n 动态组件,初始渲染时带有过渡模式 + 动画出现:\n\n ```html\n <Transition name=\"fade\" mode=\"out-in\" appear>\n <component :is=\"view\"></component>\n </Transition>\n ```\n\n 监听过渡事件:\n\n ```html\n <Transition @after-enter=\"onTransitionComplete\">\n <div v-show=\"ok\">toggled content</div>\n </Transition>\n ```\n\n- **参考**[指南 - `<Transition>`](https://cn.vuejs.org/guide/built-ins/transition.html)\n"
|
|
108962
109463
|
},
|
|
108963
109464
|
"attributes": [],
|
|
108964
109465
|
"references": "api/built-in-components.html#transition"
|
|
@@ -109032,7 +109533,7 @@ var init_zh_cn$2 = __esmMin((() => {
|
|
|
109032
109533
|
"name": "v-text",
|
|
109033
109534
|
"description": {
|
|
109034
109535
|
"kind": "markdown",
|
|
109035
|
-
"value": "更新元素的文本内容。\n\n- **期望的绑定值类型:**`string`\n\n- **详细信息**\n\n `v-text` 通过设置元素的 [textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent)
|
|
109536
|
+
"value": "更新元素的文本内容。\n\n- **期望的绑定值类型:**`string`\n\n- **详细信息**\n\n `v-text` 通过设置元素的 [textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) 属性来工作,因此它将覆盖元素中所有现有的内容。如果你只需要更新 `textContent` 的一部分,应该使用 [mustache interpolations](https://cn.vuejs.org/guide/essentials/template-syntax.html#text-interpolation) 代替 (即 <span v-pre>`<span>保留此部分,但更新 {{dynamicPortion}}</span>`</span>)。\n\n- **示例**\n\n ```html\n <span v-text=\"msg\"></span>\n <!-- 等同于 -->\n <span>{{msg}}</span>\n ```\n\n- **参考**[模板语法 - 文本插值](https://cn.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)"
|
|
109036
109537
|
},
|
|
109037
109538
|
"references": "api/built-in-directives.html#v-text"
|
|
109038
109539
|
},
|
|
@@ -109040,7 +109541,7 @@ var init_zh_cn$2 = __esmMin((() => {
|
|
|
109040
109541
|
"name": "v-html",
|
|
109041
109542
|
"description": {
|
|
109042
109543
|
"kind": "markdown",
|
|
109043
|
-
"value": "更新元素的 [innerHTML](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML)。\n\n- **期望的绑定值类型:**`string`\n\n- **详细信息**\n\n `v-html` 的内容直接作为普通 HTML 插入—— Vue 模板语法是不会被解析的。如果你发现自己正打算用 `v-html` 来编写模板,不如重新想想怎么使用组件来代替。\n\n ::: warning 安全说明\n 在你的站点上动态渲染任意的 HTML 是非常危险的,因为它很容易导致 [XSS 攻击](https://en.wikipedia.org/wiki/Cross-site_scripting)。请只对可信内容使用 HTML
|
|
109544
|
+
"value": "更新元素的 [innerHTML](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML)。\n\n- **期望的绑定值类型:**`string`\n\n- **详细信息**\n\n `v-html` 的内容直接作为普通 HTML 插入—— Vue 模板语法是不会被解析的。如果你发现自己正打算用 `v-html` 来编写模板,不如重新想想怎么使用组件来代替。\n\n ::: warning 安全说明\n 在你的站点上动态渲染任意的 HTML 是非常危险的,因为它很容易导致 [XSS 攻击](https://en.wikipedia.org/wiki/Cross-site_scripting)。请只对可信内容使用 HTML 插值,**绝不要**将用户提供的内容作为插值。\n :::\n\n 在[单文件组件](https://cn.vuejs.org/guide/scaling-up/sfc.html),`scoped` 样式将不会作用于 `v-html` 里的内容,因为 HTML 内容不会被 Vue 的模板编译器解析。如果你想让 `v-html` 的内容也支持 scoped CSS,你可以使用 [CSS modules](./sfc-css-features#css-modules) 或使用一个额外的全局 `<style>` 元素,手动设置类似 BEM 的作用域策略。\n\n- **示例**\n\n ```html\n <div v-html=\"html\"></div>\n ```\n\n- **参考**[模板语法 - 原始 HTML](https://cn.vuejs.org/guide/essentials/template-syntax.html#raw-html)"
|
|
109044
109545
|
},
|
|
109045
109546
|
"references": "api/built-in-directives.html#v-html"
|
|
109046
109547
|
},
|
|
@@ -109233,7 +109734,7 @@ var init_zh_hk$2 = __esmMin((() => {
|
|
|
109233
109734
|
"name": "Teleport",
|
|
109234
109735
|
"description": {
|
|
109235
109736
|
"kind": "markdown",
|
|
109236
|
-
"value": "\n将其插槽内容渲染到 DOM 中的另一个位置。\n\n- **Props**\n\n ```ts\n interface TeleportProps {\n /**\n * 必填项。指定目标容器。\n * 可以是选择器或实际元素。\n */\n to: string | HTMLElement\n /**\n * 当值为 `true` 时,内容将保留在其原始位置\n * 而不是移动到目标容器中。\n * 可以动态更改。\n */\n disabled?: boolean\n }\n ```\n\n- **示例**\n\n 指定目标容器:\n\n ```html\n <Teleport to=\"#some-id\" />\n <Teleport to=\".some-class\" />\n <Teleport to=\"[data-teleport]\" />\n ```\n\n 有条件地禁用:\n\n ```html\n <Teleport to=\"#popup\" :disabled=\"displayVideoInline\">\n <video src=\"./my-movie.mp4\">\n </Teleport>\n ```\n\n- **参考**[指南 - Teleport](https://zh-hk.vuejs.org/guide/built-ins/teleport.html)\n"
|
|
109737
|
+
"value": "\n将其插槽内容渲染到 DOM 中的另一个位置。\n\n- **Props**\n\n ```ts\n interface TeleportProps {\n /**\n * 必填项。指定目标容器。\n * 可以是选择器或实际元素。\n */\n to: string | HTMLElement\n /**\n * 当值为 `true` 时,内容将保留在其原始位置\n * 而不是移动到目标容器中。\n * 可以动态更改。\n */\n disabled?: boolean\n /**\n * When `true`, the Teleport will defer until other\n * parts of the application have been mounted before\n * resolving its target. (3.5+)\n */\n defer?: boolean\n }\n ```\n\n- **示例**\n\n 指定目标容器:\n\n ```html\n <Teleport to=\"#some-id\" />\n <Teleport to=\".some-class\" />\n <Teleport to=\"[data-teleport]\" />\n ```\n\n 有条件地禁用:\n\n ```html\n <Teleport to=\"#popup\" :disabled=\"displayVideoInline\">\n <video src=\"./my-movie.mp4\">\n </Teleport>\n ```\n\n Defer target resolution <sup class=\"vt-badge\" data-text=\"3.5+\" />:\n\n ```html\n <Teleport defer to=\"#late-div\">...</Teleport>\n\n <!-- somewhere later in the template -->\n <div id=\"late-div\"></div>\n ```\n\n- **参考**[指南 - Teleport](https://zh-hk.vuejs.org/guide/built-ins/teleport.html)\n"
|
|
109237
109738
|
},
|
|
109238
109739
|
"attributes": [],
|
|
109239
109740
|
"references": "api/built-in-components.html#teleport"
|
|
@@ -109280,7 +109781,7 @@ var init_zh_hk$2 = __esmMin((() => {
|
|
|
109280
109781
|
"name": "v-text",
|
|
109281
109782
|
"description": {
|
|
109282
109783
|
"kind": "markdown",
|
|
109283
|
-
"value": "更新元素的文本内容。\n\n- **期望的绑定值类型:**`string`\n\n- **详细信息**\n\n `v-text` 通过设置元素的 [textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent)
|
|
109784
|
+
"value": "更新元素的文本内容。\n\n- **期望的绑定值类型:**`string`\n\n- **详细信息**\n\n `v-text` 通过设置元素的 [textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) 属性来工作,因此它将覆盖元素中所有现有的内容。如果你只需要更新 `textContent` 的一部分,应该使用 [mustache 插值](https://zh-hk.vuejs.org/guide/essentials/template-syntax.html#text-interpolation) 代替 (例如 <span v-pre>`<span>Keep this but update a {{dynamicPortion}}</span>`</span>)。\n\n- **示例**\n\n ```html\n <span v-text=\"msg\"></span>\n <!-- 等同于 -->\n <span>{{msg}}</span>\n ```\n\n- **参考**[模板语法 - 文本插值](https://zh-hk.vuejs.org/guide/essentials/template-syntax.html#text-interpolation)"
|
|
109284
109785
|
},
|
|
109285
109786
|
"references": "api/built-in-directives.html#v-text"
|
|
109286
109787
|
},
|
|
@@ -109345,7 +109846,7 @@ var init_zh_hk$2 = __esmMin((() => {
|
|
|
109345
109846
|
"name": "v-bind",
|
|
109346
109847
|
"description": {
|
|
109347
109848
|
"kind": "markdown",
|
|
109348
|
-
"value": "动态的绑定一个或多个 attribute,也可以是组件的 prop。\n\n- **缩写:**\n - `:` 或者 `.` (当使用 `.prop` 修饰符)\n - 值可以省略 (当 attribute
|
|
109849
|
+
"value": "动态的绑定一个或多个 attribute,也可以是组件的 prop。\n\n- **缩写:**\n - `:` 或者 `.` (当使用 `.prop` 修饰符)\n - 值可以省略 (当 attribute 和绑定的值同名时, requires 3.4+)\n\n- **期望:**`any (带参数) | Object (不带参数)`\n\n- **参数:**`attrOrProp (可选的)`\n\n- **修饰符**\n\n - `.camel` - 將 kebab-case attribute 名稱轉換為 camelCase。\n - `.prop` - 強制將綁定設置為 DOM property (3.2+)。\n - `.attr` - 強制將綁定設置為 DOM attribute (3.2+)。\n\n- **用途**\n\n 当用于绑定 `class` 或 `style` attribute,`v-bind` 支持额外的值类型如数组或对象。详见下方的指南链接。\n\n 在处理绑定时,Vue 默认会利用 `in` 操作符来检查该元素上是否定义了和绑定的 key 同名的 DOM property。如果存在同名的 property,则 Vue 会将它作为 DOM property 赋值,而不是作为 attribute 设置。这个行为在大多数情况都符合期望的绑定值类型,但是你也可以显式用 `.prop` 和 `.attr` 修饰符来强制绑定方式。有时这是必要的,特别是在和[自定义元素](https://zh-hk.vuejs.org/guide/extras/web-components.html#passing-dom-properties)打交道时。\n\n 当用于组件 props 绑定时,所绑定的 props 必须在子组件中已被正确声明。\n\n 当不带参数使用时,可以用于绑定一个包含了多个 attribute 名称-绑定值对的对象。\n\n- **示例**\n\n ```html\n <!-- 绑定 attribute -->\n <img v-bind:src=\"imageSrc\" />\n\n <!-- 动态 attribute 名 -->\n <button v-bind:[key]=\"value\"></button>\n\n <!-- 缩写 -->\n <img :src=\"imageSrc\" />\n\n <!-- 缩写形式的动态 attribute 名 (3.4+),扩展为 :src=\"src\" -->\n <img :src />\n\n <!-- 动态 attribute 名的缩写 -->\n <button :[key]=\"value\"></button>\n\n <!-- 内联字符串拼接 -->\n <img :src=\"'/path/to/images/' + fileName\" />\n\n <!-- class 绑定 -->\n <div :class=\"{ red: isRed }\"></div>\n <div :class=\"[classA, classB]\"></div>\n <div :class=\"[classA, { classB: isB, classC: isC }]\"></div>\n\n <!-- style 绑定 -->\n <div :style=\"{ fontSize: size + 'px' }\"></div>\n <div :style=\"[styleObjectA, styleObjectB]\"></div>\n\n <!-- 绑定对象形式的 attribute -->\n <div v-bind=\"{ id: someProp, 'other-attr': otherProp }\"></div>\n\n <!-- prop 绑定。“prop” 必须在子组件中已声明。 -->\n <MyComponent :prop=\"someThing\" />\n\n <!-- 传递子父组件共有的 prop -->\n <MyComponent v-bind=\"$props\" />\n\n <!-- XLink -->\n <svg><a :xlink:special=\"foo\"></a></svg>\n ```\n\n `.prop` 修饰符也有专门的缩写,`.`:\n\n ```html\n <div :someProperty.prop=\"someObject\"></div>\n\n <!-- 等同于 -->\n <div .someProperty=\"someObject\"></div>\n ```\n\n 当在 DOM 内模板使用 `.camel` 修饰符,可以驼峰化 `v-bind` attribute 的名称,例如 SVG `viewBox` attribute:\n\n ```html\n <svg :view-box.camel=\"viewBox\"></svg>\n ```\n\n 如果使用字符串模板或使用构建步骤预编译模板,则不需要 `.camel`。\n\n- **参考**\n - [Class 与 Style 绑定](https://zh-hk.vuejs.org/guide/essentials/class-and-style.html)\n - [组件 - Prop 传递细节](https://zh-hk.vuejs.org/guide/components/props.html#prop-passing-details)"
|
|
109349
109850
|
},
|
|
109350
109851
|
"references": "api/built-in-directives.html#v-bind"
|
|
109351
109852
|
},
|
|
@@ -109387,7 +109888,7 @@ var init_zh_hk$2 = __esmMin((() => {
|
|
|
109387
109888
|
"name": "v-memo",
|
|
109388
109889
|
"description": {
|
|
109389
109890
|
"kind": "markdown",
|
|
109390
|
-
"value": "- **期望的绑定值类型:**`any[]`\n\n- **详细信息**\n\n 缓存一个模板的子树。在元素和组件上都可以使用。为了实现缓存,该指令需要传入一个固定长度的依赖值数组进行比较。如果数组里的每个值都与最后一次的渲染相同,那么整个子树的更新将被跳过。举例来说:\n\n ```html\n <div v-memo=\"[valueA, valueB]\">\n ...\n </div>\n ```\n\n 当组件重新渲染,如果 `valueA` 和 `valueB` 都保持不变,这个 `<div>` 及其子项的所有更新都将被跳过。实际上,甚至虚拟 DOM 的 vnode 创建也将被跳过,因为缓存的子树副本可以被重新使用。\n\n 正确指定缓存数组很重要,否则应该生效的更新可能被跳过。`v-memo` 传入空依赖数组 (`v-memo=\"[]\"`) 将与 `v-once` 效果相同。\n\n **与 `v-for` 一起使用**\n\n `v-memo` 仅用于性能至上场景中的微小优化,应该很少需要。最常见的情况可能是有助于渲染海量 `v-for` 列表 (长度超过 1000 的情况):\n\n ```html\n <div v-for=\"item in list\" :key=\"item.id\" v-memo=\"[item.id === selected]\">\n <p>ID: {{ item.id }} - selected: {{ item.id === selected }}</p>\n <p>...more child nodes</p>\n </div>\n ```\n\n 当组件的 `selected` 状态改变,默认会重新创建大量的 vnode,尽管绝大部分都跟之前是一模一样的。`v-memo` 用在这里本质上是在说“只有当该项的被选中状态改变时才需要更新”。这使得每个选中状态没有变的项能完全重用之前的 vnode 并跳过差异比较。注意这里 memo 依赖数组中并不需要包含 `item.id`,因为 Vue 也会根据 item 的 `:key` 进行判断。\n\n :::warning 警告\n 当搭配 `v-for` 使用 `v-memo`,确保两者都绑定在同一个元素上。**`v-memo` 不能用在 `v-for` 内部。**\n :::\n\n `v-memo` 也能被用于在一些默认优化失败的边际情况下,手动避免子组件出现不需要的更新。但是一样的,开发者需要负责指定正确的依赖数组以免跳过必要的更新。\n\n- **参考**\n - [v-once](#v-once)"
|
|
109891
|
+
"value": "- Only supported in 3.2+\n\n- **期望的绑定值类型:**`any[]`\n\n- **详细信息**\n\n 缓存一个模板的子树。在元素和组件上都可以使用。为了实现缓存,该指令需要传入一个固定长度的依赖值数组进行比较。如果数组里的每个值都与最后一次的渲染相同,那么整个子树的更新将被跳过。举例来说:\n\n ```html\n <div v-memo=\"[valueA, valueB]\">\n ...\n </div>\n ```\n\n 当组件重新渲染,如果 `valueA` 和 `valueB` 都保持不变,这个 `<div>` 及其子项的所有更新都将被跳过。实际上,甚至虚拟 DOM 的 vnode 创建也将被跳过,因为缓存的子树副本可以被重新使用。\n\n 正确指定缓存数组很重要,否则应该生效的更新可能被跳过。`v-memo` 传入空依赖数组 (`v-memo=\"[]\"`) 将与 `v-once` 效果相同。\n\n **与 `v-for` 一起使用**\n\n `v-memo` 仅用于性能至上场景中的微小优化,应该很少需要。最常见的情况可能是有助于渲染海量 `v-for` 列表 (长度超过 1000 的情况):\n\n ```html\n <div v-for=\"item in list\" :key=\"item.id\" v-memo=\"[item.id === selected]\">\n <p>ID: {{ item.id }} - selected: {{ item.id === selected }}</p>\n <p>...more child nodes</p>\n </div>\n ```\n\n 当组件的 `selected` 状态改变,默认会重新创建大量的 vnode,尽管绝大部分都跟之前是一模一样的。`v-memo` 用在这里本质上是在说“只有当该项的被选中状态改变时才需要更新”。这使得每个选中状态没有变的项能完全重用之前的 vnode 并跳过差异比较。注意这里 memo 依赖数组中并不需要包含 `item.id`,因为 Vue 也会根据 item 的 `:key` 进行判断。\n\n :::warning 警告\n 当搭配 `v-for` 使用 `v-memo`,确保两者都绑定在同一个元素上。**`v-memo` 不能用在 `v-for` 内部。**\n :::\n\n `v-memo` 也能被用于在一些默认优化失败的边际情况下,手动避免子组件出现不需要的更新。但是一样的,开发者需要负责指定正确的依赖数组以免跳过必要的更新。\n\n- **参考**\n - [v-once](#v-once)"
|
|
109391
109892
|
},
|
|
109392
109893
|
"references": "api/built-in-directives.html#v-memo"
|
|
109393
109894
|
},
|
|
@@ -109404,7 +109905,7 @@ var init_zh_hk$2 = __esmMin((() => {
|
|
|
109404
109905
|
"name": "key",
|
|
109405
109906
|
"description": {
|
|
109406
109907
|
"kind": "markdown",
|
|
109407
|
-
"value": "`key`
|
|
109908
|
+
"value": "The `key` special attribute is primarily used as a hint for Vue's virtual DOM algorithm to identify vnodes when diffing the new list of nodes against the old list.\n\n- **Expects:** `number | string | symbol`\n\n- **Details**\n\n Without keys, Vue uses an algorithm that minimizes element movement and tries to patch/reuse elements of the same type in-place as much as possible. With keys, it will reorder elements based on the order change of keys, and elements with keys that are no longer present will always be removed / destroyed.\n\n Children of the same common parent must have **unique keys**. Duplicate keys will cause render errors.\n\n The most common use case is combined with `v-for`:\n\n ```html\n <ul>\n <li v-for=\"item in items\" :key=\"item.id\">...</li>\n </ul>\n ```\n\n It can also be used to force replacement of an element/component instead of reusing it. This can be useful when you want to:\n\n - Properly trigger lifecycle hooks of a component\n - Trigger transitions\n\n For example:\n\n ```html\n <transition>\n <span :key=\"text\">{{ text }}</span>\n </transition>\n ```\n\n When `text` changes, the `<span>` will always be replaced instead of patched, so a transition will be triggered.\n\n- **See also** [Guide - List Rendering - Maintaining State with `key`](https://zh-hk.vuejs.org/guide/essentials/list.html#maintaining-state-with-key)"
|
|
109408
109909
|
},
|
|
109409
109910
|
"references": "api/built-in-special-attributes.html#key"
|
|
109410
109911
|
},
|
|
@@ -109412,7 +109913,7 @@ var init_zh_hk$2 = __esmMin((() => {
|
|
|
109412
109913
|
"name": "ref",
|
|
109413
109914
|
"description": {
|
|
109414
109915
|
"kind": "markdown",
|
|
109415
|
-
"value": "
|
|
109916
|
+
"value": "Denotes a [template ref](https://zh-hk.vuejs.org/guide/essentials/template-refs.html).\n\n- **Expects:** `string | Function`\n\n- **Details**\n\n `ref` is used to register a reference to an element or a child component.\n\n In Options API, the reference will be registered under the component's `this.$refs` object:\n\n ```html\n <!-- stored as this.$refs.p -->\n <p ref=\"p\">hello</p>\n ```\n\n In Composition API, the reference will be stored in a ref with matching name:\n\n ```vue\n <script setup>\n import { useTemplateRef } from 'vue'\n\n const pRef = useTemplateRef('p')\n <\/script>\n\n <template>\n <p ref=\"p\">hello</p>\n </template>\n ```\n\n If used on a plain DOM element, the reference will be that element; if used on a child component, the reference will be the child component instance.\n\n Alternatively `ref` can accept a function value which provides full control over where to store the reference:\n\n ```html\n <ChildComponent :ref=\"(el) => child = el\" />\n ```\n\n An important note about the ref registration timing: because the refs themselves are created as a result of the render function, you must wait until the component is mounted before accessing them.\n\n `this.$refs` is also non-reactive, therefore you should not attempt to use it in templates for data-binding.\n\n- **See also**\n - [Guide - Template Refs](https://zh-hk.vuejs.org/guide/essentials/template-refs.html)\n - [Guide - Typing Template Refs](https://zh-hk.vuejs.org/guide/typescript/composition-api.html#typing-template-refs) <sup class=\"vt-badge ts\" />\n - [Guide - Typing Component Template Refs](https://zh-hk.vuejs.org/guide/typescript/composition-api.html#typing-component-template-refs) <sup class=\"vt-badge ts\" />"
|
|
109416
109917
|
},
|
|
109417
109918
|
"references": "api/built-in-special-attributes.html#ref"
|
|
109418
109919
|
},
|
|
@@ -109420,9 +109921,17 @@ var init_zh_hk$2 = __esmMin((() => {
|
|
|
109420
109921
|
"name": "is",
|
|
109421
109922
|
"description": {
|
|
109422
109923
|
"kind": "markdown",
|
|
109423
|
-
"value": "
|
|
109924
|
+
"value": "Used for binding [dynamic components](https://zh-hk.vuejs.org/guide/essentials/component-basics.html#dynamic-components).\n\n- **Expects:** `string | Component`\n\n- **Usage on native elements**\n \n - Only supported in 3.1+\n\n When the `is` attribute is used on a native HTML element, it will be interpreted as a [Customized built-in element](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-customized-builtin-example), which is a native web platform feature.\n\n There is, however, a use case where you may need Vue to replace a native element with a Vue component, as explained in [in-DOM Template Parsing Caveats](https://zh-hk.vuejs.org/guide/essentials/component-basics.html#in-dom-template-parsing-caveats). You can prefix the value of the `is` attribute with `vue:` so that Vue will render the element as a Vue component instead:\n\n ```html\n <table>\n <tr is=\"vue:my-row-component\"></tr>\n </table>\n ```\n\n- **See also**\n\n - [Built-in Special Element - `<component>`](https://zh-hk.vuejs.org/api/built-in-special-elements.html#component)\n - [Dynamic Components](https://zh-hk.vuejs.org/guide/essentials/component-basics.html#dynamic-components)"
|
|
109424
109925
|
},
|
|
109425
109926
|
"references": "api/built-in-special-attributes.html#is"
|
|
109927
|
+
},
|
|
109928
|
+
{
|
|
109929
|
+
"name": "data-allow-mismatch",
|
|
109930
|
+
"description": {
|
|
109931
|
+
"kind": "markdown",
|
|
109932
|
+
"value": "一個特殊的 attribute,可用於抑制 [激活不匹配](https://zh-hk.vuejs.org/guide/scaling-up/ssr.html#hydration-mismatch) 警告。\n\n- **示例**\n\n ```html\n <div data-allow-mismatch=\"text\">{{ data.toLocaleString() }}</div>\n ```\n\n 該值可以將允許的不匹配限制在特定的類型。允許的值有:\n\n - `text`\n - `children`(僅允許直接子節點存在不匹配)\n - `class`\n - `style`\n - `attribute`\n\n 如果沒有提供值,所有類型的不匹配都會被允許。\n"
|
|
109933
|
+
},
|
|
109934
|
+
"references": "api/ssr.html#data-allow-mismatch"
|
|
109426
109935
|
}
|
|
109427
109936
|
];
|
|
109428
109937
|
zh_hk_default$2 = {
|
|
@@ -109961,7 +110470,7 @@ var init_ru$2 = __esmMin((() => {
|
|
|
109961
110470
|
"name": "Teleport",
|
|
109962
110471
|
"description": {
|
|
109963
110472
|
"kind": "markdown",
|
|
109964
|
-
"value": "\nПеремещает содержимое своего слота в другую часть DOM.\n\n- **Входные параметры**\n\n ```ts\n interface TeleportProps {\n /**\n * Обязательный. Задаёт целевой контейнер.\n * Может быть селектором или непосредственно элементом.\n */\n to: string | HTMLElement\n /**\n * Если `true`, содержимое останется на своем первоначальном\n * месте, вместо перемещения в целевой контейнер.\n * Может изменяться динамически.\n */\n disabled?: boolean\n /**\n * Если `true`, Teleport отложит разрешение целевого контейнера\n * до тех пор, пока остальные части приложения не будут смонтированы. (3.5+)\n */\n defer?: boolean\n }\n ```\n\n- **Пример**\n\n Указание целевого контейнера:\n\n ```html\n <Teleport to=\"#some-id\" />\n <Teleport to=\".some-class\" />\n <Teleport to=\"[data-teleport]\" />\n ```\n\n Перемещение по условию:\n\n ```html\n <Teleport to=\"#popup\" :disabled=\"displayVideoInline\">\n <video src=\"./my-movie.mp4\">\n </Teleport>\n ```\n\n
|
|
110473
|
+
"value": "\nПеремещает содержимое своего слота в другую часть DOM.\n\n- **Входные параметры**\n\n ```ts\n interface TeleportProps {\n /**\n * Обязательный. Задаёт целевой контейнер.\n * Может быть селектором или непосредственно элементом.\n */\n to: string | HTMLElement\n /**\n * Если `true`, содержимое останется на своем первоначальном\n * месте, вместо перемещения в целевой контейнер.\n * Может изменяться динамически.\n */\n disabled?: boolean\n /**\n * Если `true`, Teleport отложит разрешение целевого контейнера\n * до тех пор, пока остальные части приложения не будут смонтированы. (3.5+)\n */\n defer?: boolean\n }\n ```\n\n- **Пример**\n\n Указание целевого контейнера:\n\n ```html\n <Teleport to=\"#some-id\" />\n <Teleport to=\".some-class\" />\n <Teleport to=\"[data-teleport]\" />\n ```\n\n Перемещение по условию:\n\n ```html\n <Teleport to=\"#popup\" :disabled=\"displayVideoInline\">\n <video src=\"./my-movie.mp4\">\n </Teleport>\n ```\n\n Использование с `defer` <sup class=\"vt-badge\" data-text=\"3.5+\" />:\n Атрибут `defer` говорит фреймворку не пытаться найти DOM-узел `#late-div` прямо в момент рендера самого `<Teleport>`.\n Поиск откладывается до того момента, пока не отрисуется весь текущий шаблон.\n Без этого атрибута код бы сломался, так как в момент монтирования Телепорта целевого `div`,\n находящегося ниже по коду, еще не существует в DOM-дереве.\n\n ```html\n <Teleport defer to=\"#late-div\">...</Teleport>\n\n <!-- где-то дальше в шаблоне -->\n <div id=\"late-div\"></div>\n ```\n\n- **См. также** [Руководство — Teleport](https://ru.vuejs.org/guide/built-ins/teleport.html)\n"
|
|
109965
110474
|
},
|
|
109966
110475
|
"attributes": [],
|
|
109967
110476
|
"references": "api/built-in-components.html#teleport"
|
|
@@ -110016,7 +110525,7 @@ var init_ru$2 = __esmMin((() => {
|
|
|
110016
110525
|
"name": "v-html",
|
|
110017
110526
|
"description": {
|
|
110018
110527
|
"kind": "markdown",
|
|
110019
|
-
"value": "Обновление свойства [innerHTML](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML) элемента.\n\n- **Ожидает:** `string`\n\n- **Подробности**\n\n Содержимое `v-html` вставляется как обычный HTML
|
|
110528
|
+
"value": "Обновление свойства [innerHTML](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML) элемента.\n\n- **Ожидает:** `string`\n\n- **Подробности**\n\n Содержимое `v-html` вставляется как обычный HTML — синтаксис шаблонов Vue не обрабатывается. Если вы пытаетесь составить шаблоны с помощью `v-html`, попробуйте переосмыслить решение, используя вместо этого компоненты.\n\n :::warning Примечание о безопасности\n Динамический рендеринг произвольного HTML на вашем сайте может быть очень опасен, поскольку легко может привести к [XSS-атакам](https://en.wikipedia.org/wiki/Cross-site_scripting). Используйте `v-html` только для доверенного содержимого и **никогда** для содержимого, предоставляемого пользователем.\n :::\n\n В [однофайловых компонентах](https://ru.vuejs.org/guide/scaling-up/sfc.html) стили `scoped` не будут применяться к содержимому внутри `v-html`, поскольку этот HTML не обрабатывается компилятором шаблонов Vue. Если вы хотите использовать на содержимом `v-html` скопированный CSS, то вместо этого можно использовать [CSS модули](./sfc-css-features.html#css-modules) или дополнительный глобальный элемент `<style>` с ручной стратегией области применения, например BEM.\n\n\n- **Пример**\n\n ```html\n <div v-html=\"html\"></div>\n ```\n\n- **См. также** [Синтаксис шаблонов - Сырой HTML](https://ru.vuejs.org/guide/essentials/template-syntax.html#raw-html)"
|
|
110020
110529
|
},
|
|
110021
110530
|
"references": "api/built-in-directives.html#v-html"
|
|
110022
110531
|
},
|
|
@@ -110065,7 +110574,7 @@ var init_ru$2 = __esmMin((() => {
|
|
|
110065
110574
|
"name": "v-on",
|
|
110066
110575
|
"description": {
|
|
110067
110576
|
"kind": "markdown",
|
|
110068
|
-
"value": "Прикрепление к элементу обработчика событий.\n\n- **Сокращённая запись:** `@`\n\n- **Ожидает:** `Function | Inline Statement | Object (без аргументов)`\n\n- **Аргумент:** `event` (необязательно, если используется синтаксис Object)\n\n- **Модификаторы**\n\n - `.stop`
|
|
110577
|
+
"value": "Прикрепление к элементу обработчика событий.\n\n- **Сокращённая запись:** `@`\n\n- **Ожидает:** `Function | Inline Statement | Object (без аргументов)`\n\n- **Аргумент:** `event` (необязательно, если используется синтаксис Object)\n\n- **Модификаторы**\n\n - `.stop` — вызывает `event.stopPropagation()`.\n - `.prevent` — вызывает `event.preventDefault()`.\n - `.capture` — добавить обработчик событий в capture режиме.\n - `.self` — запускать обработчик только в том случае, если событие было отправлено именно от этого элемента.\n - `.{keyAlias}` — запускать обработчик только по определенным клавишам.\n - `.once` — обработчик сработает только один раз.\n - `.left` — обработчик срабатывания только для событий левой кнопки мыши.\n - `.right` — обработчик срабатывания только для событий правой кнопки мыши.\n - `.middle` — обработчик срабатывания только для событий средней кнопки мыши.\n - `.passive` — добавляет обработчик DOM события с параметром `{ passive: true }`.\n\n- **Подробности**\n\n Тип события обозначается аргументом. Выражение может быть именем метода, строковым оператором или опущено, если присутствуют модификаторы.\n\n При использовании на обычном элементе он прослушивает только [**нативные DOM события**](https://developer.mozilla.org/en-US/docs/Web/Events). При использовании на компоненте он прослушивает **пользовательские события**, генерируемые в дочернем компоненте.\n\n При прослушивании нативных DOM событий метод получает нативное событие в качестве единственного аргумента. При использовании inline-выражения, выражение имеет доступ к специальному свойству `$event`: `v-on:click=\"handle('ok', $event)\"`.\n\n `v-on` также поддерживает привязку к объекту пар событие/слушатель без аргумента. Обратите внимание, что при использовании синтаксиса объекта он не поддерживает никаких модификаторов.\n\n- **Пример**\n\n ```html\n <!-- метод в качестве обработчика -->\n <button v-on:click=\"doThis\"></button>\n\n <!-- динамическое событие -->\n <button v-on:[event]=\"doThis\"></button>\n\n <!-- inline-выражение -->\n <button v-on:click=\"doThat('hello', $event)\"></button>\n\n <!-- сокращённая запись -->\n <button @click=\"doThis\"></button>\n\n <!-- окращённая запись динамического события -->\n <button @[event]=\"doThis\"></button>\n\n <!-- stop propagation -->\n <button @click.stop=\"doThis\"></button>\n\n <!-- prevent default -->\n <button @click.prevent=\"doThis\"></button>\n\n <!-- prevent default без выражения -->\n <form @submit.prevent></form>\n\n <!-- цепочка из модификаторов -->\n <button @click.stop.prevent=\"doThis\"></button>\n\n <!-- модификатор клавиши с использованием keyAlias -->\n <input @keyup.enter=\"onEnter\" />\n\n <!-- обработчик события будет вызван не больше одного раза -->\n <button v-on:click.once=\"doThis\"></button>\n\n <!-- объектный синтаксис -->\n <button v-on=\"{ mousedown: doThis, mouseup: doThat }\"></button>\n ```\n\n Отслеживание пользовательских событий на дочернем компоненте (обработчик вызывается, когда в дочернем компоненте будет сгенерировано событие \"my-event\"):\n\n ```html\n <MyComponent @my-event=\"handleThis\" />\n\n <!-- inline statement -->\n <MyComponent @my-event=\"handleThis(123, $event)\" />\n ```\n\n- **См. также**\n - [Обработка событий](https://ru.vuejs.org/guide/essentials/event-handling.html)\n - [Компоненты - Прослушивание событий](https://ru.vuejs.org/guide/essentials/component-basics.html#listening-to-events)"
|
|
110069
110578
|
},
|
|
110070
110579
|
"references": "api/built-in-directives.html#v-on"
|
|
110071
110580
|
},
|
|
@@ -110073,7 +110582,7 @@ var init_ru$2 = __esmMin((() => {
|
|
|
110073
110582
|
"name": "v-bind",
|
|
110074
110583
|
"description": {
|
|
110075
110584
|
"kind": "markdown",
|
|
110076
|
-
"value": "Динамически привязывает один или несколько атрибутов или входных параметров компонента к выражению.\n\n- **Сокращённая запись**\n - `:` или `.` (при использовании модификатора `.prop`)\n - Пропуск значения (когда атрибут и связанное значение имеют одинаковое имя) requires 3.4+\n\n- **Ожидает:** `any (если указан аргумент) | Object (без аргумента)`\n\n- **Аргумент:** `attrOrProp (опционально)`\n\n- **Модификаторы**\n\n - `.camel`
|
|
110585
|
+
"value": "Динамически привязывает один или несколько атрибутов или входных параметров компонента к выражению.\n\n- **Сокращённая запись**\n - `:` или `.` (при использовании модификатора `.prop`)\n - Пропуск значения (когда атрибут и связанное значение имеют одинаковое имя) requires 3.4+\n\n- **Ожидает:** `any (если указан аргумент) | Object (без аргумента)`\n\n- **Аргумент:** `attrOrProp (опционально)`\n\n- **Модификаторы**\n\n - `.camel` — преобразование имён атрибутов из kebab-case в camelCase.\n - `.prop` — принудительно установить привязку в качестве свойства DOM (3.2+).\n - `.attr` — принудительно установить привязку в качестве атрибута DOM (3.2+).\n\n- **Применение**\n\n При использовании для привязки атрибутов `class` или `style`, `v-bind` поддерживает дополнительные типы значений, такие как Array или Objects. Более подробная информация приведена в разделе руководства по ссылкам ниже.\n\n Устанавливая привязку к элементу, Vue по умолчанию проверяет, имеет ли элемент ключ, определенный как свойство, используя проверку оператора `in`. Если свойство определено, то Vue установит значение как свойство DOM, а не как атрибут. В большинстве случаев это должно работать, но вы можете переопределить это поведение, явно используя модификаторы `.prop` или `.attr`. Иногда это необходимо, особенно при [работе с пользовательскими элементами](https://ru.vuejs.org/guide/extras/web-components.html#passing-dom-properties).\n\n При привязке входных параметров к дочернему компоненту необходимо также объявлять их внутри него.\n\n При использовании без аргумента можно привязать объект из пар имя-значение.\n\n- **Пример**\n\n ```html\n <!-- привязка атрибута -->\n <img v-bind:src=\"imageSrc\" />\n\n <!-- динамическое название атрибута -->\n <button v-bind:[key]=\"value\"></button>\n\n <!-- сокращённая запись -->\n <img :src=\"imageSrc\" />\n\n <!-- сокращение при одинаковом названии (3.4+), расширяется до :src=\"src\" -->\n <img :src />\n\n <!-- сокращённая запись при динамическом названии атрибута -->\n <button :[key]=\"value\"></button>\n\n <!-- инлайн-выражение с конкатенацией строк -->\n <img :src=\"'/path/to/images/' + fileName\" />\n\n <!-- привязка классов -->\n <div :class=\"{ red: isRed }\"></div>\n <div :class=\"[classA, classB]\"></div>\n <div :class=\"[classA, { classB: isB, classC: isC }]\"></div>\n\n <!-- привязка стилей -->\n <div :style=\"{ fontSize: size + 'px' }\"></div>\n <div :style=\"[styleObjectA, styleObjectB]\"></div>\n\n <!-- привязка объекта с атрибутами -->\n <div v-bind=\"{ id: someProp, 'other-attr': otherProp }\"></div>\n\n <!-- привязка входного параметра. \"prop\" должен быть объявлен в my-component. -->\n <MyComponent :prop=\"someThing\" />\n\n <!-- передача всех входных параметров родительского компонента в дочерний -->\n <MyComponent v-bind=\"$props\" />\n\n <!-- XLink -->\n <svg><a :xlink:special=\"foo\"></a></svg>\n ```\n\n Модификатор `.prop` также имеет сокращённую запись `.`:\n\n ```html\n <div :someProperty.prop=\"someObject\"></div>\n\n <!-- эквивалент -->\n <div .someProperty=\"someObject\"></div>\n ```\n\n Модификатор `.camel` позволяет приводить имя атрибута `v-bind` в camelCase при использовании DOM-шаблонов, например для атрибута SVG `viewBox`:\n\n ```html\n <svg :view-box.camel=\"viewBox\"></svg>\n ```\n\n Модификатор `.camel` не нужен, если вы используете строковые шаблоны или предварительно компилируете шаблон на этапе сборки.\n\n- **См. также**\n - [Работа с классами и стилями](https://ru.vuejs.org/guide/essentials/class-and-style.html)\n - [Компоненты - Детали передачи входных параметров](https://ru.vuejs.org/guide/components/props.html#prop-passing-details)"
|
|
110077
110586
|
},
|
|
110078
110587
|
"references": "api/built-in-directives.html#v-bind"
|
|
110079
110588
|
},
|
|
@@ -110081,7 +110590,7 @@ var init_ru$2 = __esmMin((() => {
|
|
|
110081
110590
|
"name": "v-model",
|
|
110082
110591
|
"description": {
|
|
110083
110592
|
"kind": "markdown",
|
|
110084
|
-
"value": "Создает двустороннее связывание с элементом ввода формы или с компонентом.\n\n- **Ожидает:** варьируется в зависимости от элемента формы или работы компонента\n\n- **Использование ограничено**\n\n - `<input>`\n - `<select>`\n - `<textarea>`\n - компоненты\n\n- **Модификаторы**\n\n - [`.lazy`](https://ru.vuejs.org/guide/essentials/forms.html#lazy)
|
|
110593
|
+
"value": "Создает двустороннее связывание с элементом ввода формы или с компонентом.\n\n- **Ожидает:** варьируется в зависимости от элемента формы или работы компонента\n\n- **Использование ограничено**\n\n - `<input>`\n - `<select>`\n - `<textarea>`\n - компоненты\n\n- **Модификаторы**\n\n - [`.lazy`](https://ru.vuejs.org/guide/essentials/forms.html#lazy) — отслеживание события `change` вместо `input`\n - [`.number`](https://ru.vuejs.org/guide/essentials/forms.html#number) — приведение корректной строки со значением к числу\n - [`.trim`](https://ru.vuejs.org/guide/essentials/forms.html#trim) — удаление пробелов в начале и в конце строки\n\n- **См. также**\n\n - [Работа с формами](https://ru.vuejs.org/guide/essentials/forms.html)\n - [События компонентов - Использование вместе с `v-model`](https://ru.vuejs.org/guide/components/events.html#usage-with-v-model)"
|
|
110085
110594
|
},
|
|
110086
110595
|
"references": "api/built-in-directives.html#v-model"
|
|
110087
110596
|
},
|
|
@@ -110089,7 +110598,7 @@ var init_ru$2 = __esmMin((() => {
|
|
|
110089
110598
|
"name": "v-slot",
|
|
110090
110599
|
"description": {
|
|
110091
110600
|
"kind": "markdown",
|
|
110092
|
-
"value": "Обозначение именованного слота или слота, который получает входные параметры.\n\n- **Сокращённая запись:** `#`\n\n- **Ожидает:** JavaScript-выражение, допустимое в позиции аргумента функции, включая поддержку деструктуризации. Необязательный
|
|
110601
|
+
"value": "Обозначение именованного слота или слота, который получает входные параметры.\n\n- **Сокращённая запись:** `#`\n\n- **Ожидает:** JavaScript-выражение, допустимое в позиции аргумента функции, включая поддержку деструктуризации. Необязательный — нужен только в том случае, если ожидается передача входного параметра в слот.\n\n- **Аргумент:** название слота (опционально, по умолчанию `default`)\n\n- **Использование ограничено:**\n\n - `<template>`\n - [компонентами](https://ru.vuejs.org/guide/components/slots.html#scoped-slots) (для единственного слота по умолчанию с входными параметрами)\n\n\n- **Пример**\n\n ```html\n <!-- Именованный слот -->\n <BaseLayout>\n <template v-slot:header>\n Содержимое для заголовка\n </template>\n\n <template v-slot:default>\n Содержимое для слота по умолчанию\n </template>\n\n <template v-slot:footer>\n Содержимое для подвала\n </template>\n </BaseLayout>\n\n <!-- Именованный слот с входными параметрами -->\n <InfiniteScroll>\n <template v-slot:item=\"slotProps\">\n <div class=\"item\">\n {{ slotProps.item.text }}\n </div>\n </template>\n </InfiniteScroll>\n\n <!-- Слот по умолчанию с входными параметрами и деструктуризацией -->\n <Mouse v-slot=\"{ x, y }\">\n Mouse position: {{ x }}, {{ y }}\n </Mouse>\n ```\n\n- **См. также**\n - [Компоненты - Слоты](https://ru.vuejs.org/guide/components/slots.html)"
|
|
110093
110602
|
},
|
|
110094
110603
|
"references": "api/built-in-directives.html#v-slot"
|
|
110095
110604
|
},
|
|
@@ -110098,7 +110607,7 @@ var init_ru$2 = __esmMin((() => {
|
|
|
110098
110607
|
"valueSet": "v",
|
|
110099
110608
|
"description": {
|
|
110100
110609
|
"kind": "markdown",
|
|
110101
|
-
"value": "Пропускает компиляцию для элемента и всех его потомков.\n\n- **Не ожидает выражения**\n\n- **Подробности**\n\n Внутри элемента с `v-pre` весь синтаксис шаблона Vue будет сохранен и отображён как есть. Наиболее распространённый вариант использования этого элемента
|
|
110610
|
+
"value": "Пропускает компиляцию для элемента и всех его потомков.\n\n- **Не ожидает выражения**\n\n- **Подробности**\n\n Внутри элемента с `v-pre` весь синтаксис шаблона Vue будет сохранен и отображён как есть. Наиболее распространённый вариант использования этого элемента — отображение тегов фигурных скобок.\n\n- **Пример**\n\n ```html\n <span v-pre>{{ это не будет скомпилировано }}</span>\n ```"
|
|
110102
110611
|
},
|
|
110103
110612
|
"references": "api/built-in-directives.html#v-pre"
|
|
110104
110613
|
},
|
|
@@ -110786,21 +111295,21 @@ var init_ko$1 = __esmMin((() => {
|
|
|
110786
111295
|
"name": "src",
|
|
110787
111296
|
"description": {
|
|
110788
111297
|
"kind": "markdown",
|
|
110789
|
-
"value": "`*.vue` 컴포넌트를 여러 파일로 분리하고 싶다면, `src` 속성을 사용하여 언어 블록에 외부 파일을 임포트할 수 있습니다:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n`src` 임포트는 webpack 모듈 요청과 동일한 경로
|
|
111298
|
+
"value": "`*.vue` 컴포넌트를 여러 파일로 분리하고 싶다면, `src` 속성을 사용하여 언어 블록에 외부 파일을 임포트할 수 있습니다:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n`src` 임포트는 webpack 모듈 요청과 동일한 경로 해석 규칙을 따르므로 주의하세요:\n\n- 상대 경로는 `./`로 시작해야 합니다.\n- npm 의존성에서 리소스를 임포트할 수 있습니다:\n\n```vue\n<!-- 설치된 \"todomvc-app-css\" npm 패키지에서 파일 임포트 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 임포트는 커스텀 블록에도 사용할 수 있습니다. 예:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 참고\n`src`에서 별칭을 사용할 때는 `~`로 시작하지 마세요. 그 뒤의 모든 것은 모듈 요청으로 해석됩니다. 즉, node 모듈 내부의 에셋을 참조할 수 있습니다:\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n:::"
|
|
110790
111299
|
},
|
|
110791
111300
|
"references": "api/sfc-spec.html#src-imports"
|
|
110792
111301
|
}, {
|
|
110793
111302
|
"name": "lang",
|
|
110794
111303
|
"description": {
|
|
110795
111304
|
"kind": "markdown",
|
|
110796
|
-
"value": "블록은 `lang` 속성을 사용하여 프리프로세서 언어를 선언할 수 있습니다. 가장 일반적인 예는 `<script>` 블록에서 TypeScript를 사용하는 경우입니다:\n\n```html\n<script lang=\"ts\">\n // TypeScript 사용\n<\/script>\n```\n\n`lang
|
|
111305
|
+
"value": "블록은 `lang` 속성을 사용하여 프리프로세서 언어를 선언할 수 있습니다. 가장 일반적인 예는 `<script>` 블록에서 TypeScript를 사용하는 경우입니다:\n\n```html\n<script lang=\"ts\">\n // TypeScript 사용\n<\/script>\n```\n\n`lang`은 모든 블록에 적용할 수 있습니다. 예를 들어, `<style>`에는 [Sass](https://sass-lang.com/)를, `<template>`에는 [Pug](https://pugjs.org/api/getting-started.html)를 사용할 수 있습니다:\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n다양한 프리프로세서와의 통합은 도구 체인에 따라 다를 수 있습니다. 예시는 각 문서를 참고하세요:\n\n- [Vite](https://vite.dev/guide/features.html#css-pre-processors)\n- [Vue CLI](https://cli.vuejs.org/guide/css.html#pre-processors)\n- [webpack + vue-loader](https://vue-loader.vuejs.org/guide/pre-processors.html#using-pre-processors)"
|
|
110797
111306
|
},
|
|
110798
111307
|
"values": [{ "name": "html" }, { "name": "pug" }],
|
|
110799
111308
|
"references": "api/sfc-spec.html#pre-processors"
|
|
110800
111309
|
}],
|
|
110801
111310
|
"description": {
|
|
110802
111311
|
"kind": "markdown",
|
|
110803
|
-
"value": "\n- 각 `*.vue` 파일에는 최상위 `<template>` 블록이 최대 한 개만 포함될 수 있습니다.\n\n- 내용은 추출되어 `@vue/compiler-dom`에 전달되고, JavaScript 렌더 함수로 사전 컴파일되어
|
|
111312
|
+
"value": "\n- 각 `*.vue` 파일에는 최상위 `<template>` 블록이 최대 한 개만 포함될 수 있습니다.\n\n- 내용은 추출되어 `@vue/compiler-dom`에 전달되고, JavaScript 렌더 함수로 사전 컴파일되어 내보내지는 컴포넌트의 `render` 옵션에 연결됩니다.\n"
|
|
110804
111313
|
},
|
|
110805
111314
|
"references": "api/sfc-spec.html#template"
|
|
110806
111315
|
},
|
|
@@ -110811,7 +111320,7 @@ var init_ko$1 = __esmMin((() => {
|
|
|
110811
111320
|
"name": "src",
|
|
110812
111321
|
"description": {
|
|
110813
111322
|
"kind": "markdown",
|
|
110814
|
-
"value": "`*.vue` 컴포넌트를 여러 파일로 분리하고 싶다면, `src` 속성을 사용하여 언어 블록에 외부 파일을 임포트할 수 있습니다:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n`src` 임포트는 webpack 모듈 요청과 동일한 경로
|
|
111323
|
+
"value": "`*.vue` 컴포넌트를 여러 파일로 분리하고 싶다면, `src` 속성을 사용하여 언어 블록에 외부 파일을 임포트할 수 있습니다:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n`src` 임포트는 webpack 모듈 요청과 동일한 경로 해석 규칙을 따르므로 주의하세요:\n\n- 상대 경로는 `./`로 시작해야 합니다.\n- npm 의존성에서 리소스를 임포트할 수 있습니다:\n\n```vue\n<!-- 설치된 \"todomvc-app-css\" npm 패키지에서 파일 임포트 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 임포트는 커스텀 블록에도 사용할 수 있습니다. 예:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 참고\n`src`에서 별칭을 사용할 때는 `~`로 시작하지 마세요. 그 뒤의 모든 것은 모듈 요청으로 해석됩니다. 즉, node 모듈 내부의 에셋을 참조할 수 있습니다:\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n:::"
|
|
110815
111324
|
},
|
|
110816
111325
|
"references": "api/sfc-spec.html#src-imports"
|
|
110817
111326
|
},
|
|
@@ -110819,7 +111328,7 @@ var init_ko$1 = __esmMin((() => {
|
|
|
110819
111328
|
"name": "lang",
|
|
110820
111329
|
"description": {
|
|
110821
111330
|
"kind": "markdown",
|
|
110822
|
-
"value": "블록은 `lang` 속성을 사용하여 프리프로세서 언어를 선언할 수 있습니다. 가장 일반적인 예는 `<script>` 블록에서 TypeScript를 사용하는 경우입니다:\n\n```html\n<script lang=\"ts\">\n // TypeScript 사용\n<\/script>\n```\n\n`lang
|
|
111331
|
+
"value": "블록은 `lang` 속성을 사용하여 프리프로세서 언어를 선언할 수 있습니다. 가장 일반적인 예는 `<script>` 블록에서 TypeScript를 사용하는 경우입니다:\n\n```html\n<script lang=\"ts\">\n // TypeScript 사용\n<\/script>\n```\n\n`lang`은 모든 블록에 적용할 수 있습니다. 예를 들어, `<style>`에는 [Sass](https://sass-lang.com/)를, `<template>`에는 [Pug](https://pugjs.org/api/getting-started.html)를 사용할 수 있습니다:\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n다양한 프리프로세서와의 통합은 도구 체인에 따라 다를 수 있습니다. 예시는 각 문서를 참고하세요:\n\n- [Vite](https://vite.dev/guide/features.html#css-pre-processors)\n- [Vue CLI](https://cli.vuejs.org/guide/css.html#pre-processors)\n- [webpack + vue-loader](https://vue-loader.vuejs.org/guide/pre-processors.html#using-pre-processors)"
|
|
110823
111332
|
},
|
|
110824
111333
|
"values": [
|
|
110825
111334
|
{ "name": "ts" },
|
|
@@ -110835,7 +111344,7 @@ var init_ko$1 = __esmMin((() => {
|
|
|
110835
111344
|
"valueSet": "v",
|
|
110836
111345
|
"description": {
|
|
110837
111346
|
"kind": "markdown",
|
|
110838
|
-
"value": "\n- 각 `*.vue` 파일에는 `<script setup>` 블록이 최대 한 개만 포함될 수 있습니다(일반 `<script>`는 제외).\n\n- 이 스크립트는 사전 처리되어 컴포넌트의 `setup()` 함수로
|
|
111347
|
+
"value": "\n- 각 `*.vue` 파일에는 `<script setup>` 블록이 최대 한 개만 포함될 수 있습니다(일반 `<script>`는 제외).\n\n- 이 스크립트는 사전 처리되어 컴포넌트의 `setup()` 함수로 사용됩니다. 즉, **컴포넌트의 각 인스턴스(instance)마다 실행**됩니다. `<script setup>`의 최상위 바인딩(binding)은 템플릿에 자동으로 노출됩니다. 자세한 내용은 [`<script setup>` 전용 문서](https://ko.vuejs.org/api/sfc-script-setup.html)를 참고하세요.\n"
|
|
110839
111348
|
},
|
|
110840
111349
|
"references": "api/sfc-spec.html#script-setup"
|
|
110841
111350
|
}
|
|
@@ -110851,7 +111360,7 @@ var init_ko$1 = __esmMin((() => {
|
|
|
110851
111360
|
"attributes": [],
|
|
110852
111361
|
"description": {
|
|
110853
111362
|
"kind": "markdown",
|
|
110854
|
-
"value": "\n- 각 `*.vue` 파일에는 `<script setup>` 블록이 최대 한 개만 포함될 수 있습니다(일반 `<script>`는 제외).\n\n- 이 스크립트는 사전 처리되어 컴포넌트의 `setup()` 함수로
|
|
111363
|
+
"value": "\n- 각 `*.vue` 파일에는 `<script setup>` 블록이 최대 한 개만 포함될 수 있습니다(일반 `<script>`는 제외).\n\n- 이 스크립트는 사전 처리되어 컴포넌트의 `setup()` 함수로 사용됩니다. 즉, **컴포넌트의 각 인스턴스(instance)마다 실행**됩니다. `<script setup>`의 최상위 바인딩(binding)은 템플릿에 자동으로 노출됩니다. 자세한 내용은 [`<script setup>` 전용 문서](https://ko.vuejs.org/api/sfc-script-setup.html)를 참고하세요.\n"
|
|
110855
111364
|
},
|
|
110856
111365
|
"references": "api/sfc-spec.html#script-setup"
|
|
110857
111366
|
},
|
|
@@ -110862,7 +111371,7 @@ var init_ko$1 = __esmMin((() => {
|
|
|
110862
111371
|
"name": "src",
|
|
110863
111372
|
"description": {
|
|
110864
111373
|
"kind": "markdown",
|
|
110865
|
-
"value": "`*.vue` 컴포넌트를 여러 파일로 분리하고 싶다면, `src` 속성을 사용하여 언어 블록에 외부 파일을 임포트할 수 있습니다:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n`src` 임포트는 webpack 모듈 요청과 동일한 경로
|
|
111374
|
+
"value": "`*.vue` 컴포넌트를 여러 파일로 분리하고 싶다면, `src` 속성을 사용하여 언어 블록에 외부 파일을 임포트할 수 있습니다:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n`src` 임포트는 webpack 모듈 요청과 동일한 경로 해석 규칙을 따르므로 주의하세요:\n\n- 상대 경로는 `./`로 시작해야 합니다.\n- npm 의존성에서 리소스를 임포트할 수 있습니다:\n\n```vue\n<!-- 설치된 \"todomvc-app-css\" npm 패키지에서 파일 임포트 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 임포트는 커스텀 블록에도 사용할 수 있습니다. 예:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 참고\n`src`에서 별칭을 사용할 때는 `~`로 시작하지 마세요. 그 뒤의 모든 것은 모듈 요청으로 해석됩니다. 즉, node 모듈 내부의 에셋을 참조할 수 있습니다:\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n:::"
|
|
110866
111375
|
},
|
|
110867
111376
|
"references": "api/sfc-spec.html#src-imports"
|
|
110868
111377
|
},
|
|
@@ -110870,7 +111379,7 @@ var init_ko$1 = __esmMin((() => {
|
|
|
110870
111379
|
"name": "lang",
|
|
110871
111380
|
"description": {
|
|
110872
111381
|
"kind": "markdown",
|
|
110873
|
-
"value": "블록은 `lang` 속성을 사용하여 프리프로세서 언어를 선언할 수 있습니다. 가장 일반적인 예는 `<script>` 블록에서 TypeScript를 사용하는 경우입니다:\n\n```html\n<script lang=\"ts\">\n // TypeScript 사용\n<\/script>\n```\n\n`lang
|
|
111382
|
+
"value": "블록은 `lang` 속성을 사용하여 프리프로세서 언어를 선언할 수 있습니다. 가장 일반적인 예는 `<script>` 블록에서 TypeScript를 사용하는 경우입니다:\n\n```html\n<script lang=\"ts\">\n // TypeScript 사용\n<\/script>\n```\n\n`lang`은 모든 블록에 적용할 수 있습니다. 예를 들어, `<style>`에는 [Sass](https://sass-lang.com/)를, `<template>`에는 [Pug](https://pugjs.org/api/getting-started.html)를 사용할 수 있습니다:\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n다양한 프리프로세서와의 통합은 도구 체인에 따라 다를 수 있습니다. 예시는 각 문서를 참고하세요:\n\n- [Vite](https://vite.dev/guide/features.html#css-pre-processors)\n- [Vue CLI](https://cli.vuejs.org/guide/css.html#pre-processors)\n- [webpack + vue-loader](https://vue-loader.vuejs.org/guide/pre-processors.html#using-pre-processors)"
|
|
110874
111383
|
},
|
|
110875
111384
|
"values": [
|
|
110876
111385
|
{ "name": "css" },
|
|
@@ -110887,7 +111396,7 @@ var init_ko$1 = __esmMin((() => {
|
|
|
110887
111396
|
"valueSet": "v",
|
|
110888
111397
|
"description": {
|
|
110889
111398
|
"kind": "markdown",
|
|
110890
|
-
"value": "`<style>` 태그에 `scoped` 속성이 있으면, 해당 CSS는 현재
|
|
111399
|
+
"value": "`<style>` 태그에 `scoped` 속성이 있으면, 해당 CSS는 현재 컴포넌트(component)의 요소에만 적용됩니다. 이는 Shadow DOM에서 볼 수 있는 스타일 캡슐화와 유사합니다. 몇 가지 주의사항이 있지만, 별도의 폴리필(polyfill)이 필요하지 않습니다. 이 기능은 PostCSS를 사용해 다음 코드를 변환하는 방식으로 구현됩니다:\n\n```vue\n<style scoped>\n.example {\n color: red;\n}\n</style>\n\n<template>\n <div class=\"example\">hi</div>\n</template>\n```\n\n위 코드는 다음과 같이 변환됩니다:\n\n```vue\n<style>\n.example[data-v-f3f3eg9] {\n color: red;\n}\n</style>\n\n<template>\n <div class=\"example\" data-v-f3f3eg9>hi</div>\n</template>\n```\n\n### 자식 컴포넌트 루트 요소 \n\n`scoped`를 사용하면, 부모 컴포넌트의 스타일이 자식 컴포넌트로 누출되지 않습니다. 하지만, 자식 컴포넌트의 루트 노드는 부모의 scoped CSS와 자식의 scoped CSS 모두의 영향을 받습니다. 이는 부모가 레이아웃 목적으로 자식의 루트 요소를 스타일링할 수 있도록 의도된 동작입니다.\n\n### 딥 셀렉터 \n\n`scoped` 스타일에서 셀렉터가 \"딥\"하게, 즉 자식 컴포넌트에까지 영향을 미치게 하려면 `:deep()` 의사 클래스(pseudo-class)를 사용할 수 있습니다:\n\n```vue\n<style scoped>\n.a :deep(.b) {\n /* ... */\n}\n</style>\n```\n\n위 코드는 다음과 같이 컴파일됩니다:\n\n```css\n.a[data-v-f3f3eg9] .b {\n /* ... */\n}\n```\n\n:::tip\n`v-html`로 생성된 DOM 콘텐츠는 scoped 스타일의 영향을 받지 않지만, 딥 셀렉터를 사용하여 여전히 스타일링할 수 있습니다.\n:::\n\n### 슬롯 셀렉터 \n\n기본적으로, scoped 스타일은 `<slot/>`으로 렌더링(rendering)된 콘텐츠에 영향을 주지 않습니다. 슬롯 콘텐츠는 그것을 전달한 부모 컴포넌트의 소유로 간주되기 때문입니다. 슬롯(slot) 콘텐츠를 명시적으로 타겟팅하려면 `:slotted` 의사 클래스를 사용하세요:\n\n```vue\n<style scoped>\n:slotted(div) {\n color: red;\n}\n</style>\n```\n\n### 글로벌 셀렉터 \n\n단일 규칙만 전역적으로 적용하고 싶다면, 별도의 `<style>`을 만들지 않고 `:global` 의사 클래스를 사용할 수 있습니다(아래 참고):\n\n```vue\n<style scoped>\n:global(.red) {\n color: red;\n}\n</style>\n```\n\n### 로컬 및 글로벌 스타일 혼합 \n\n동일한 컴포넌트 내에서 scoped 스타일과 non-scoped 스타일을 모두 포함할 수도 있습니다:\n\n```vue\n<style>\n/* 글로벌 스타일 */\n</style>\n\n<style scoped>\n/* 로컬 스타일 */\n</style>\n```\n\n### Scoped 스타일 팁 \n\n- **Scoped 스타일이 클래스의 필요성을 없애지는 않습니다.** 브라우저가 다양한 CSS 셀렉터를 렌더링하는 방식 때문에, `p { color: red }`와 같은 셀렉터는 scoped 상태(즉, 속성 셀렉터와 결합된 상태)에서 훨씬 느려집니다. 대신 `.example { color: red }`와 같이 클래스나 id를 사용하면 성능 저하를 사실상 없앨 수 있습니다.\n\n- **재귀 컴포넌트에서 자손 셀렉터를 사용할 때 주의하세요!** `.a .b`와 같은 셀렉터가 있는 CSS 규칙에서, `.a`에 해당하는 요소가 재귀 자식 컴포넌트를 포함하면, 해당 자식 컴포넌트 내의 모든 `.b`가 이 규칙에 의해 매칭됩니다."
|
|
110891
111400
|
},
|
|
110892
111401
|
"references": "api/sfc-css-features.html#scoped-css"
|
|
110893
111402
|
},
|
|
@@ -110896,7 +111405,7 @@ var init_ko$1 = __esmMin((() => {
|
|
|
110896
111405
|
"valueSet": "v",
|
|
110897
111406
|
"description": {
|
|
110898
111407
|
"kind": "markdown",
|
|
110899
|
-
"value": "`<style module>` 태그는 [CSS Modules](https://github.com/css-modules/css-modules)로 컴파일되며, 결과 CSS 클래스가 `$style` 키 아래의 객체로 컴포넌트에 노출됩니다:\n\n```vue\n<template>\n <p :class=\"$style.red\">This should be red</p>\n</template>\n\n<style module>\n.red {\n color: red;\n}\n</style>\n```\n\n결과 클래스는 충돌을 방지하기 위해 해시 처리되어, CSS가 현재 컴포넌트에만 적용되는 것과 동일한 효과를 얻습니다.\n\n[CSS Modules 명세](https://github.com/css-modules/css-modules)에서 [글로벌 예외](https://github.com/css-modules/css-modules/blob/master/docs/composition.md#exceptions) 및 [컴포지션](https://github.com/css-modules/css-modules/blob/master/docs/composition.md#composition) 등 자세한 내용을 참고하세요.\n\n### 커스텀 주입 이름 \n\n`module` 속성에 값을 지정하여 주입된 클래스 객체의 프로퍼티 키를 커스터마이즈할 수 있습니다:\n\n```vue\n<template>\n <p :class=\"classes.red\">red</p>\n</template>\n\n<style module=\"classes\">\n.red {\n color: red;\n}\n</style>\n```\n\n### Composition API와 함께 사용하기 \n\n주입된 클래스는 `setup()` 및 `<script setup>`에서 `useCssModule` API를 통해 접근할 수 있습니다. 커스텀 주입 이름이 있는 `<style module>` 블록의 경우, `useCssModule`의 첫 번째 인자로 일치하는 `module` 속성 값을 전달합니다:\n\n```js\nimport { useCssModule } from 'vue'\n\n// setup() 범위 내에서...\n// 기본값, <style module>의 클래스를 반환\nuseCssModule()\n\n// 이름 지정, <style module=\"classes\">의 클래스를 반환\nuseCssModule('classes')\n```\n\n- **예시**\n\n```vue\n<script setup lang=\"ts\">\nimport { useCssModule } from 'vue'\n\nconst classes = useCssModule()\n<\/script>\n\n<template>\n <p :class=\"classes.red\">red</p>\n</template>\n\n<style module>\n.red {\n color: red;\n}\n</style>\n```"
|
|
111408
|
+
"value": "`<style module>` 태그는 [CSS Modules](https://github.com/css-modules/css-modules)로 컴파일되며, 결과 CSS 클래스가 `$style` 키 아래의 객체로 컴포넌트에 노출됩니다:\n\n```vue\n<template>\n <p :class=\"$style.red\">This should be red</p>\n</template>\n\n<style module>\n.red {\n color: red;\n}\n</style>\n```\n\n결과 클래스는 충돌을 방지하기 위해 해시 처리되어, CSS가 현재 컴포넌트에만 적용되는 것과 동일한 효과를 얻습니다.\n\n[CSS Modules 명세](https://github.com/css-modules/css-modules)에서 [글로벌 예외](https://github.com/css-modules/css-modules/blob/master/docs/composition.md#exceptions) 및 [컴포지션](https://github.com/css-modules/css-modules/blob/master/docs/composition.md#composition) 등 자세한 내용을 참고하세요.\n\n### 커스텀 주입 이름 \n\n`module` 속성에 값을 지정하여 주입된 클래스 객체의 프로퍼티(property) 키를 커스터마이즈할 수 있습니다:\n\n```vue\n<template>\n <p :class=\"classes.red\">red</p>\n</template>\n\n<style module=\"classes\">\n.red {\n color: red;\n}\n</style>\n```\n\n### Composition API와 함께 사용하기 \n\n주입된 클래스는 `setup()` 및 `<script setup>`에서 `useCssModule` API를 통해 접근할 수 있습니다. 커스텀 주입 이름이 있는 `<style module>` 블록의 경우, `useCssModule`의 첫 번째 인자로 일치하는 `module` 속성 값을 전달합니다:\n\n```js\nimport { useCssModule } from 'vue'\n\n// setup() 범위 내에서...\n// 기본값, <style module>의 클래스를 반환\nuseCssModule()\n\n// 이름 지정, <style module=\"classes\">의 클래스를 반환\nuseCssModule('classes')\n```\n\n- **예시**\n\n```vue\n<script setup lang=\"ts\">\nimport { useCssModule } from 'vue'\n\nconst classes = useCssModule()\n<\/script>\n\n<template>\n <p :class=\"classes.red\">red</p>\n</template>\n\n<style module>\n.red {\n color: red;\n}\n</style>\n```"
|
|
110900
111409
|
},
|
|
110901
111410
|
"references": "api/sfc-css-features.html#css-modules"
|
|
110902
111411
|
}
|
|
@@ -110913,7 +111422,7 @@ var init_ko$1 = __esmMin((() => {
|
|
|
110913
111422
|
"name": "src",
|
|
110914
111423
|
"description": {
|
|
110915
111424
|
"kind": "markdown",
|
|
110916
|
-
"value": "`*.vue` 컴포넌트를 여러 파일로 분리하고 싶다면, `src` 속성을 사용하여 언어 블록에 외부 파일을 임포트할 수 있습니다:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n`src` 임포트는 webpack 모듈 요청과 동일한 경로
|
|
111425
|
+
"value": "`*.vue` 컴포넌트를 여러 파일로 분리하고 싶다면, `src` 속성을 사용하여 언어 블록에 외부 파일을 임포트할 수 있습니다:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n`src` 임포트는 webpack 모듈 요청과 동일한 경로 해석 규칙을 따르므로 주의하세요:\n\n- 상대 경로는 `./`로 시작해야 합니다.\n- npm 의존성에서 리소스를 임포트할 수 있습니다:\n\n```vue\n<!-- 설치된 \"todomvc-app-css\" npm 패키지에서 파일 임포트 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 임포트는 커스텀 블록에도 사용할 수 있습니다. 예:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 참고\n`src`에서 별칭을 사용할 때는 `~`로 시작하지 마세요. 그 뒤의 모든 것은 모듈 요청으로 해석됩니다. 즉, node 모듈 내부의 에셋을 참조할 수 있습니다:\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n:::"
|
|
110917
111426
|
},
|
|
110918
111427
|
"references": "api/sfc-spec.html#src-imports"
|
|
110919
111428
|
}],
|
|
@@ -110928,7 +111437,7 @@ var init_ko$1 = __esmMin((() => {
|
|
|
110928
111437
|
"name": "lang",
|
|
110929
111438
|
"description": {
|
|
110930
111439
|
"kind": "markdown",
|
|
110931
|
-
"value": "블록은 `lang` 속성을 사용하여 프리프로세서 언어를 선언할 수 있습니다. 가장 일반적인 예는 `<script>` 블록에서 TypeScript를 사용하는 경우입니다:\n\n```html\n<script lang=\"ts\">\n // TypeScript 사용\n<\/script>\n```\n\n`lang
|
|
111440
|
+
"value": "블록은 `lang` 속성을 사용하여 프리프로세서 언어를 선언할 수 있습니다. 가장 일반적인 예는 `<script>` 블록에서 TypeScript를 사용하는 경우입니다:\n\n```html\n<script lang=\"ts\">\n // TypeScript 사용\n<\/script>\n```\n\n`lang`은 모든 블록에 적용할 수 있습니다. 예를 들어, `<style>`에는 [Sass](https://sass-lang.com/)를, `<template>`에는 [Pug](https://pugjs.org/api/getting-started.html)를 사용할 수 있습니다:\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n다양한 프리프로세서와의 통합은 도구 체인에 따라 다를 수 있습니다. 예시는 각 문서를 참고하세요:\n\n- [Vite](https://vite.dev/guide/features.html#css-pre-processors)\n- [Vue CLI](https://cli.vuejs.org/guide/css.html#pre-processors)\n- [webpack + vue-loader](https://vue-loader.vuejs.org/guide/pre-processors.html#using-pre-processors)"
|
|
110932
111441
|
},
|
|
110933
111442
|
"values": [],
|
|
110934
111443
|
"references": "api/sfc-spec.html#pre-processors"
|
|
@@ -110936,7 +111445,7 @@ var init_ko$1 = __esmMin((() => {
|
|
|
110936
111445
|
"name": "src",
|
|
110937
111446
|
"description": {
|
|
110938
111447
|
"kind": "markdown",
|
|
110939
|
-
"value": "`*.vue` 컴포넌트를 여러 파일로 분리하고 싶다면, `src` 속성을 사용하여 언어 블록에 외부 파일을 임포트할 수 있습니다:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n`src` 임포트는 webpack 모듈 요청과 동일한 경로
|
|
111448
|
+
"value": "`*.vue` 컴포넌트를 여러 파일로 분리하고 싶다면, `src` 속성을 사용하여 언어 블록에 외부 파일을 임포트할 수 있습니다:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n`src` 임포트는 webpack 모듈 요청과 동일한 경로 해석 규칙을 따르므로 주의하세요:\n\n- 상대 경로는 `./`로 시작해야 합니다.\n- npm 의존성에서 리소스를 임포트할 수 있습니다:\n\n```vue\n<!-- 설치된 \"todomvc-app-css\" npm 패키지에서 파일 임포트 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 임포트는 커스텀 블록에도 사용할 수 있습니다. 예:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 참고\n`src`에서 별칭을 사용할 때는 `~`로 시작하지 마세요. 그 뒤의 모든 것은 모듈 요청으로 해석됩니다. 즉, node 모듈 내부의 에셋을 참조할 수 있습니다:\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n:::"
|
|
110940
111449
|
},
|
|
110941
111450
|
"references": "api/sfc-spec.html#src-imports"
|
|
110942
111451
|
}];
|
|
@@ -111140,14 +111649,14 @@ var init_zh_cn$1 = __esmMin((() => {
|
|
|
111140
111649
|
"name": "src",
|
|
111141
111650
|
"description": {
|
|
111142
111651
|
"kind": "markdown",
|
|
111143
|
-
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 注意\n在 `src` 中使用别名时,不要以 `~` 开头,后面的任何内容都会被解释为模块请求。这意味着你可以引用 node 模块中的资源:\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n:::"
|
|
111652
|
+
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 注意\n在 `src` 中使用别名时,不要以 `~` 开头,后面的任何内容都会被解释为模块请求。这意味着你可以引用 node 模块中的资源:\n\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n\n:::"
|
|
111144
111653
|
},
|
|
111145
111654
|
"references": "api/sfc-spec.html#src-imports"
|
|
111146
111655
|
}, {
|
|
111147
111656
|
"name": "lang",
|
|
111148
111657
|
"description": {
|
|
111149
111658
|
"kind": "markdown",
|
|
111150
|
-
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://cn.
|
|
111659
|
+
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://cn.vite.dev/guide/features.html#css-pre-processors)\n- [Vue CLI](https://cli.vuejs.org/zh/guide/css.html#%E9%A2%84%E5%A4%84%E7%90%86%E5%99%A8)\n- [webpack + vue-loader](https://vue-loader.vuejs.org/zh/guide/pre-processors.html#%E4%BD%BF%E7%94%A8%E9%A2%84%E5%A4%84%E7%90%86%E5%99%A8)"
|
|
111151
111660
|
},
|
|
111152
111661
|
"values": [{ "name": "html" }, { "name": "pug" }],
|
|
111153
111662
|
"references": "api/sfc-spec.html#pre-processors"
|
|
@@ -111165,7 +111674,7 @@ var init_zh_cn$1 = __esmMin((() => {
|
|
|
111165
111674
|
"name": "src",
|
|
111166
111675
|
"description": {
|
|
111167
111676
|
"kind": "markdown",
|
|
111168
|
-
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 注意\n在 `src` 中使用别名时,不要以 `~` 开头,后面的任何内容都会被解释为模块请求。这意味着你可以引用 node 模块中的资源:\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n:::"
|
|
111677
|
+
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 注意\n在 `src` 中使用别名时,不要以 `~` 开头,后面的任何内容都会被解释为模块请求。这意味着你可以引用 node 模块中的资源:\n\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n\n:::"
|
|
111169
111678
|
},
|
|
111170
111679
|
"references": "api/sfc-spec.html#src-imports"
|
|
111171
111680
|
},
|
|
@@ -111173,7 +111682,7 @@ var init_zh_cn$1 = __esmMin((() => {
|
|
|
111173
111682
|
"name": "lang",
|
|
111174
111683
|
"description": {
|
|
111175
111684
|
"kind": "markdown",
|
|
111176
|
-
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://cn.
|
|
111685
|
+
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://cn.vite.dev/guide/features.html#css-pre-processors)\n- [Vue CLI](https://cli.vuejs.org/zh/guide/css.html#%E9%A2%84%E5%A4%84%E7%90%86%E5%99%A8)\n- [webpack + vue-loader](https://vue-loader.vuejs.org/zh/guide/pre-processors.html#%E4%BD%BF%E7%94%A8%E9%A2%84%E5%A4%84%E7%90%86%E5%99%A8)"
|
|
111177
111686
|
},
|
|
111178
111687
|
"values": [
|
|
111179
111688
|
{ "name": "ts" },
|
|
@@ -111216,7 +111725,7 @@ var init_zh_cn$1 = __esmMin((() => {
|
|
|
111216
111725
|
"name": "src",
|
|
111217
111726
|
"description": {
|
|
111218
111727
|
"kind": "markdown",
|
|
111219
|
-
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 注意\n在 `src` 中使用别名时,不要以 `~` 开头,后面的任何内容都会被解释为模块请求。这意味着你可以引用 node 模块中的资源:\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n:::"
|
|
111728
|
+
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 注意\n在 `src` 中使用别名时,不要以 `~` 开头,后面的任何内容都会被解释为模块请求。这意味着你可以引用 node 模块中的资源:\n\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n\n:::"
|
|
111220
111729
|
},
|
|
111221
111730
|
"references": "api/sfc-spec.html#src-imports"
|
|
111222
111731
|
},
|
|
@@ -111224,7 +111733,7 @@ var init_zh_cn$1 = __esmMin((() => {
|
|
|
111224
111733
|
"name": "lang",
|
|
111225
111734
|
"description": {
|
|
111226
111735
|
"kind": "markdown",
|
|
111227
|
-
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://cn.
|
|
111736
|
+
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://cn.vite.dev/guide/features.html#css-pre-processors)\n- [Vue CLI](https://cli.vuejs.org/zh/guide/css.html#%E9%A2%84%E5%A4%84%E7%90%86%E5%99%A8)\n- [webpack + vue-loader](https://vue-loader.vuejs.org/zh/guide/pre-processors.html#%E4%BD%BF%E7%94%A8%E9%A2%84%E5%A4%84%E7%90%86%E5%99%A8)"
|
|
111228
111737
|
},
|
|
111229
111738
|
"values": [
|
|
111230
111739
|
{ "name": "css" },
|
|
@@ -111267,7 +111776,7 @@ var init_zh_cn$1 = __esmMin((() => {
|
|
|
111267
111776
|
"name": "src",
|
|
111268
111777
|
"description": {
|
|
111269
111778
|
"kind": "markdown",
|
|
111270
|
-
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 注意\n在 `src` 中使用别名时,不要以 `~` 开头,后面的任何内容都会被解释为模块请求。这意味着你可以引用 node 模块中的资源:\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n:::"
|
|
111779
|
+
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 注意\n在 `src` 中使用别名时,不要以 `~` 开头,后面的任何内容都会被解释为模块请求。这意味着你可以引用 node 模块中的资源:\n\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n\n:::"
|
|
111271
111780
|
},
|
|
111272
111781
|
"references": "api/sfc-spec.html#src-imports"
|
|
111273
111782
|
}],
|
|
@@ -111282,7 +111791,7 @@ var init_zh_cn$1 = __esmMin((() => {
|
|
|
111282
111791
|
"name": "lang",
|
|
111283
111792
|
"description": {
|
|
111284
111793
|
"kind": "markdown",
|
|
111285
|
-
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://cn.
|
|
111794
|
+
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://cn.vite.dev/guide/features.html#css-pre-processors)\n- [Vue CLI](https://cli.vuejs.org/zh/guide/css.html#%E9%A2%84%E5%A4%84%E7%90%86%E5%99%A8)\n- [webpack + vue-loader](https://vue-loader.vuejs.org/zh/guide/pre-processors.html#%E4%BD%BF%E7%94%A8%E9%A2%84%E5%A4%84%E7%90%86%E5%99%A8)"
|
|
111286
111795
|
},
|
|
111287
111796
|
"values": [],
|
|
111288
111797
|
"references": "api/sfc-spec.html#pre-processors"
|
|
@@ -111290,7 +111799,7 @@ var init_zh_cn$1 = __esmMin((() => {
|
|
|
111290
111799
|
"name": "src",
|
|
111291
111800
|
"description": {
|
|
111292
111801
|
"kind": "markdown",
|
|
111293
|
-
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 注意\n在 `src` 中使用别名时,不要以 `~` 开头,后面的任何内容都会被解释为模块请求。这意味着你可以引用 node 模块中的资源:\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n:::"
|
|
111802
|
+
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 注意\n在 `src` 中使用别名时,不要以 `~` 开头,后面的任何内容都会被解释为模块请求。这意味着你可以引用 node 模块中的资源:\n\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n\n:::"
|
|
111294
111803
|
},
|
|
111295
111804
|
"references": "api/sfc-spec.html#src-imports"
|
|
111296
111805
|
}];
|
|
@@ -111317,14 +111826,14 @@ var init_zh_hk$1 = __esmMin((() => {
|
|
|
111317
111826
|
"name": "src",
|
|
111318
111827
|
"description": {
|
|
111319
111828
|
"kind": "markdown",
|
|
111320
|
-
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```"
|
|
111829
|
+
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 注意\n在 `src` 中使用別名時,不要以 `~` 開頭,否則 `~` 後面的內容會被當作模塊請求來解析。這意味著你可以引用 node modules 中的資源:\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n:::"
|
|
111321
111830
|
},
|
|
111322
111831
|
"references": "api/sfc-spec.html#src-imports"
|
|
111323
111832
|
}, {
|
|
111324
111833
|
"name": "lang",
|
|
111325
111834
|
"description": {
|
|
111326
111835
|
"kind": "markdown",
|
|
111327
|
-
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://
|
|
111836
|
+
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://vite.dev/guide/features.html#css-pre-processors)\n- [Vue CLI](https://cli.vuejs.org/guide/css.html#pre-processors)\n- [webpack + vue-loader](https://vue-loader.vuejs.org/guide/pre-processors.html#using-pre-processors)"
|
|
111328
111837
|
},
|
|
111329
111838
|
"values": [{ "name": "html" }, { "name": "pug" }],
|
|
111330
111839
|
"references": "api/sfc-spec.html#pre-processors"
|
|
@@ -111342,7 +111851,7 @@ var init_zh_hk$1 = __esmMin((() => {
|
|
|
111342
111851
|
"name": "src",
|
|
111343
111852
|
"description": {
|
|
111344
111853
|
"kind": "markdown",
|
|
111345
|
-
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```"
|
|
111854
|
+
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 注意\n在 `src` 中使用別名時,不要以 `~` 開頭,否則 `~` 後面的內容會被當作模塊請求來解析。這意味著你可以引用 node modules 中的資源:\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n:::"
|
|
111346
111855
|
},
|
|
111347
111856
|
"references": "api/sfc-spec.html#src-imports"
|
|
111348
111857
|
},
|
|
@@ -111350,7 +111859,7 @@ var init_zh_hk$1 = __esmMin((() => {
|
|
|
111350
111859
|
"name": "lang",
|
|
111351
111860
|
"description": {
|
|
111352
111861
|
"kind": "markdown",
|
|
111353
|
-
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://
|
|
111862
|
+
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://vite.dev/guide/features.html#css-pre-processors)\n- [Vue CLI](https://cli.vuejs.org/guide/css.html#pre-processors)\n- [webpack + vue-loader](https://vue-loader.vuejs.org/guide/pre-processors.html#using-pre-processors)"
|
|
111354
111863
|
},
|
|
111355
111864
|
"values": [
|
|
111356
111865
|
{ "name": "ts" },
|
|
@@ -111393,7 +111902,7 @@ var init_zh_hk$1 = __esmMin((() => {
|
|
|
111393
111902
|
"name": "src",
|
|
111394
111903
|
"description": {
|
|
111395
111904
|
"kind": "markdown",
|
|
111396
|
-
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```"
|
|
111905
|
+
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 注意\n在 `src` 中使用別名時,不要以 `~` 開頭,否則 `~` 後面的內容會被當作模塊請求來解析。這意味著你可以引用 node modules 中的資源:\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n:::"
|
|
111397
111906
|
},
|
|
111398
111907
|
"references": "api/sfc-spec.html#src-imports"
|
|
111399
111908
|
},
|
|
@@ -111401,7 +111910,7 @@ var init_zh_hk$1 = __esmMin((() => {
|
|
|
111401
111910
|
"name": "lang",
|
|
111402
111911
|
"description": {
|
|
111403
111912
|
"kind": "markdown",
|
|
111404
|
-
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://
|
|
111913
|
+
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://vite.dev/guide/features.html#css-pre-processors)\n- [Vue CLI](https://cli.vuejs.org/guide/css.html#pre-processors)\n- [webpack + vue-loader](https://vue-loader.vuejs.org/guide/pre-processors.html#using-pre-processors)"
|
|
111405
111914
|
},
|
|
111406
111915
|
"values": [
|
|
111407
111916
|
{ "name": "css" },
|
|
@@ -111427,7 +111936,7 @@ var init_zh_hk$1 = __esmMin((() => {
|
|
|
111427
111936
|
"valueSet": "v",
|
|
111428
111937
|
"description": {
|
|
111429
111938
|
"kind": "markdown",
|
|
111430
|
-
"value": "一个 `<style module>` 标签会被编译为 [CSS Modules](https://github.com/css-modules/css-modules) 并且将生成的 CSS class 作为 `$style` 对象暴露给组件:\n\n```vue\n<template>\n <p :class=\"$style.red\">This should be red</p>\n</template>\n\n<style module>\n.red {\n color: red;\n}\n</style>\n```\n\n得出的 class 将被哈希化以避免冲突,实现了同样的将 CSS 仅作用于当前组件的效果。\n\n参考 [CSS Modules spec](https://github.com/css-modules/css-modules) 以查看更多详情,例如 [global exceptions](https://github.com/css-modules/css-modules/blob/master/docs/composition.md#exceptions) 和 [composition](https://github.com/css-modules/css-modules/blob/master/docs/composition.md#composition)。\n\n### 自定义注入名称 \n\n你可以通过给 `module` attribute 一个值来自定义注入 class 对象的属性名:\n\n```vue\n<template>\n <p :class=\"classes.red\">red</p>\n</template>\n\n<style module=\"classes\">\n.red {\n color: red;\n}\n</style>\n```\n\n### 与组合式 API 一同使用 \n\n可以通过 `useCssModule` API 在 `setup()` 和 `<script setup>` 中访问注入的 class。对于使用了自定义注入名称的 `<style module>` 块,`useCssModule` 接收一个匹配的 `module` attribute 值作为第一个参数:\n\n```js\nimport { useCssModule } from 'vue'\n\n// 在 setup() 作用域中...\n// 默认情况下, 返回 <style module> 的 class\nuseCssModule()\n\n// 具名情况下, 返回 <style module=\"classes\"> 的 class\nuseCssModule('classes')\n```"
|
|
111939
|
+
"value": "一个 `<style module>` 标签会被编译为 [CSS Modules](https://github.com/css-modules/css-modules) 并且将生成的 CSS class 作为 `$style` 对象暴露给组件:\n\n```vue\n<template>\n <p :class=\"$style.red\">This should be red</p>\n</template>\n\n<style module>\n.red {\n color: red;\n}\n</style>\n```\n\n得出的 class 将被哈希化以避免冲突,实现了同样的将 CSS 仅作用于当前组件的效果。\n\n参考 [CSS Modules spec](https://github.com/css-modules/css-modules) 以查看更多详情,例如 [global exceptions](https://github.com/css-modules/css-modules/blob/master/docs/composition.md#exceptions) 和 [composition](https://github.com/css-modules/css-modules/blob/master/docs/composition.md#composition)。\n\n### 自定义注入名称 \n\n你可以通过给 `module` attribute 一个值来自定义注入 class 对象的属性名:\n\n```vue\n<template>\n <p :class=\"classes.red\">red</p>\n</template>\n\n<style module=\"classes\">\n.red {\n color: red;\n}\n</style>\n```\n\n### 与组合式 API 一同使用 \n\n可以通过 `useCssModule` API 在 `setup()` 和 `<script setup>` 中访问注入的 class。对于使用了自定义注入名称的 `<style module>` 块,`useCssModule` 接收一个匹配的 `module` attribute 值作为第一个参数:\n\n```js\nimport { useCssModule } from 'vue'\n\n// 在 setup() 作用域中...\n// 默认情况下, 返回 <style module> 的 class\nuseCssModule()\n\n// 具名情况下, 返回 <style module=\"classes\"> 的 class\nuseCssModule('classes')\n```\n\n- **Example**\n\n```vue\n<script setup lang=\"ts\">\nimport { useCssModule } from 'vue'\n\nconst classes = useCssModule()\n<\/script>\n\n<template>\n <p :class=\"classes.red\">red</p>\n</template>\n\n<style module>\n.red {\n color: red;\n}\n</style>\n```\n\n- **Example**\n\n```vue\n<script setup lang=\"ts\">\nimport { useCssModule } from 'vue'\n\nconst classes = useCssModule()\n<\/script>\n\n<template>\n <p :class=\"classes.red\">red</p>\n</template>\n\n<style module>\n.red {\n color: red;\n}\n</style>\n```"
|
|
111431
111940
|
},
|
|
111432
111941
|
"references": "api/sfc-css-features.html#css-modules"
|
|
111433
111942
|
}
|
|
@@ -111444,13 +111953,13 @@ var init_zh_hk$1 = __esmMin((() => {
|
|
|
111444
111953
|
"name": "src",
|
|
111445
111954
|
"description": {
|
|
111446
111955
|
"kind": "markdown",
|
|
111447
|
-
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```"
|
|
111956
|
+
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 注意\n在 `src` 中使用別名時,不要以 `~` 開頭,否則 `~` 後面的內容會被當作模塊請求來解析。這意味著你可以引用 node modules 中的資源:\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n:::"
|
|
111448
111957
|
},
|
|
111449
111958
|
"references": "api/sfc-spec.html#src-imports"
|
|
111450
111959
|
}],
|
|
111451
111960
|
"description": {
|
|
111452
111961
|
"kind": "markdown",
|
|
111453
|
-
"value": "\n在一个 `*.vue` 文件中可以为任何项目特定需求使用额外的自定义块。举例来说,一个用作写文档的 `<docs>` 块。这里是一些自定义块的真实用例:\n\n- [Gridsome:`<page-query>`](https://gridsome.org/docs/querying-data/)\n- [vite-plugin-vue-gql:`<gql>`](https://github.com/wheatjs/vite-plugin-vue-gql)\n- [vue-i18n:`<i18n>`](https://github.com/intlify/bundle-tools/tree/main/packages/
|
|
111962
|
+
"value": "\n在一个 `*.vue` 文件中可以为任何项目特定需求使用额外的自定义块。举例来说,一个用作写文档的 `<docs>` 块。这里是一些自定义块的真实用例:\n\n- [Gridsome:`<page-query>`](https://gridsome.org/docs/querying-data/)\n- [vite-plugin-vue-gql:`<gql>`](https://github.com/wheatjs/vite-plugin-vue-gql)\n- [vue-i18n:`<i18n>`](https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n#i18n-custom-block)\n\n自定义块的处理需要依赖工具链。如果你想要在构建中集成你的自定义语块,请参见 [SFC 自定义块集成工具链指南](https://zh-hk.vuejs.org/guide/scaling-up/tooling.html#sfc-custom-block-integrations)获取更多细节。\n"
|
|
111454
111963
|
},
|
|
111455
111964
|
"references": "api/sfc-spec.html#自定义块"
|
|
111456
111965
|
}
|
|
@@ -111459,7 +111968,7 @@ var init_zh_hk$1 = __esmMin((() => {
|
|
|
111459
111968
|
"name": "lang",
|
|
111460
111969
|
"description": {
|
|
111461
111970
|
"kind": "markdown",
|
|
111462
|
-
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://
|
|
111971
|
+
"value": "代码块可以使用 `lang` 这个 attribute 来声明预处理器语言,最常见的用例就是在 `<script>` 中使用 TypeScript:\n\n```html\n<script lang=\"ts\">\n // use TypeScript\n<\/script>\n```\n\n`lang` 在任意块上都能使用,比如我们可以在 `<style>` 标签中使用 [Sass](https://sass-lang.com/) 或是 `<template>` 中使用 [Pug](https://pugjs.org/api/getting-started.html):\n\n```html\n<template lang=\"pug\">\np {{ msg }}\n</template>\n\n<style lang=\"scss\">\n $primary-color: #333;\n body {\n color: $primary-color;\n }\n</style>\n```\n\n注意对不同预处理器的集成会根据你所使用的工具链而有所不同,具体细节请查看相应的工具链文档来确认:\n\n- [Vite](https://vite.dev/guide/features.html#css-pre-processors)\n- [Vue CLI](https://cli.vuejs.org/guide/css.html#pre-processors)\n- [webpack + vue-loader](https://vue-loader.vuejs.org/guide/pre-processors.html#using-pre-processors)"
|
|
111463
111972
|
},
|
|
111464
111973
|
"values": [],
|
|
111465
111974
|
"references": "api/sfc-spec.html#pre-processors"
|
|
@@ -111467,7 +111976,7 @@ var init_zh_hk$1 = __esmMin((() => {
|
|
|
111467
111976
|
"name": "src",
|
|
111468
111977
|
"description": {
|
|
111469
111978
|
"kind": "markdown",
|
|
111470
|
-
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```"
|
|
111979
|
+
"value": "如果你更喜欢将 `*.vue` 组件分散到多个文件中,可以为一个语块使用 `src` 这个 attribute 来导入一个外部文件:\n\n```vue\n<template src=\"./template.html\"></template>\n<style src=\"./style.css\"></style>\n<script src=\"./script.js\"><\/script>\n```\n\n请注意 `src` 导入和 JS 模块导入遵循相同的路径解析规则,这意味着:\n\n- 相对路径需要以 `./` 开头\n- 你也可以从 npm 依赖中导入资源\n\n```vue\n<!-- 从所安装的 \"todomvc-app-css\" npm 包中导入一个文件 -->\n<style src=\"todomvc-app-css/index.css\" />\n```\n\n`src` 导入对自定义语块也同样适用:\n\n```vue\n<unit-test src=\"./unit-test.js\">\n</unit-test>\n```\n\n:::warning 注意\n在 `src` 中使用別名時,不要以 `~` 開頭,否則 `~` 後面的內容會被當作模塊請求來解析。這意味著你可以引用 node modules 中的資源:\n```vue\n<img src=\"~some-npm-package/foo.png\">\n```\n:::"
|
|
111471
111980
|
},
|
|
111472
111981
|
"references": "api/sfc-spec.html#src-imports"
|
|
111473
111982
|
}];
|
|
@@ -112279,7 +112788,7 @@ var init_ko = __esmMin((() => {
|
|
|
112279
112788
|
"name": "lazy",
|
|
112280
112789
|
"description": {
|
|
112281
112790
|
"kind": "markdown",
|
|
112282
|
-
"value": "기본적으로, `v-model`은 각 `input` 이벤트 후에 입력과 데이터를 동기화합니다([위에서 언급한 IME 조합 제외](#vmodel-ime-tip)). 대신 `change` 이벤트 후에 동기화하려면 `lazy`
|
|
112791
|
+
"value": "기본적으로, `v-model`은 각 `input` 이벤트 후에 입력과 데이터를 동기화합니다([위에서 언급한 IME 조합 제외](#vmodel-ime-tip)). 대신 `change` 이벤트 후에 동기화하려면 `lazy` 수식어(modifier)를 추가할 수 있습니다:\n\n```html\n<!-- \"input\" 대신 \"change\" 후에 동기화됨 -->\n<input v-model.lazy=\"msg\" />\n```"
|
|
112283
112792
|
},
|
|
112284
112793
|
"references": "guide/essentials/forms.html#lazy"
|
|
112285
112794
|
},
|
|
@@ -112407,7 +112916,7 @@ var init_zh_hk = __esmMin((() => {
|
|
|
112407
112916
|
"name": "number",
|
|
112408
112917
|
"description": {
|
|
112409
112918
|
"kind": "markdown",
|
|
112410
|
-
"value": "如果你想讓用戶輸入自動轉換為數字,你可以在 `v-model` 後添加 `.number` 修飾符來管理輸入:\n\n```html\n<input v-model.number=\"age\" />\n```\n\
|
|
112919
|
+
"value": "如果你想讓用戶輸入自動轉換為數字,你可以在 `v-model` 後添加 `.number` 修飾符來管理輸入:\n\n```html\n<input v-model.number=\"age\" />\n```\n\nIf the value cannot be parsed with `parseFloat()`, then the original (string) value is used instead. In particular, if the input is empty (for instance after the user clearing the input field), an empty string is returned. This behavior differs from the [DOM property `valueAsNumber`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement#valueasnumber). \n\n`number` 修飾符會在輸入框有 `type=\"number\"` 時自動啟用。"
|
|
112411
112920
|
},
|
|
112412
112921
|
"references": "guide/essentials/forms.html#number"
|
|
112413
112922
|
},
|
|
@@ -116598,7 +117107,8 @@ var require_vue_template = /* @__PURE__ */ __commonJSMin(((exports, module, this
|
|
|
116598
117107
|
}
|
|
116599
117108
|
}
|
|
116600
117109
|
async function getCustomData() {
|
|
116601
|
-
const
|
|
117110
|
+
const raw = await context.env.getConfiguration?.("html.customData");
|
|
117111
|
+
const paths = Array.isArray(raw) ? raw.filter(Boolean) : [];
|
|
116602
117112
|
const customData = [];
|
|
116603
117113
|
for (const path of paths) for (const workspaceFolder of context.env.workspaceFolders) {
|
|
116604
117114
|
const uri = vscode_uri_1.Utils.resolvePath(workspaceFolder, path);
|
|
@@ -272468,11 +272978,11 @@ var require_connection$1 = /* @__PURE__ */ __commonJSMin(((exports, module, this
|
|
|
272468
272978
|
} catch (error) {
|
|
272469
272979
|
logger.error(`Processing message queue failed: ${error.toString()}`);
|
|
272470
272980
|
} finally {
|
|
272471
|
-
if (result instanceof Promise) result.then(() => {
|
|
272981
|
+
if (result instanceof Promise) result.then(() => {}).catch((error) => {
|
|
272982
|
+
logger.error(`Processing message queue failed: ${error.toString()}`);
|
|
272983
|
+
}).finally(() => {
|
|
272472
272984
|
inFlight--;
|
|
272473
272985
|
triggerMessageQueue();
|
|
272474
|
-
}).catch((error) => {
|
|
272475
|
-
logger.error(`Processing message queue failed: ${error.toString()}`);
|
|
272476
272986
|
});
|
|
272477
272987
|
else inFlight--;
|
|
272478
272988
|
triggerMessageQueue();
|