Files
directus/app/src/composables/use-field-tree
Rijk van Zanten 0d899f097d Add ability to specify what fields to clone on "Save as Copy" (#6379)
* Start on tree-select component

* Stop propagation on label click as well

* Setup temp debug route

* Add value-combining=all

* Add branch mode

* Add leaf mode

* Add indeterminate state

* Add search

* Keep group state alive during search

* Fetch existing item based on clone fields data

* Add interface for setup

* Tweak field structure of m2a items

* Use collection name in checkbox

* Remove temp test
2021-06-18 16:37:27 -04:00
..
2020-09-24 16:38:47 -04:00
2021-06-08 15:59:55 -04:00

useFieldTree

Generate out a field tree based on the given collection.

type FieldTree = {
	field: string;
	name: string;
	children?: FieldTree[];
};

useFieldTree(collection: Ref<string>): { tree: FieldTree }

Usage

const collection = ref('articles');

const { tree } = useFieldTree(collection);