Description
What rule do you want to change?
vue/component-api-style
Does this change cause the rule to produce more or fewer warnings?
Fewer warnings
How will the change be implemented? (New option, new default behavior, etc.)?
New option composition-vue2
Please provide some example code that this change will affect:
const MyComponent = Vue.extend({
render(h) {
return h('div');
},
});
What does the rule currently do for this code?
With configuration "vue/component-api-style": ["error", ["composition"]]
, it warns about using the render function:
Options API is not allowed in your project.
render
function is the API of Options API. Use Composition API instead.
What will the rule do after it's changed?
With configuration "vue/component-api-style": ["error", ["composition-vue2"]]
, it won't warn about using the render function, but still about using computed
, methods
, etc.
Additional context
Render functions cannot be replaced by returning h(…)
from setup
in Vue 2 with the Composition API plugin: https://github.com/vuejs/composition-api#template-refs