New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I generate a component in the following way? #9
Comments
I got a string like this from the server and then dynamically created the component. |
嗨~ 你是国内的啊! |
现在的需求是我要从服务器获取一段vue的脚本(在web环境下我可以用Vue.component方法生成组件),在rn环境下使用你的Vue.component是没办法生成组件的,请问有什么好的解决办法? |
不支持动态执行 |
没有办法把js中的模版代码加到页面中的 |
你跑的是 react 环境,如果想要动态执行的话,用 react 的动态方案,react-vue 默认只会编译 .vue 文件,.js 和 .jsx 里面可以写 react,相互引入没问题的。 |
谢了,我试一下。 |
不可以这样写吗? |
react 组件和 vue 组件分开写,看看这个 demo 是怎么引入的 https://github.com/SmallComfort/react-vue-demo/blob/master/src/VueDemo/Counter.vue |
想了想好像没办法执行。。因为从服务器拿到的是vue的语法,生成react的组件好像不太现实 |
How can I generate a component in the following way?
var MyComponent = Vue.extend({ template: '<text>This is a component</text>' }); Vue.component('my-component', MyComponent);
The text was updated successfully, but these errors were encountered: