-
Notifications
You must be signed in to change notification settings - Fork 665
Passing text to slots #233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Great, thanks 🙂 The tests failed runnning Vue 2.0.8. It must not add v as an alias. Ideally we'll have a workaround that works in Vue 2.0.8, if you can't find one we can add an error that text slot values aren't supported in Vue 2.0.x |
Thank you for reply. |
I could not find a way to solve it. There is another problem. const wrapper = mount(FooComponent, { slots: { default: 'foo {{ bar }}' }}) I want to make this a different issue. |
@@ -25,6 +26,18 @@ describe('mount.slots', () => { | |||
expect(wrapper.contains('span')).to.equal(true) | |||
}) | |||
|
|||
it('mounts component with default slot if passed string in slot object', () => { | |||
const vm = new Vue() | |||
if ('_v' in vm) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you find which Vue version supports _v and then import { vueVersion } from ~resources/test-utils.
So instead of this:
if ('_v' in vm) {
use this:
if (vueVersion > 2.2) {
That way it makes more sense from other developers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vuejs/vue@79e1058#diff-5b337525bf69cfea5590728194e8d92f
Vue.js 2.1.5 supports vue._v()
.
I will change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this.
This is related to #229.
This support only text as below.
This does not work for the text like one as below.