วิดเจ็ตเอกสารประกอบแอป
8 นาที
เอกสารตามบริบทจะถูกฝังอยู่ในผลิตภัณฑ์ของคุณตรงจุดที่ผู้ใช้ต้องการมากที่สุด วิดเจ็ตเอกสารตามบริบทช่วยให้ผู้ใช้สามารถอ่านคู่มือได้โดยไม่ต้องเปิดพอร์ทัลคู่มือผู้ใช้ในหน้าต่างอื่น คุณสามารถโหลดบทความเฉพาะหรือโหลดทั้งพอร์ทัลคู่มือผู้ใช้ ซึ่งเป็นสิ่งจำเป็นสำหรับบริษัทที่ต้องการเพิ่มการใช้งานและการคงอยู่ของผลิตภัณฑ์ สิ่งที่คุณต้องทำคือฝังโค้ด html ที่สร้างภายใต้ การตั้งค่า space > การผสานรวมวิดเจ็ต วิธีการทำงานของวิดเจ็ต ชมวิดีโอด้านล่างที่แสดงการทำงานของวิดเจ็ต วิธีการติดตั้งวิดเจ็ต เพื่อผสานรวมวิดเจ็ต โปรดทำตามขั้นตอนเหล่านี้ เลือก space ของคุณภายในตัวแก้ไข คลิกไอคอนรูปเฟือง (⚙️) เพื่อเข้าสู่ การตั้งค่า ไปที่ การเชื่อมต่อวิดเจ็ต คลิกปุ่มคัดลอก และวางโค้ดลงใน index html ของคุณ หรือในโค้ดแอปพลิเคชันของคุณ ตอนนี้ วิดเจ็ตจะจัดการทุกอย่างเองเบื้องหลัง ไม่ต้องกังวล ทุกอย่างถูกบันเดิลและย่อขนาดแล้ว ไฟล์มีขนาดเพียง 56kb และโหลดแบบอะซิงโครนัส ดังนั้นผู้ใช้ของคุณจะไม่รู้สึกถึงความแตกต่าง เหตุการณ์ init ในเหตุการณ์ init สำหรับค่า spaceid คุณสามารถใช้ spaceid หรือ published {spaceid} วิธีนี้ช่วยให้คุณใช้ spaces ได้โดยไม่ต้องเผยแพร่ และใช้งานได้โดยตรงในแอปของคุณ ใช้ preview {spaceid} เมื่อคุณต้องการเผยแพร่ space ไปยัง preview เท่านั้น และไม่เผยแพร่บนโดเมนของคุณ property type description required spaceid string pass the desired id to load your docs required jwt string pass the jwt token in order to see jwt protected docs optional shareabletoken string pass the shareabletoken from your private links to protect your docs optional widgettype 'docs' | 'search' default value is docs this opens the widget with the desired behaviour docs type will open the widget with the default behaviour, search will open a search widget bar that shows a search bar with ai support (if included in your subscription) optional hidenavbar boolean it shows or hides the top navbar from the widget modal by default the navbar is visible if you don't want to see the navbar, pass it with true value, otherwise just skip it loadingstrategy lazy | eager the default value is lazy while lazy loading delays the initialization of a resource, eager loading initializes or loads the widget as soon as the code is executed optional bubble invisible | ask the default value is invisible if set to ask it will display a bubble in the bottom right of your screen whenever someone clicks on it, the search widget will open optional bubbleplaceholder string the placeholder that will be displayed in the bubble section if not passed, a default value of ask a question will be displayed optional anchor string you can provide your class , id or path to a dom element where you would like the widget to anchor and instantiate it will anchor to the first element found in the dom, if multiple elements with the same path are present the container provided should have position relative as the widget will be displayed based on the first relative parent found e g , anchor "#my container" / anchor " container class" optional หากคุณต้องการให้บับเบิลค้นหาง่าย ๆ แสดงอยู่ในแอปของคุณตลอดเวลา ให้ใช้ bubble "ask" prop แสดงเหตุการณ์ของวิดเจ็ต show widget คือเหตุการณ์ที่เรียกให้แสดงวิดเจ็ต นอกจากนี้ยังมีคุณสมบัติ ไม่บังคับ ที่คุณสามารถส่งค่าเพื่อเปิดเอกสารเฉพาะจาก spaces ที่คุณได้ตั้งค่าไว้ คุณสมบัติ คำอธิบาย จำเป็นหรือไม่ docid ตั้งค่า doc id เพื่อเปิดเอกสารเฉพาะ หาก docid ถูกส่งค่าไป widgettype จะถูกละเว้น และระบบจะเปิดในโหมด docs โดยไม่คำนึงถึงค่าที่ส่งไป หมายเหตุ คุณต้องเติมคำว่า published ไว้ข้างหน้าค่า docid เช่น published docid หรือ preview spaceid ไม่เช่นนั้นวิดเจ็ตจะเปิดเอกสารจากโหมดแก้ไขซึ่งอาจมีการเปลี่ยนแปลงที่ยังไม่เผยแพร่ ไม่บังคับ blockid ตั้งค่า block id เพื่อเลื่อนหน้าไปยังส่วนที่ต้องการในเอกสารนั้น ไม่บังคับ เหตุการณ์ที่รองรับ นี่คือคำอธิบายโดยย่อของเรา widget event api ชื่ออีเวนต์ คำอธิบาย จำเป็น init อีเวนต์นี้ช่วยให้วิดเจ็ตของ archbee โหลดไฟล์ที่จำเป็นเข้าสู่แอปของคุณ จำเป็น show widget อีเวนต์นี้ใช้แสดงวิดเจ็ตตามที่ต้องการ จำเป็น hide widget อีเวนต์นี้ใช้ซ่อนวิดเจ็ต หากกลไกในตัวไม่เพียงพอ ไม่จำเป็น ตัวอย่างโค้ด เพิ่มฟังก์ชันในตำแหน่งที่คุณต้องการแสดงวิดเจ็ตบนไซต์ของคุณ เช่นนี้ const openabwidget = () => { window archbee push({ eventtype "show widget", // optional, only for loading a specific doc // and scroll to section // docid `published ${docid}`, // blockid "tbmm9" }); } วิดเจ็ตนี้จะโหลดพร้อมกับเอกสาร space ที่ต้องการ และผู้ใช้จะสามารถเห็นทุกอย่างได้โดยตรงจากแอปของคุณ หากคุณต้องการโหลดเอกสารเฉพาะเพียงอย่างเดียว เพียงส่ง docid `${docid}` ไปยังออบเจกต์เริ่มต้นของเราตามตัวอย่างด้านบน คุณไม่จำเป็นต้องใช้ฟังก์ชัน closewidget เพราะวิดเจ็ตจะปิดโดยอัตโนมัติเมื่อคุณกด esc หรือคลิกภายนอกวิดเจ็ต อย่างไรก็ตาม หากคุณต้องการปิดวิดเจ็ตด้วยโปรแกรมโดยไม่พึ่งพากลไกปิดที่มีมาในตัว คุณสามารถใช้ event type hide widget แบบนี้ const closeabwidgetafterseconds = (miliseconds) => { settimeout(() => { // settimeout is for demo purposes and it is not required window archbee push({eventtype "hide widget"}); }, miliseconds); } closeabwidgetafterseconds(5000);
Have a question?
Our super-smart AI, knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.