Broke out into .vue files and did a bunch of stupid shit to

master
AndroidDrew 7 years ago
parent fdacfdec9f
commit 11602a3761

@ -36,6 +36,7 @@
options: {
css: 'css-loader',
'scss': 'css-loader|sass-loader'
// extractCSS: true //don't want to do this when doing server side rendering
}
},
{

@ -1,8 +1,21 @@
const base = require('./webpack.base.config')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
//extends the base config object and include the new property plugins
const config = Object.assign({}, base, {
plugins: base.plugins || []
})
// We are using this because base config will be used for server side rendering
// but we don't need to extractCSS in that process only in our dev process
config.module.rules
.filter(x => { return x.loader == 'vue-loader'})
.forEach( x=> x.options.extractCSS = true)
config.plugins.push(
// This plugin accepts the file in which we want to save our styles
new ExtractTextPlugin('assets/styles.css')
)
module.exports = config

@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>Vuejs SPA</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, width=device-width">
<link rel="stylesheet" href="/assets/styles.css">
</head>
<body>
<div id="app"></div>

@ -29,6 +29,7 @@
"eslint-plugin-node": "^5.1.1",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"extract-text-webpack-plugin": "^3.0.2",
"node-sass": "^4.7.1",
"sass-loader": "^6.0.6",
"vue-loader": "^13.5.0",

@ -7,7 +7,7 @@ const app = new Vue({
render: h => h(AppLayout)
// Because fucktards in javascript want to make everything fucking insane
// we are going to use the "spread"
// ...AppLayout
// ...AppLayout //this part didn't work. I don't know why but
})
export { app }

@ -1,20 +1,21 @@
<template>
<div class="columns">
<div class="column is-one-third" v-for="(post, title) in posts" v-bind:key="post.id">
<div class="card">
<div class="card-content">
<h3>{{ post.title }}</h3>
{{ post.content }}
</div>
<footer class="card-footer">
<a class="card-footer-item" v-bind:href="post.link" target="_blank">Read More</a>
</footer>
</div>
<app-post>
<h3 slot="title">{{ post.title }}</h3>
<span slot="content">{{ post.content }}</span>
<a slot="link" class="card-footer-item" :href="post.link" target="_blank">Read More</a>
</app-post>
</div>
</div>
</template>
<script>
import Post from './Post.vue'
export default {
components: {
'app-post': Post
},
// whey are we doing it like this?
data () {
return {
posts: [

@ -0,0 +1,30 @@
<template>
<div class="card">
<div class="card-content">
<slot name="title"></slot>
<slot name="content"></slot>
</div>
<footer class="card-footer">
<slot name="link"></slot>
</footer>
</div>
</template>
<script>
export default {
props: ['post']
}
</script>
<style scoped>
.card {
padding-bottom: 40px;
height: 100%;
}
footer {
position: absolute;
bottom: 0;
width: 100%;
left: 0;
}
</style>
Loading…
Cancel
Save