Skip to content

Instantly share code, notes, and snippets.

@pxwee5
pxwee5 / index.html
Created May 14, 2019 10:54
Static Vue SFC
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hello World</title>
<script type="module" src="./js/app.js"></script>
</head>
<body>
<h1>Static HTML With Vue.js Single File Component</h1>
@pxwee5
pxwee5 / app.js
Last active May 15, 2019 10:25
Static Vue SFC
import Vue from '/web_modules/vue/dist/vue.esm.browser.js'
import httpVueLoader from '/web_modules/http-vue-loader/src/httpVueLoader.js'
const App = new Vue({
el: '#app',
components: {
'app-world': httpVueLoader('/js/components/AppWorld.vue')
},
})
@pxwee5
pxwee5 / AppWorld.vue
Last active December 18, 2020 05:59
Static Vue SFC
<template>
<span>World</span>
</template>
<script>
module.exports = {
mounted () {
console.log('Hello World')
}
}
@pxwee5
pxwee5 / app.js
Last active May 13, 2019 10:59
Static Vue SFC
new Vue({
el: '#app',
components: {
'app-world': httpVueLoader('/js/components/AppWorld.vue')
}
});
@pxwee5
pxwee5 / index.html
Last active December 18, 2020 05:58
Static Vue SFC
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hello World</title>
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/http-vue-loader"></script>
</head>
<body>
<h1>Static HTML With Vue.js Single File Component</h1>
@pxwee5
pxwee5 / WindowInstanceMap.js
Last active February 18, 2019 19:54
WindowInstanceMap
import Vue from 'vue'
const WindowInstanceMap = new Vue({
data() {
return {
scrollY: 0
}
},
created() {
window.addEventListener('scroll', e => {