File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ export function generate(
227
227
if ( genScopeId ) {
228
228
push ( `${ PURE_ANNOTATION } _withId(` )
229
229
}
230
- push ( `() => {` )
230
+ push ( `(_ctx, _cache ${ optimizeSources } ) => {` )
231
231
} else {
232
232
if ( genScopeId ) {
233
233
push ( `const render = ${ PURE_ANNOTATION } _withId(` )
Original file line number Diff line number Diff line change @@ -100,19 +100,17 @@ export function processExpression(
100
100
101
101
const { inline, inlinePropsIdentifier, bindingMetadata } = context
102
102
const prefix = ( raw : string ) => {
103
+ const type = hasOwn ( bindingMetadata , raw ) && bindingMetadata [ raw ]
103
104
if ( inline ) {
104
- // setup inline mode, it's either props or setup
105
- if ( bindingMetadata [ raw ] !== 'setup ') {
105
+ // setup inline mode
106
+ if ( type === 'props ') {
106
107
return `${ inlinePropsIdentifier } .${ raw } `
107
- } else {
108
+ } else if ( type === 'setup' ) {
108
109
return `${ context . helperString ( UNREF ) } (${ raw } )`
109
110
}
110
- } else {
111
- const source = hasOwn ( bindingMetadata , raw )
112
- ? `$` + bindingMetadata [ raw ]
113
- : `_ctx`
114
- return `${ source } .${ raw } `
115
111
}
112
+ // fallback to normal
113
+ return `${ type ? `$${ type } ` : `_ctx` } .${ raw } `
116
114
}
117
115
118
116
// fast path if expression is a simple identifier.
Original file line number Diff line number Diff line change @@ -685,6 +685,7 @@ export function compileScript(
685
685
if ( script ) {
686
686
if ( startOffset < scriptStartOffset ! ) {
687
687
// <script setup> before <script>
688
+ s . remove ( 0 , startOffset )
688
689
s . remove ( endOffset , scriptStartOffset ! )
689
690
s . remove ( scriptEndOffset ! , source . length )
690
691
} else {
You can’t perform that action at this time.
0 commit comments