@@ -42,14 +42,18 @@ var singletonElement = null
4242var singletonCounter = 0
4343var isProduction = false
4444var noop = function ( ) { }
45+ var options = null
46+ var ssrIdKey = 'data-vue-ssr-id'
4547
4648// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
4749// tags it will allow on a page
4850var isOldIE = typeof navigator !== 'undefined' && / m s i e [ 6 - 9 ] \b / . test ( navigator . userAgent . toLowerCase ( ) )
4951
50- module . exports = function ( parentId , list , _isProduction ) {
52+ module . exports = function ( parentId , list , _isProduction , _options ) {
5153 isProduction = _isProduction
5254
55+ options = _options || { }
56+
5357 var styles = listToStyles ( parentId , list )
5458 addStylesToDom ( styles )
5559
@@ -113,7 +117,7 @@ function createStyleElement () {
113117
114118function addStyle ( obj /* StyleObjectPart */ ) {
115119 var update , remove
116- var styleElement = document . querySelector ( 'style[data-vue-ssr-id ~="' + obj . id + '"]' )
120+ var styleElement = document . querySelector ( 'style[' + ssrIdKey + ' ~="' + obj . id + '"]' )
117121
118122 if ( styleElement ) {
119123 if ( isProduction ) {
@@ -195,6 +199,9 @@ function applyToTag (styleElement, obj) {
195199 if ( media ) {
196200 styleElement . setAttribute ( 'media' , media )
197201 }
202+ if ( options . ssrId ) {
203+ styleElement . setAttribute ( ssridKey , obj . id )
204+ }
198205
199206 if ( sourceMap ) {
200207 // https://developer.chrome.com/devtools/docs/javascript-debugging
0 commit comments