ด้วยความผมที่ผมมีโปรเจคนึง ที่อยากจะเอา Vue.js มาใช้ แล้วผมไม่อยากจะ install พวก node package ต่างๆ ก็เลยมาเป็นท่า CDN สำหรับใครที่อยากใช้ Vue.js แบบ CDN เหมือนกัน ก็ก๊อป code ด้านล่างไปได้เลย 😊
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Quick Vue.js</title>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
<div id="app">{{ message }}</div>
<script>
const { createApp, ref } = Vue;
createApp({
setup() {
const message = ref("Hello vue!");
return {
message,
};
},
}).mount("#app");
</script>
</body>
</html>