\r\n \u003C/button>\r\n \u003C/label>\r\n\u003C/template>\r\n```\r\n\r\nBuild output:\r\n```js\r\nimport { defineComponent, ref, openBlock, createElementBlock, createTextVNode, toDisplayString, createElementVNode, mergeProps, renderSlot } from \"vue\";\r\nconst _sfc_main = /* @__PURE__ */ defineComponent({\r\n props: {\r\n label: {\r\n type: String,\r\n default: \"\"\r\n }\r\n },\r\n setup(__props) {\r\n const counter = ref(0);\r\n return (_ctx, _cache) => {\r\n return openBlock(), createElementBlock(\"label\", null, [\r\n createTextVNode(toDisplayString(__props.label) + \" \" + toDisplayString(counter.value) + \" \", 1),\r\n createElementVNode(\"button\", mergeProps(_ctx.$attrs, {\r\n onClick: _cache[0] || (_cache[0] = ($event) => counter.value++)\r\n }), [\r\n renderSlot(_ctx.$slots, \"default\")\r\n ], 16)\r\n ]);\r\n };\r\n }\r\n});\r\nexport { _sfc_main as BaseButton };\r\n```\r\n\r\nIn Vue 2 I run into `Uncaught TypeError: Object(...) is not a function` error with `defineComponent()`. I suppose it should be importing from \"vue-demi\" instead of \"vue\"?\r\n\r\nPackage.json\r\n```json\r\n\"dependencies\": {\r\n \"vue-demi\": \"^0.12.4\"\r\n },\r\n \"devDependencies\": {\r\n \"@types/node\": \"^17.0.21\",\r\n \"@vitejs/plugin-vue\": \"^2.2.0\",\r\n \"@vue/composition-api\": \"^1.4.9\",\r\n \"typescript\": \"^4.5.4\",\r\n \"vite\": \"^2.8.0\",\r\n \"vue\": \"^3.2.25\",\r\n \"vue-tsc\": \"^0.29.8\"\r\n },\r\n \"peerDependencies\": {\r\n \"@vue/composition-api\": \"^1.0.0-rc.1\",\r\n \"vue\": \"^2.0.0 || >=3.0.0\"\r\n },\r\n \"peerDependenciesMeta\": {\r\n \"@vue/composition-api\": {\r\n \"optional\": true\r\n }\r\n },\r\n```\r\n\r\nvite.config.ts\r\n```ts\r\nexport default defineConfig({\r\n plugins: [vue()],\r\n build: {\r\n lib: {\r\n entry: path.resolve(__dirname, \"src/lib.ts\"),\r\n name: \"myLib\",\r\n fileName: (format) => `lib.${format}.js`,\r\n },\r\n rollupOptions: {\r\n // make sure to externalize deps that shouldn't be bundled\r\n // into your library\r\n external: [\"vue\"],\r\n output: {\r\n // Provide global variables to use in the UMD build\r\n // for externalized deps\r\n globals: {\r\n vue: \"Vue\",\r\n },\r\n },\r\n },\r\n },\r\n optimizeDeps: {\r\n exclude: [\"vue-demi\"],\r\n },\r\n});\r\n```",[],145,"closed","Not running on Vue 2 App","2022-09-04T15:48:05Z","https://github.com/vueuse/vue-demi/issues/145",0.6474841,{"description":3199,"labels":3200,"number":3201,"owner":3138,"repository":3138,"state":3193,"title":3202,"updated_at":3203,"url":3204,"score":3205},"Please am using VUE3 with typescript.\r\nAnd as standard the `tsconfig.json` file has an src directory import denoted as @.\r\n```JSON\r\n{\r\n \"compilerOptions\": {\r\n ...\r\n \"paths\": {\r\n \"@/*\": [\r\n \"src/*\"\r\n ]\r\n },\r\n }\r\n}\r\n```\r\n\r\nAnd the import for This vueuse is.\r\n`import { usePackage} from '@vueuse/\u003Cpackage>'`\r\nBut doing so. Would give error.\r\n**Module not found: Error: Can't resolve '@vueuse/\\\u003Cpackage\\>' in 'VUE\\project\\src'**\r\n\r\nI believe it's a conflict due to the **@** symbol and the name of the module.\r\n\r\nPlease is there a fix on how to import this library on typescript Vue3? Thanks 🙏",[],646,"@ Symbol conflicts the Typescript src import","2021-07-26T19:12:48Z","https://github.com/vueuse/vueuse/issues/646",0.6570014,{"description":3207,"labels":3208,"number":19,"owner":3138,"repository":3139,"state":3193,"title":3209,"updated_at":3210,"url":3211,"score":3212},"## Summary\r\n\r\nI tried using `vue-demi-switch 2 vue2` and defining `\"vue2\": \"npm:vue@2\"` in my package.json, but when I run tests, the `@vue/composition-api` breaks, because it imports Vue as `var Vue = require('vue');`\r\n\r\nDo you have any advice on how to proceed with this? I saw `vueuse/core` uses this approach but I couldnt see if you have a fix for this.\r\n\r\nYou can see this in https://github.com/vuelidate/vuelidate/tree/next",[],"Switching between Vue 2 and Vue 3 to run tests with Composition API","2022-07-06T17:23:19Z","https://github.com/vueuse/vue-demi/issues/38",0.66259646,{"description":3214,"labels":3215,"number":3216,"owner":3138,"repository":3139,"state":3193,"title":3217,"updated_at":3218,"url":3219,"score":3220},"Not exactly an issue with the library but hoping you may be able to help.\r\n\r\nAfter installing `@vueuse/core`, when VSCode + typescript shows intellisense and automatically adds imports (for example for `ref` or `computed`), it is now importing from vue-demi rather than from vue. This would make sense if I was developing a tool/library meant to be used with vue2 and vue3, but I am working on a strictly vue3 project and I'd like things to be imported from vue directly.\r\n\r\nAny guidance on how I can tell VSCode to prefer vue instead of vue-demi?",[],57,"stop VSCode + Typescript importing vue-demi","2021-07-15T17:20:52Z","https://github.com/vueuse/vue-demi/issues/57",0.66576445,["Reactive",3222],{},["Set"],["ShallowReactive",3225],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fi58FarW-zKEF4_QWWJteo1iayalq-_5_fT4rXV92aqM":-1},"/vueuse/vue-demi/102"]