Vue js 作为另一个站点上的小部件 [英] Vue js as a widget on another site
问题描述
我想知道是否可以构建一个可以嵌入到另一个站点的 vuejs 组件.问题是该组件会在网站上多次出现,因此我无法访问根元素.我知道一种在 React 中执行此操作的方法,但我更愿意在 Vue 中执行此操作.
I was wondering if it was possible to build a vuejs component that could be embedded into another site. The thing is the component would show up several times on the website so I wouldn't have access to a root element. I know a way to do this in react but I'd rather do it in Vue.
推荐答案
我知道,我没有按你的意愿回答你的问题(在另一个站点使用 vue 组件).
I know,i am not answering your question as you want (using vue component in another site).
如果您创建一个组件并在 Angular、React、Vue 等框架中使用它,那就太完美了.您可以使用 模板.js
It would be perfect if you create a component and use it in frameworks like Angular,React,Vue etc.You can do it with Stencil.js
点击此处,您会看到关于它的精彩教程.
By clicking here you see an awesome tutorial about it.
这篇关于Vue js 作为另一个站点上的小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!