diff --git a/.babelrc b/.babelrc index 9f1cf787f..4d755394a 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,5 @@ { "presets": ["env", "stage-2", "flow-vue"], - "plugins": ["transform-decorators-legacy"], + "plugins": ["transform-decorators-legacy", "transform-vue-jsx"], "comments": false } diff --git a/docs/api/options.md b/docs/api/options.md index 1707e78fb..c2c3b5148 100644 --- a/docs/api/options.md +++ b/docs/api/options.md @@ -69,30 +69,52 @@ expect(wrapper.find('div')).toBe(true) ## scopedSlots -- type: `{ [name: string]: string }` +- type: `{ [name: string]: string|Function }` -Provide an object of scoped slots contents to the component. The key corresponds to the slot name. The value can be a template string. +Provide an object of scoped slots to the component. The key corresponds to the slot name. -There are three limitations. +You can set the name of the props using the slot-scope attribute: -* This option is only supported in vue@2.5+. +```js +shallowMount(Component, { + scopedSlots: { + foo: '

{{foo.index}},{{foo.text}}

' + } +}) +``` -* You can not use `