forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMutation.json
More file actions
126 lines (107 loc) · 4.14 KB
/
Mutation.json
File metadata and controls
126 lines (107 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{
"meta": {
"docsUrl": "https://v1.quasar.dev/vue-directives/mutation"
},
"addedIn": "v1.3.0",
"value": {
"type": [ "Function" ],
"desc": "Function to call when mutation occurs; It is HIGHLY recommended to reference it from your vue component scope, otherwise the directive update cycle will continuously recreate the observer which hits performance hard",
"examples": [
"v-intersection=\"myHandler\""
],
"returns": {
"type": "Boolean",
"desc": "If you return Boolean false from the handler, the observer stops"
},
"params": {
"mutationList": {
"type": "Array",
"desc": "Array of MutationRecord items",
"definition": {
"type": {
"type": "String",
"desc": "Type of mutation",
"values": [ "childList", "attributes", "characterData" ]
},
"target": {
"type": "Object",
"desc": "The DOM element that the mutation affected, depending on the mutation type",
"__exemption": [ "examples" ]
},
"addedNodes": {
"type": "Array",
"desc": "The NodeList of the nodes that have been added",
"__exemption": [ "examples" ]
},
"removedNodes": {
"type": "Array",
"desc": "The NodeList of the nodes that have been removed",
"__exemption": [ "examples" ]
},
"previousSibling": {
"type": "Object",
"desc": "The previous sibling of the added or removed nodes, or null",
"__exemption": [ "examples" ]
},
"nextSibling": {
"type": "Object",
"desc": "The next sibling of the added or removed nodes, or null",
"__exemption": [ "examples" ]
},
"attributeName": {
"type": "String",
"desc": "The local name of the changed attribute, or null",
"examples": [ "some-attribute" ]
},
"attributeNamespace": {
"type": "String",
"desc": "The namespace of the changed attribute, or null",
"__exemption": [ "examples" ]
},
"oldValue": {
"type": "String",
"desc": "Value depends on the mutation type; For attributes, it is the value of the changed attribute before the change; For characterData it is data of the changed node before the change; For childList it is null; Note that for this to work as expected, attributeOldValue or characterDataOldValue must be set",
"__exemption": [ "examples" ]
}
}
}
}
},
"modifiers": {
"once": {
"type": "Boolean",
"desc": "Call handler only once, when the first mutation was triggered, then stop monitoring",
"examples": [ "v-mutation.once" ]
},
"childList": {
"type": "Boolean",
"desc": "Monitor the target node (and, if 'subtree' is also set, its descendants) for the addition of new child nodes or removal of existing child nodes",
"examples": [ "v-mutation.childList" ]
},
"subtree": {
"type": "Boolean",
"desc": "Extend monitoring to the entire subtree of nodes rooted at target",
"examples": [ "v-mutation.subtree" ]
},
"attributes": {
"type": "Boolean",
"desc": "Watch for changes to the value of attributes on the node or nodes being monitored",
"examples": [ "v-mutation.attributes" ]
},
"characterData": {
"type": "Boolean",
"desc": "Monitor the specified target node or subtree for changes to the character data contained within the node or nodes",
"examples": [ "v-mutation.characterData" ]
},
"attributeOldValue": {
"type": "Boolean",
"desc": "Record the previous value of any attribute that changes when monitoring the node or nodes for attribute changes",
"examples": [ "v-mutation.attributeOldValue" ]
},
"characterDataOldValue": {
"type": "Boolean",
"desc": "Record the previous value of a node's text whenever the text changes on nodes being monitored",
"examples": [ "v-mutation.characterDataOldValue" ]
}
}
}