Skip to content

Commit 65b314f

Browse files
author
F-loat
committed
update: 添加 style 三目测试用例
1 parent 4dedf73 commit 65b314f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/mp/compiler/index.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ describe('指令', () => {
220220
`<template name="a"><view class="_div" style=" {{('color:' + activeColor + ';' + 'font-size:' + (fontSize + 'px') + ';')}}">111</view></template>`,
221221
{ name: 'a' }
222222
)
223+
assertCodegen(
224+
`<div v-bind:style="{ color: a === b ? activeColor : color, fontSize: fontSize + 'px' }">111</div>`,
225+
`<template name="a"><view class="_div" style=" {{( 'color:' + (a === b ? activeColor : color) + ';' + 'font-size:' + (fontSize + 'px') + ';')}}">111</view></template>`,
226+
{ name: 'a' }
227+
)
223228
assertCodegen(
224229
`<div v-bind:style="[{ color: activeColor, fontSize: fontSize + 'px' }]">111</div>`,
225230
`<template name="a"><view class="_div" style=" {{['color:' + activeColor + ';' + 'font-size:' + (fontSize + 'px') + ';']}}">111</view></template>`,

0 commit comments

Comments
 (0)