-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
Can't render a Control Template. Rete enviroment with WebPack #256
Comments
You need to update vue-render-plugin to latest version, because you have latest version of vue in your dependencies. For some reason vue@2.6.6 not compatible with version of vue that used by the render plugin (in previous versions) |
Thank you for answer, Ni55aN, but i have updated the plugin and the problem remains =( |
Is there any logs in the console? |
there aren't any logs and errors in the console mb the reason is in the WebPack vue-loader that can't recognize that vue template? |
vue-loader processes only a single file components. Rather, you should have received the warning #249 (comment) But using vue-loader (with *.vue file) is more more preferred way |
Thank you for answer, Ni55aN it helps me! I have solved the problem with the single file components:
<template>
<input type="number" :readonly="readonly" :value="value" @input="change($event)" @dblclick.stop="" @pointermove.stop=""/>
</template>
<script>
export default {
props: ['readonly', 'emitter', 'ikey', 'getData', 'putData'],
data() {
return {
value: 0,
}
},
methods: {
change(e){
this.value = +e.target.value;
this.update();
},
update() {
if (this.ikey)
this.putData(this.ikey, this.value);
this.emitter.trigger('process');
}
},
mounted() {
this.value = this.getData(this.ikey);
}
}
</script>
<style scoped>
</style>
import VueNumControlSingle from '../components/VueNumControlSingle.vue';
class NumControl extends Rete.Control {
constructor(emitter, key, readonly) {
super(key);
this.component = VueNumControlSingle; //instead of VueNumControl
this.props = { emitter, ikey: key, readonly };
}
setValue(val) {
this.vueContext.value = val;
}
} All of code is here: https://github.com/limuyao/rete_env |
Hi to all! The problem is on the picture (Rete can't render a Control template. There are not any
<input>
elements in the Number Nodes and in the Add Node)I am using the code from the very first sample https://codepen.io/Ni55aN/pen/xzgQYq and a WebPack enviroment (configs and a full code below).
Btw, when i try to add
console.log(this)
for constructor of theNumControl
i can see that"$el"
of_vue
is<!-- function(n,e,r,o){return ue(t,n,e,r,o,!0)} -->
.But it should be a vue object with a template
<input type="number"...
What's wrong with me? And who can help me to solve the problem?
All of code here: https://github.com/limuyao/rete_env
WebPack config:
The text was updated successfully, but these errors were encountered: