Add initial "logo" component
still just proving some concepts at this point
This commit is contained in:
parent
41e65b33c8
commit
7bdaeee691
|
@ -4,7 +4,7 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
"build": "vue-cli-service build"
|
"build": "vue-cli-service build --target lib --name byjove src/index.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vue": "^2.6.10",
|
"vue": "^2.6.10",
|
||||||
|
@ -14,5 +14,6 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vue/cli-service": "^3.0.5",
|
"@vue/cli-service": "^3.0.5",
|
||||||
"vue-template-compiler": "^2.6.10"
|
"vue-template-compiler": "^2.6.10"
|
||||||
}
|
},
|
||||||
|
"main": "./dist/byjove.umd.js"
|
||||||
}
|
}
|
||||||
|
|
17
src/appsettings.js
Normal file
17
src/appsettings.js
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
|
||||||
|
import packageData from "../package.json"
|
||||||
|
|
||||||
|
var appsettings = {
|
||||||
|
systemTitle: "Rattail",
|
||||||
|
appTitle: "Rattail-Mobile",
|
||||||
|
version: packageData.version,
|
||||||
|
production: false,
|
||||||
|
watermark: 'url("/tailbone/img/testing.png")',
|
||||||
|
|
||||||
|
// NOTE: you're encouraged to set this to a proper/working URL, but in fact
|
||||||
|
// the value shown here will *not* work. the logo component does not
|
||||||
|
// require you to set this at all, in which case it uses a default image.
|
||||||
|
//logo: 'assets/logo.png',
|
||||||
|
};
|
||||||
|
|
||||||
|
export default appsettings;
|
5
src/components/index.js
Normal file
5
src/components/index.js
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
import ByjoveLogo from './logo'
|
||||||
|
|
||||||
|
export {
|
||||||
|
ByjoveLogo,
|
||||||
|
}
|
27
src/components/logo/ByjoveLogo.vue
Normal file
27
src/components/logo/ByjoveLogo.vue
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<template>
|
||||||
|
<div class="logo">
|
||||||
|
<img v-if="appsettings.logo" :alt="alternateText" :src="appsettings.logo" />
|
||||||
|
<img v-if="!appsettings.logo" :alt="alternateText" src="../../assets/logo.png" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'ByjoveLogo',
|
||||||
|
props: {
|
||||||
|
appsettings: Object,
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
alternateText: function() {
|
||||||
|
return this.appsettings.systemTitle + " logo"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
img {
|
||||||
|
max-height: 200px;
|
||||||
|
max-width: 300px;
|
||||||
|
}
|
||||||
|
</style>
|
6
src/components/logo/index.js
Normal file
6
src/components/logo/index.js
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import Vue from 'vue'
|
||||||
|
import ByjoveLogo from './ByjoveLogo'
|
||||||
|
|
||||||
|
Vue.component('byjove-logo', ByjoveLogo)
|
||||||
|
|
||||||
|
export default ByjoveLogo
|
6
src/index.js
Normal file
6
src/index.js
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
import * as components from './components'
|
||||||
|
|
||||||
|
export * from './components'
|
||||||
|
|
||||||
|
export default {}
|
|
@ -1,18 +1,25 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="home">
|
<div class="home">
|
||||||
<img alt="Vue logo" src="../assets/logo.png">
|
<byjove-logo :appsettings="appsettings"></byjove-logo>
|
||||||
<HelloWorld msg="Welcome to Your Vue.js App"/>
|
<HelloWorld msg="Welcome to Your Vue.js App"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// @ is an alias to /src
|
import appsettings from '@/appsettings'
|
||||||
import HelloWorld from '@/components/HelloWorld.vue'
|
import {ByjoveLogo} from '@/components'
|
||||||
|
import HelloWorld from '@/components/HelloWorld'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'home',
|
name: 'home',
|
||||||
components: {
|
components: {
|
||||||
|
ByjoveLogo,
|
||||||
HelloWorld
|
HelloWorld
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
appsettings: appsettings,
|
||||||
}
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue