[Vue.js] ใส่ script tag ใน template

   ในบางสถานการณ์ที่เราต้องการจะใส่ tag script (หรือ tag อื่น ๆ ที่อยากจะ escape ไม่ให้ Vue.js render) ภายใต้ template ของ Vue.js โดยเฉพาะเวลาทำงานกับ Payment gateway มักจะต้องใส่ script เพิ่มเข้ามา

[Vue.js] ใส่ script tag ใน template


<component
is="script"
src="https://www.example.com/script.js"
></component>

ให้ใช้ฟีเจอร์ Dynamic Components เข้ามาช่วย ใส่ script เข้าไปใน attribute is ได้เลย

ความคิดเห็น

โพสต์ยอดนิยมจากบล็อกนี้

[Blue Archive] รีวิวชินัตสึ (Chinatsu)

[Blue Archive] รีวิวมารินะ (Marina)

[Blue Archive] รวมล็อบบี้ความทรงจำ (Live2D)

[Blue Archive] รีวิวยูกะชุดพละ (Yuuka Gym)

[Blue Archive] รีวิวโฮชิโนะ (Hoshino)