unplugin-vue-components icon indicating copy to clipboard operation
unplugin-vue-components copied to clipboard

feat: use runtime functional options

Open waset opened this issue 1 year ago • 4 comments

Description

目前 vue 官方 和 volar 插件具体进度冲突,我们不能急于抛弃 @vue/runtime-core 运行时。

因急于使用,目前已上传至 npmjs @waset/unplugin-vue-components,如过对本库造成影响可以联系我,我会进行删除

Linked Issues

#389 #406 #477

Additional context

目前好像只有这个办法是比较直接能解决问题的,不影响已经抛弃 @vue/runtime-core 的用户,只需要启用运行时选项 runtime,它会在vue命名空间基础上再生成一遍@vue/runtime-core命名空间,能让类型提示正常。

// vite.config.ts
import Components from 'unplugin-vue-components/vite'

export default defineConfig({
  plugins: [
    Components({ 
      /* options */ 
      runtime: true,
    }),
  ],
})

waset avatar Sep 03 '24 08:09 waset

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

现在版本没有这个属性?

chenchenpp avatar Sep 19 '24 05:09 chenchenpp

现在版本没有这个属性?

没有,现在 @vuejs 官方 runtime-core 包过度过的开发很难受

waset avatar Sep 19 '24 05:09 waset

现在版本没有这个属性?

没有,现在 @vuejs 官方 runtime-core 包过度过的开发很难受

确实,之前volar版本还支持,换成official这个就失效了。我还以为是我配置有什么问题呢

chenchenpp avatar Sep 19 '24 06:09 chenchenpp