Skip to content

Commit a9eea7b

Browse files
piktureddyerburgh
authored andcommitted
fix: add $set scoped slot helper (#1287)
fixes #1253
1 parent a65da38 commit a9eea7b

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Diff for: packages/create-instance/create-scoped-slots.js

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ function getVueTemplateCompilerHelpers(
3636
helpers[name] = vue._renderProxy[name]
3737
})
3838
helpers.$createElement = vue._renderProxy.$createElement
39+
helpers.$set = vue._renderProxy.$set
3940
return helpers
4041
}
4142

Diff for: test/specs/mounting-options/scopedSlots.spec.js

+23
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,27 @@ describeWithShallowAndMount('scopedSlots', mountingMethod => {
305305
expect(wrapper.html()).to.contain('span')
306306
}
307307
)
308+
309+
itDoNotRunIf(
310+
vueVersion < 2.5 || mountingMethod.name !== 'mount',
311+
'resolves v-model directive',
312+
() => {
313+
const wrapper = mountingMethod(
314+
{
315+
template: '<div><slot name="single" :text="text"></slot></div>',
316+
data() {
317+
return { text: 'text' }
318+
}
319+
},
320+
{
321+
scopedSlots: {
322+
single: '<input v-model="props.text" type="text" />'
323+
}
324+
}
325+
)
326+
327+
wrapper.find('input').setValue('abc')
328+
expect(wrapper.find('input').element.value).to.equal('abc')
329+
}
330+
)
308331
})

0 commit comments

Comments
 (0)