@@ -42,14 +42,18 @@ var singletonElement = null
42
42
var singletonCounter = 0
43
43
var isProduction = false
44
44
var noop = function ( ) { }
45
+ var options = null
46
+ var ssrIdKey = 'data-vue-ssr-id'
45
47
46
48
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
47
49
// tags it will allow on a page
48
50
var isOldIE = typeof navigator !== 'undefined' && / m s i e [ 6 - 9 ] \b / . test ( navigator . userAgent . toLowerCase ( ) )
49
51
50
- module . exports = function ( parentId , list , _isProduction ) {
52
+ module . exports = function ( parentId , list , _isProduction , _options ) {
51
53
isProduction = _isProduction
52
54
55
+ options = _options || { }
56
+
53
57
var styles = listToStyles ( parentId , list )
54
58
addStylesToDom ( styles )
55
59
@@ -113,7 +117,7 @@ function createStyleElement () {
113
117
114
118
function addStyle ( obj /* StyleObjectPart */ ) {
115
119
var update , remove
116
- var styleElement = document . querySelector ( 'style[data-vue-ssr-id ~="' + obj . id + '"]' )
120
+ var styleElement = document . querySelector ( 'style[' + ssrIdKey + ' ~="' + obj . id + '"]' )
117
121
118
122
if ( styleElement ) {
119
123
if ( isProduction ) {
@@ -195,6 +199,9 @@ function applyToTag (styleElement, obj) {
195
199
if ( media ) {
196
200
styleElement . setAttribute ( 'media' , media )
197
201
}
202
+ if ( options . ssrId ) {
203
+ styleElement . setAttribute ( ssridKey , obj . id )
204
+ }
198
205
199
206
if ( sourceMap ) {
200
207
// https://developer.chrome.com/devtools/docs/javascript-debugging
0 commit comments