File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed
packages/compiler-vapor/__tests__/transforms Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -471,6 +471,17 @@ export function render(_ctx) {
471471} "
472472` ;
473473
474+ exports [` compiler v-bind > .prop modifier w/ dynamic arg + prefixIdentifiers 1` ] = `
475+ "import { setDynamicProps as _setDynamicProps , renderEffect as _renderEffect , template as _template } from 'vue';
476+ const t0 = _template("<div ></div >", true)
477+
478+ export function render(_ctx) {
479+ const n0 = t0 ()
480+ _renderEffect (() => _setDynamicProps (n0 , [{ [" ." + _ctx .foo (_ctx .bar )]: _ctx .id }]))
481+ return n0
482+ } "
483+ ` ;
484+
474485exports [` compiler v-bind > .prop modifier w/ dynamic arg 1` ] = `
475486"import { setDynamicProps as _setDynamicProps , renderEffect as _renderEffect , template as _template } from 'vue';
476487const t0 = _template("<div ></div >", true)
Original file line number Diff line number Diff line change @@ -455,7 +455,34 @@ describe('compiler v-bind', () => {
455455 )
456456 } )
457457
458- test . todo ( '.prop modifier w/ dynamic arg + prefixIdentifiers' )
458+ test ( '.prop modifier w/ dynamic arg + prefixIdentifiers' , ( ) => {
459+ const { ir, code } = compileWithVBind (
460+ `<div v-bind:[foo(bar)].prop="id"/>` ,
461+ { prefixIdentifiers : true } ,
462+ )
463+ expect ( code ) . matchSnapshot ( )
464+ expect ( ir . block . effect [ 0 ] . operations [ 0 ] ) . toMatchObject ( {
465+ type : IRNodeTypes . SET_DYNAMIC_PROPS ,
466+ props : [
467+ [
468+ {
469+ key : {
470+ content : `foo(bar)` ,
471+ isStatic : false ,
472+ } ,
473+ values : [
474+ {
475+ content : `id` ,
476+ isStatic : false ,
477+ } ,
478+ ] ,
479+ runtimeCamelize : false ,
480+ modifier : '.' ,
481+ } ,
482+ ] ,
483+ ] ,
484+ } )
485+ } )
459486
460487 test ( '.prop modifier (shorthand)' , ( ) => {
461488 const { ir, code } = compileWithVBind ( `<div .fooBar="id"/>` )
You can’t perform that action at this time.
0 commit comments