Closed SauliusB closed 5 years ago
You can replace the first argument with a Vue object:
dotnetify.vue.component({
name: 'hello-world',
created: function() { ... }
}, 'HelloWorldVM');
Yes I saw that. Thanks. But when I try to add created
function it never connects to backend ViewModel. My guess because it overrides components inner function with this.vm = dotnetify.vue.connect("HelloWorld", this);
.
If I add this line Greetings
and ServerTime
no more exposed in state but directly inside VueComponent. And that forces me to implement data function with all properties. That breaks the idea to keep server props inside state so no need to declare them in data
function.
That component shorthand simply returns a Vue object. You can further manipulate that object to insert your own custom code.
Thanks, @dsuryd. I think this new object overrides inner one, I'd like just extend it's functionality without breaking original. Ok I will look more into this. Thanks.
I like the idea of Component shorthand which reduces verbosity a bit. But I just wonder possible ways to extend Vue object properties like
data
andcreated
functions. Because currently using them will broke component. Is it possible to usethis.super()
or are there other ways? Thanks.