@@ -5,7 +5,7 @@ import type * as ts from 'typescript';
5
5
import type { Sfc , SfcBlock , SfcBlockAttr , VueLanguagePluginReturn } from '../types' ;
6
6
import { parseCssClassNames } from '../utils/parseCssClassNames' ;
7
7
import { parseCssVars } from '../utils/parseCssVars' ;
8
- import { computedArray } from '../utils/signals' ;
8
+ import { computedArray , computedItems } from '../utils/signals' ;
9
9
10
10
export function computedSfc (
11
11
ts : typeof import ( 'typescript' ) ,
@@ -116,8 +116,14 @@ export function computedSfc(
116
116
const base = computedSfcBlock ( 'style_' + i , 'css' , getBlock ) ;
117
117
const getModule = computedAttrValue ( '__module' , base , getBlock ) ;
118
118
const getScoped = computed ( ( ) => ! ! getBlock ( ) . scoped ) ;
119
- const getCssVars = computed ( ( ) => [ ...parseCssVars ( base . content ) ] ) ;
120
- const getClassNames = computed ( ( ) => [ ...parseCssClassNames ( base . content ) ] ) ;
119
+ const getCssVars = computedItems (
120
+ ( ) => [ ...parseCssVars ( base . content ) ] ,
121
+ ( oldItem , newItem ) => oldItem . text === newItem . text && oldItem . offset === newItem . offset
122
+ ) ;
123
+ const getClassNames = computedItems (
124
+ ( ) => [ ...parseCssClassNames ( base . content ) ] ,
125
+ ( oldItem , newItem ) => oldItem . text === newItem . text && oldItem . offset === newItem . offset
126
+ ) ;
121
127
return ( ) => mergeObject ( base , {
122
128
get module ( ) { return getModule ( ) ; } ,
123
129
get scoped ( ) { return getScoped ( ) ; } ,
0 commit comments