Skip to content

Instantly share code, notes, and snippets.

@chitoku-k
Last active March 22, 2018 08:47
Show Gist options
  • Save chitoku-k/1d3fac3f5acb5988df63d893772a63ae to your computer and use it in GitHub Desktop.
Save chitoku-k/1d3fac3f5acb5988df63d893772a63ae to your computer and use it in GitHub Desktop.
<template>
<article>{{ message }}</article>
</template>
<script lang="babel">
module.exports = {
computed: {
...Vuex.mapState([
'message',
]),
},
};
</script>
<style scoped>
article {
color: #4904b3;
}
</style>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>homomaid</title>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.min.js"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.6/vue.js"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/vuex/3.0.1/vuex.min.js"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/vue-router/3.0.1/vue-router.min.js"></script>
<script defer src="https://unpkg.com/http-vue-loader"></script>
<script defer type="text/babel" data-presets="es2017,stage-3" src="router.js"></script>
<script defer type="text/babel" data-presets="es2017,stage-3" src="store.js"></script>
<script defer type="text/babel" data-presets="es2017,stage-3" src="main.js"></script>
</head>
<body>
<div id="app"></div>
</body>
</html>
new Vue({
el: '#app',
template: `<router-view></router-view>`,
store,
router,
});
httpVueLoader.langProcessor.babel = script => Babel.transform(script, { presets: ['es2017', 'stage-3'] }).code;
const router = new VueRouter({
mode: 'history',
routes: [
{
path: '/',
component: httpVueLoader('./homomaid.vue'),
},
],
});
const store = new Vuex.Store({
state: {
message: 'かのかのかの〜〜〜www',
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment