From e12119b634866d03db4a92618b03321905ee45f0 Mon Sep 17 00:00:00 2001 From: abdennour Date: Fri, 7 Apr 2017 00:02:21 +0300 Subject: [PATCH] =?UTF-8?q?DEMO=20=F0=9F=94=AC=20for=20CSVDownload?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sample-site/csvdownload.example.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/sample-site/csvdownload.example.md b/sample-site/csvdownload.example.md index e4f2001..c249e0f 100644 --- a/sample-site/csvdownload.example.md +++ b/sample-site/csvdownload.example.md @@ -8,8 +8,24 @@ const data = [ ]; ``` -## Note: -> We avoid to make live examples for `CSVDownload` component, since mounting -> this component triggers the download directly. -> Please, check the next component since you can test it directly. +Another example of `CSVDownload` + +```example +const headers = ['firstname', 'lastname', 'email'] ; +const data = [ + ['Ahmed', 'Tomi' , 'ah@smthing.co.com'] , + ['Raed', 'Labes' , 'rl@smthing.co.com'] , + ['Yezzi','Min l3b', 'ymin@cocococo.com'] +]; +const iWantToDownload = false; // <--- double click on "false", and change it to "true" +if (iWantToDownload) { + +} else { +
Click on "Show Code" below right, and try to change the value of "iWantToDownload" from "false" to true , then, a new window will be opened to trigger the download of CSV file
+} + +``` + +## Note: +> This component triggers the download directly once it is mounted, So , be careful to choose the suitable time to mount it.