vue3-virtual-scroll-list icon indicating copy to clipboard operation
vue3-virtual-scroll-list copied to clipboard

Vue received a Component which was made a reactive object.

Open MrThanlon opened this issue 3 years ago • 2 comments

[Vue warn]: Vue received a Component which was made a reactive object. This can lead to unnecessary performance overhead, and should be avoided by marking the component with markRaw or using shallowRef instead of ref. Component that was made reactive: {name: "MessageItem", props: {…}, __file: "src/components/MessageItem.vue", __hmrId: "681364ba", render: ƒ} at <VirtualListItem index=0 tag="div" event="itemResize" ... > at <VirtualList style= {overflow-y: "scroll"} data-sources= [{…}] data-key="id" ... > at <Message class="h-50" onSend=fn onDataFunction=fn ... > at <App>

MrThanlon avatar Mar 06 '22 15:03 MrThanlon

[Vue warn]: Vue received a Component which was made a reactive object. This can lead to unnecessary performance overhead, and should be avoided by marking the component with markRaw or using shallowRef instead of ref. Component that was made reactive: {name: "MessageItem", props: {…}, __file: "src/components/MessageItem.vue", __hmrId: "681364ba", render: ƒ} at <VirtualListItem index=0 tag="div" event="itemResize" ... > at <VirtualList style= {overflow-y: "scroll"} data-sources= [{…}] data-key="id" ... > at <Message class="h-50" onSend=fn onDataFunction=fn ... > at

try this solution: https://jskoa.com/?p=8666 use the Item component in setup() instead of in data(). It works for me. Be Like this:

`import { Search } from '@element-plus/icons'

data(){ return{ Search } },`

=>

` import { Search } from '@element-plus/icons'

setup(props, context){

return { Search //这return同样在模板中能显示 }

}, `

chiangming avatar Mar 18 '22 06:03 chiangming

Hello my friends !!

I will show you how to do with Options API 👍

-You have to import Search icon from '@element-plus/icons-vue' -You have to import shallowRef from 'vue' -You have to add your icon name Search in the components -You have to add your icon name Search in the Data as you see and the error massage will not show again 👍

If this helped you please give me 👍 for everyone see the solution. Byee !

mahomk2 avatar Mar 31 '22 12:03 mahomk2