Changes between Version 23 and Version 24 of UZ


Ignore:
Timestamp:
2022.10.05 20:08:03 (2 years ago)
Author:
js29a
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UZ

    v23 v24  
    2929Described component is based on a simple state machine. It has no UI by itself so you need to provide some UI on your own. To accomplish this not only component instantation is needed but there is also need to fill its //slots//. The component has several config options from which actually only one needs to be provided (i.e. target upload URL). Other options control component behavior but they will be explained later. After providing target upload URL there is need to fill component slots by your own UI. Here I will describe generic browser UI only. If you are familiar with e.g. Quasar you can implement the UI on your own.
    3030
     31In case of doubt please refer to source:/uz/src/UploadTest.vue file. It's complex because it demonstrates all the features. You'll probably use only some of them. Feel free to experiment.
     32
    3133== Basic component usage
    3234
     
    4547
    4648As you see nothing will appear in browser. Why? You need to provide some UI. To remain generic the component has no UI by itself. This allows it to be extremely flexible. You need to use //slots// and provide some CSS styles. To remain concise this step is demonstrated in the repository (source:/uz/src/UploadTest.vue). After creating the UI and navigating to proper URL you should see the uploader.
     49
     50In general there are two control options - using slots or to mix slots with control outside of the component. File source:/uz/src/UploadTest.vue demonstrates both of them.
    4751
    4852== Component properties
     
    97101== Exposed items
    98102
    99 ||= item =||= purpose =||= kind =||
     103||= item =||= purpose =||||= kind =||
    100104|| pick || launches standard file picker || callback || no args ||
    101105|| reset || resets to //idle// state || callback || no args ||
    102106|| start || begin files upload || callback || no args ||
    103107|| abort || abort pending files upload || callback || no args ||
    104 || can_pick || is file picking allowed? || computed property || boolean ||
    105 || can_start || is upload start allowed? || computed property || boolean ||
    106 || can_abort || is upload abort allowed? || computed property || boolean ||
    107 || can_reset || is component reset allowed? || computed property || boolean ||
     108|| can_pick || is file picking allowed? || computed || boolean ||
     109|| can_start || is upload start allowed? || computed || boolean ||
     110|| can_abort || is upload abort allowed? || computed || boolean ||
     111|| can_reset || is component reset allowed? || computed || boolean ||
    108112
    109113== Emitted events