Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Multi-user form editing#452

Discussion options

I have forms that several users could edit similtaniously.
PS: I use schema for building a vueform and load data there.

@adamberecz do you have any suggestions how could I implement highlighting, with user name possible, on each element that is focussed now by other user?
Other challenge is how to sync data between users, but it seems easier. I suppose to store the difference between new and old data and get the same incremental update from saving response, then update only dirty elements one by one.

Might you have other suggestions or improvments?
Any other comunity thoughts are wellcome!
Tanks!

You must be logged in to vote

For one,here's how you can track the selected element:

<scriptsetup>import{ref,onMounted,watch,computed}from'vue';constbuilder$=ref();constselectedElement=computed(()=>{returnbuilder$.value?.selectedElement;});watch(selectedElement,alert);</script><template><divid="app"class="h-screen"><VueformBuilderref="builder$"/></div></template>

I am trying to think of ways you can reliably add class + DOM to an element's layout externally, but I couldn't so far. Overriding theElementLayout's template for different element types is how the builder adds those remove/clone/etc actions, name tag and so on and that would be the most straightforward way. …

Replies: 1 comment 4 replies

Comment options

For one,here's how you can track the selected element:

<scriptsetup>import{ref,onMounted,watch,computed}from'vue';constbuilder$=ref();constselectedElement=computed(()=>{returnbuilder$.value?.selectedElement;});watch(selectedElement,alert);</script><template><divid="app"class="h-screen"><VueformBuilderref="builder$"/></div></template>

I am trying to think of ways you can reliably add class + DOM to an element's layout externally, but I couldn't so far. Overriding theElementLayout's template for different element types is how the builder adds those remove/clone/etc actions, name tag and so on and that would be the most straightforward way. Without source code access I'm not sure if this is possible.

Syncing can probably be managed, but I would expect pitfalls along the way. The builder was not made with live collaboration capabilities in mind, so probably tweaking the source would be needed in multiple places.

I am moving this to builder repo, because it's more related to that.

You must be logged in to vote
4 replies
@dan-dazlab
Comment options

Thanks@adamberecz, for rapidly answer.

One thing: I needVueform, not builder, for this.
I suppose that they work the same, but if you have time, please confirm.

@adamberecz
Comment options

Ahh, now that I read it again I can see the builder isn't mentioned (just assumed for some reason). Moving it back.

Yes, I can confirm that having a customElementLayout template could be the right approach.

@dan-dazlab
Comment options

@adamberecz How could I inject a custom ElementLayout template to all elements? WIth a plugin?

How plugins slow down the VueForm?
Should I create a one plugin for all elements and put necessary features there or it's ok to create a plugin per feature?

@adamberecz
Comment options

You create aplugin to add business logic to components like props & methods. You canreplace theElementLayout template globally which is used by each element. Your version could use eg. an extra element property (accessible viael$.xxx in the layout, defined via a plugin for/^[a-zA-Z]+Element$/) to display an 'editing by XY' tag or border. It should not slow down anything. I would create a PoC first in a single plugin and decide about refactor if needed afterwards.

Answer selected bydan-dazlab
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Questions
Labels
None yet
2 participants
@dan-dazlab@adamberecz

[8]ページ先頭

©2009-2025 Movatter.jp